Generate clipboard events for wxComboBox in wxGTK too.

These events were only generated for wxTextCtrl but should be sent for
non-readonly wxComboBox too, so refactor the code to allow its reuse from
wxComboBox.

Also add EVT_TEXT_PASTE handlers for both controls to the widgets sample for
testing.

Closes #14520.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-07-29 22:08:15 +00:00
parent 756ead6f83
commit 1043456035
7 changed files with 85 additions and 52 deletions

View File

@@ -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();