X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526954c5968baa29218c994ec48e476ae2bd4b9f..3f7564f229450a9c036141878ee75cc09078a945:/samples/widgets/textctrl.cpp?ds=sidebyside diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index ee87e1a6af..c69f23d0b5 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -171,6 +171,7 @@ protected: void OnText(wxCommandEvent& event); void OnTextEnter(wxCommandEvent& event); + void OnTextPasted(wxClipboardTextEvent& event); void OnCheckOrRadioBox(wxCommandEvent& event); @@ -326,6 +327,7 @@ BEGIN_EVENT_TABLE(TextWidgetsPage, WidgetsPage) EVT_TEXT(TextPage_Textctrl, TextWidgetsPage::OnText) EVT_TEXT_ENTER(TextPage_Textctrl, TextWidgetsPage::OnTextEnter) + EVT_TEXT_PASTE(TextPage_Textctrl, TextWidgetsPage::OnTextPasted) EVT_CHECKBOX(wxID_ANY, TextWidgetsPage::OnCheckOrRadioBox) EVT_RADIOBOX(wxID_ANY, TextWidgetsPage::OnCheckOrRadioBox) @@ -921,6 +923,12 @@ void TextWidgetsPage::OnTextEnter(wxCommandEvent& event) event.Skip(); } +void TextWidgetsPage::OnTextPasted(wxClipboardTextEvent& event) +{ + wxLogMessage("Text pasted from clipboard."); + event.Skip(); +} + void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) { CreateText();