many wxItemContainer-related changes:
1. the main function for item insertion is now DoInsertItems() which allows for much more efficient addition of many new items at once 2. the items client data management is done entirely in wxItemContainer itself, the derived classes don't have to distinguish between void and object client data 3. many fixes for sorted controls, in particular implemented wxCB_SORT support in wxGTK combobox git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
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,
|
||||
@@ -71,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;
|
||||
@@ -125,10 +125,9 @@ 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();
|
||||
@@ -145,13 +144,12 @@ protected:
|
||||
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;
|
||||
@@ -161,6 +159,10 @@ 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()
|
||||
};
|
||||
|
Reference in New Issue
Block a user