// 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
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,
Create(parent, id, value, pos, size, choices, style, validator, name);
}
- ~wxComboBox();
+ virtual ~wxComboBox();
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
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;
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();
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;
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_