X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1169a91932273bc84c23ed9dbd0a2da064d59d66..6926b9c403f8d1917af007042a333b2a04d8b35c:/include/wx/msw/listbox.h diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index 657c2c344a..43350ba8aa 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -32,7 +32,7 @@ #endif // wxUSE_OWNER_DRAWN // forward decl for GetSelections() -class wxArrayInt; +class WXDLLIMPEXP_BASE wxArrayInt; // ---------------------------------------------------------------------------- // List box control @@ -49,7 +49,20 @@ public: int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr); + const wxString& name = wxListBoxNameStr) + { + Create(parent, id, pos, size, n, choices, style, validator, name); + } + wxListBox(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxListBoxNameStr) + { + Create(parent, id, pos, size, choices, style, validator, name); + } bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, @@ -58,6 +71,13 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxListBoxNameStr); virtual ~wxListBox(); @@ -71,7 +91,7 @@ public: virtual int FindString(const wxString& s) const; virtual bool IsSelected(int n) const; - virtual void SetSelection(int n, bool select = TRUE); + virtual void DoSetSelection(int n, bool select); virtual int GetSelection() const; virtual int GetSelections(wxArrayInt& aSelections) const; @@ -109,9 +129,20 @@ public: // Windows callbacks bool MSWCommand(WXUINT param, WXWORD id); - virtual void SetupColours(); + virtual wxVisualAttributes GetDefaultAttributes() const + { + return GetClassDefaultAttributes(GetWindowVariant()); + } + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL) + { + return GetCompositeControlsDefaultAttributes(variant); + } protected: + WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; + // free memory (common part of Clear() and dtor) void Free(); @@ -120,6 +151,13 @@ protected: virtual wxSize DoGetBestSize() const; + // under XP when using "transition effect for menus and tooltips" if we + // return true for WM_PRINTCLIENT here then it causes noticable slowdown + virtual bool MSWShouldPropagatePrintChild() + { + return false; + } + #if wxUSE_OWNER_DRAWN // control items wxListBoxItemsArray m_aItems;