X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dfb4176ac5f9017542405618f534899a56ba0e6e..89b3361ec25cf1e6d255b14c7633d8375646e4fb:/samples/widgets/combobox.cpp?ds=inline diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index 5eb34f42da..23fd516a01 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -124,6 +124,7 @@ protected: void OnCloseup(wxCommandEvent& event); void OnComboBox(wxCommandEvent& event); void OnComboText(wxCommandEvent& event); + void OnComboTextPasted(wxClipboardTextEvent& event); void OnCheckOrRadioBox(wxCommandEvent& event); @@ -215,6 +216,7 @@ BEGIN_EVENT_TABLE(ComboboxWidgetsPage, WidgetsPage) EVT_COMBOBOX_CLOSEUP(ComboPage_Combo, ComboboxWidgetsPage::OnCloseup) EVT_TEXT(ComboPage_Combo, ComboboxWidgetsPage::OnComboText) EVT_TEXT_ENTER(ComboPage_Combo, ComboboxWidgetsPage::OnComboText) + EVT_TEXT_PASTE(ComboPage_Combo, ComboboxWidgetsPage::OnComboTextPasted) EVT_CHECKBOX(wxID_ANY, ComboboxWidgetsPage::OnCheckOrRadioBox) EVT_RADIOBOX(wxID_ANY, ComboboxWidgetsPage::OnCheckOrRadioBox) @@ -481,11 +483,7 @@ void ComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) int sel = m_combobox->GetSelection(); if ( sel != wxNOT_FOUND ) { -#ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); -#else - wxLogMessage(wxT("Not implemented in wxGTK")); -#endif } } @@ -666,6 +664,12 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) } } +void ComboboxWidgetsPage::OnComboTextPasted(wxClipboardTextEvent& event) +{ + wxLogMessage("Text pasted from clipboard."); + event.Skip(); +} + void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); @@ -676,6 +680,12 @@ void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) wxLogMessage(wxT("Combobox item %ld selected"), sel); wxLogMessage(wxT("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + + if ( event.GetString() != m_combobox->GetValue() ) + { + wxLogMessage("ERROR: Event has different string \"%s\"", + event.GetString()); + } } void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))