// 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)
virtual void Init()
{
}
+ virtual ~TreeCtrlComboPopup()
+ {
+ if (!m_isBeingDeleted)
+ {
+ wxMessageBox("error wxTreeCtrl::Destroy() was not called");
+ }
+ SendDestroyEvent();
+ }
virtual bool Create( wxWindow* parent )
{
wxWindow* win = GetPopupWindow();
win->SetSize(rect);
win->Raise(); // This is needed
- win->ShowWithEffect(wxSHOW_EFFECT_SLIDE_TO_BOTTOM);
+ win->ShowWithEffect(wxSHOW_EFFECT_BLEND);
return true;
}
};
//
rowSizer = new wxBoxSizer( wxHORIZONTAL );
- rowSizer->Add( new wxStaticText(panel,wxID_ANY,wxT("List View wxComboCtrl:")), 1,
- wxALIGN_CENTER_VERTICAL|wxRIGHT, 4 );
+ rowSizer->Add( new wxStaticText(panel,
+ wxID_ANY,
+ "List View wxComboCtrl (custom animation):"),
+ 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4 );
rowSizer->Add( new wxStaticText(panel,wxID_ANY,wxT("Tree Ctrl wxComboCtrl:")), 1,
wxALIGN_CENTER_VERTICAL|wxRIGHT, 4 );
colSizer->Add( rowSizer, 0, wxEXPAND|wxALL, 5 );
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.
{
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) )