diff --git a/include/wx/univ/listbox.h b/include/wx/univ/listbox.h index 4f8c063ca4..2d120b1613 100644 --- a/include/wx/univ/listbox.h +++ b/include/wx/univ/listbox.h @@ -261,6 +261,10 @@ protected: // and this one the client data (either void or wxClientData) wxArrayPtrVoid m_itemsClientData; + // this is hold the input handler type. the input handler is different + // between ListBox and its subclass--CheckListbox + wxString m_inputHandlerType; + // the current item int m_current; diff --git a/src/univ/checklst.cpp b/src/univ/checklst.cpp index defc6f028e..17bdb1b378 100644 --- a/src/univ/checklst.cpp +++ b/src/univ/checklst.cpp @@ -62,6 +62,7 @@ public: void wxCheckListBox::Init() { + m_inputHandlerType = wxINP_HANDLER_CHECKLISTBOX; } wxCheckListBox::wxCheckListBox(wxWindow *parent, @@ -107,8 +108,6 @@ bool wxCheckListBox::Create(wxWindow *parent, n, choices, style, validator, name) ) return false; - CreateInputHandler(wxINP_HANDLER_CHECKLISTBOX); - return true; } diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp index 441cd646d7..7841fb87fc 100644 --- a/src/univ/listbox.cpp +++ b/src/univ/listbox.cpp @@ -127,6 +127,7 @@ void wxListBox::Init() m_showScrollbarX = m_updateScrollbarY = m_showScrollbarY = false; + m_inputHandlerType = wxINP_HANDLER_LISTBOX; } wxListBox::wxListBox(wxWindow *parent, @@ -198,7 +199,7 @@ bool wxListBox::Create(wxWindow *parent, SetInitialSize(size); - CreateInputHandler(wxINP_HANDLER_LISTBOX); + CreateInputHandler(m_inputHandlerType); return true; }