X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0dbe4363e45829594365f1f478cdb7540cd78ee9..c29c95fe24973b94fd724db767193171ca7c513d:/samples/combo/combo.cpp diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index d034aff241..e31bcee2e0 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -125,6 +125,7 @@ enum // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_TEXT(wxID_ANY,MyFrame::OnComboBoxUpdate) + EVT_TEXT_ENTER(wxID_ANY,MyFrame::OnComboBoxUpdate) EVT_COMBOBOX(wxID_ANY,MyFrame::OnComboBoxUpdate) EVT_MENU(ComboCtrl_Compare, MyFrame::OnShowComparison) @@ -376,6 +377,14 @@ public: virtual void Init() { } + virtual ~TreeCtrlComboPopup() + { + if (!m_isBeingDeleted) + { + wxMessageBox("error wxTreeCtrl::Destroy() was not called"); + } + SendDestroyEvent(); + } virtual bool Create( wxWindow* parent ) { @@ -753,6 +762,11 @@ MyFrame::MyFrame(const wxString& title) rowSizer = new wxBoxSizer( wxHORIZONTAL ); cc = new wxComboCtrlWithCustomPopupAnim(); + + // Let's set a custom style for the contained wxTextCtrl. We need to + // use two-step creation for it to work properly. + cc->SetTextCtrlStyle(wxTE_RIGHT); + cc->Create(panel, wxID_ANY, wxEmptyString); // Make sure we use popup that allows focusing the listview. @@ -933,6 +947,11 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event ) { wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str()); } + else if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER ) + { + wxLogDebug("EVT_TEXT_ENTER(id=%i,string=\"%s\")", + event.GetId(), event.GetString().c_str()); + } } void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) )