Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Cut/Copy/Paste Controls

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Cut/Copy/Paste Controls
#5155
Posted by: 2004-09-29 18:38:00
Excuse for my bad english.

I have to make a cut/copy/paste controls for an aplication with wxwindows libraries. the aplication is based in a principal frame with a various small dialogs with numerical inputs (wxTextCtrl). I only want cut/copy/paste the data's of these wxtextctrl of the custom dialogs that I have made.

I have thought searching in the documentation in three options.

a) Using the wxclipboard class, but. How the program knows what text is selected?
b) Using some functions of the wxtextctrl. (virtual void cut() for example).
c) When the cut/copy/paste tool is pushed launch an event like like Ctrl+v Ctrl+x (external events).

If anyone knows, where are some code or an example.

Thanks for all
Message2. Re: Cut/Copy/Paste Controls
#5242
Posted by: Hovrino 2004-10-15 20:42:32
 Use standard Cut/Copy/Paste functions. May be this will be solution. I wrote this functions to organize my Edit menu. And TextCtrl itself supports cut&paste without any additional code.
// text editor control
    vTextCtrl *m_pTextCtrl;
.....
// Basic edit functions
void MyFrame::OnCopy(wxCommandEvent& event)
{
 m_pTextCtrl->Copy(); 
}

void MyFrame::OnCut(wxCommandEvent& event)
{
 m_pTextCtrl->Cut(); 
}

void MyFrame::OnPaste(wxCommandEvent& event)
{
 m_pTextCtrl->Paste(); 
}
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2024-12-11  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0