X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d95c5149add596d0dec940599332a24edf96dc38..8e4b5265cdd7aeea67c85eb0f50186641f09f7d8:/include/wx/gtk/combobox.h diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index 4d2e419530..f77165b975 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -8,27 +8,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __GTKCOMBOBOXH__ -#define __GTKCOMBOBOXH__ - -#include "wx/defs.h" - -#if wxUSE_COMBOBOX - -#include "wx/object.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxComboBox; - -//----------------------------------------------------------------------------- -// global data -//----------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxComboBoxNameStr[]; -extern WXDLLIMPEXP_BASE const wxChar* wxEmptyString; +#ifndef _WX_GTK_COMBOBOX_H_ +#define _WX_GTK_COMBOBOX_H_ //----------------------------------------------------------------------------- // wxComboBox @@ -37,7 +18,7 @@ extern WXDLLIMPEXP_BASE const wxChar* wxEmptyString; class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase { public: - inline wxComboBox() {} + inline wxComboBox() { m_strings = NULL; } inline wxComboBox(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, @@ -61,7 +42,7 @@ public: Create(parent, id, value, pos, size, choices, style, validator, name); } - ~wxComboBox(); + virtual ~wxComboBox(); bool Create(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, @@ -90,8 +71,8 @@ public: wxString GetStringSelection() const; // not a virtual in parent class // From wxItemContainer: - virtual void Clear(); - virtual void Delete(unsigned int n); + virtual void DoClear(); + virtual void DoDeleteOneItem(unsigned int n); // From wxBomboBoxBase: virtual wxString GetValue() const; @@ -144,15 +125,13 @@ public: void OnUpdateDelete(wxUpdateUIEvent& event); void OnUpdateSelectAll(wxUpdateUIEvent& event); - bool m_ignoreNextUpdate:1; - wxList m_clientDataList; - wxList m_clientObjectList; - int m_prevSelection; + bool m_ignoreNextUpdate:1; + wxArrayPtrVoid m_clientData; + int m_prevSelection; void DisableEvents(); void EnableEvents(); GtkWidget* GetConnectWidget(); - bool IsOwnGtkWindow( GdkWindow *window ); wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST @@ -161,16 +140,16 @@ public: protected: // From wxWindowGTK: - void DoApplyWidgetStyle(GtkRcStyle *style); + virtual void DoApplyWidgetStyle(GtkRcStyle *style); + virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; // From wxItemContainer: - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, unsigned int pos); - + virtual int DoInsertItems(const wxArrayStringsAdapter& items, + unsigned int pos, + void **clientData, wxClientDataType type); virtual void DoSetItemClientData(unsigned int n, void* clientData); virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; + virtual bool IsSorted() const { return HasFlag(wxCB_SORT); } // From wxControl: virtual wxSize DoGetBestSize() const; @@ -180,12 +159,12 @@ protected: virtual bool UseGTKStyleBase() const { return true; } private: + // this array is only used for controls with wxCB_SORT style, so only + // allocate it if it's needed (hence using pointer) + wxSortedArrayString *m_strings; + DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox) DECLARE_EVENT_TABLE() }; -#endif - -#endif - - // __GTKCOMBOBOXH__ +#endif // _WX_GTK_COMBOBOX_H_