{
public:
// ctors and such
- wxListBox();
+ wxListBox() { Init(); }
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
+ Init();
+
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
+ Init();
+
Create(parent, id, pos, size, choices, style, validator, name);
}
virtual void OnInternalIdle();
+ virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+
protected:
virtual wxSize DoGetBestClientSize() const;
#endif
private:
+ // common part of all ctors
+ void Init();
+
// call this when items are added to or deleted from the listbox or an
// items text changes
void MSWOnItemsChanged();
// i.e. if we need to call SetHorizontalExtent() from OnInternalIdle()
bool m_updateHorizontalExtent;
+ // flag set to true when we get a keyboard event and reset to false when we
+ // get a mouse one: this is used to find the correct item for the selection
+ // event
+ bool m_selectedByKeyboard;
+
DECLARE_DYNAMIC_CLASS_NO_COPY(wxListBox)
};