adding clipboard events, fixes #11906
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -314,13 +314,31 @@ void wxTextCtrl::Clear()
|
||||
SendTextUpdatedEvent();
|
||||
}
|
||||
|
||||
void wxTextCtrl::Copy()
|
||||
{
|
||||
if (CanCopy())
|
||||
{
|
||||
wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
|
||||
evt.SetEventObject(this);
|
||||
if (!GetEventHandler()->ProcessEvent(evt))
|
||||
{
|
||||
wxTextEntry::Copy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::Cut()
|
||||
{
|
||||
if (CanCut())
|
||||
{
|
||||
wxTextEntry::Cut() ;
|
||||
wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_CUT, GetId());
|
||||
evt.SetEventObject(this);
|
||||
if (!GetEventHandler()->ProcessEvent(evt))
|
||||
{
|
||||
wxTextEntry::Cut();
|
||||
|
||||
SendTextUpdatedEvent();
|
||||
SendTextUpdatedEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,10 +346,15 @@ void wxTextCtrl::Paste()
|
||||
{
|
||||
if (CanPaste())
|
||||
{
|
||||
wxTextEntry::Paste();
|
||||
wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_PASTE, GetId());
|
||||
evt.SetEventObject(this);
|
||||
if (!GetEventHandler()->ProcessEvent(evt))
|
||||
{
|
||||
wxTextEntry::Paste();
|
||||
|
||||
// TODO: eventually we should add setting the default style again
|
||||
SendTextUpdatedEvent();
|
||||
// TODO: eventually we should add setting the default style again
|
||||
SendTextUpdatedEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user