1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/choice.h
3 // Purpose: wxChoice class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/control.h"
17 #include "wx/dynarray.h"
18 #include "wx/arrstr.h"
20 WXDLLIMPEXP_DATA_CORE(extern const char) wxChoiceNameStr
[];
22 WX_DEFINE_ARRAY( char * , wxChoiceDataArray
) ;
25 class WXDLLIMPEXP_CORE wxChoice
: public wxChoiceBase
27 DECLARE_DYNAMIC_CLASS(wxChoice
)
31 : m_strings(), m_datas()
36 wxChoice(wxWindow
*parent
, wxWindowID id
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
39 int n
= 0, const wxString choices
[] = NULL
,
41 const wxValidator
& validator
= wxDefaultValidator
,
42 const wxString
& name
= wxChoiceNameStr
)
44 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
46 wxChoice(wxWindow
*parent
, wxWindowID id
,
49 const wxArrayString
& choices
,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxChoiceNameStr
)
54 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
57 bool Create(wxWindow
*parent
, wxWindowID id
,
58 const wxPoint
& pos
= wxDefaultPosition
,
59 const wxSize
& size
= wxDefaultSize
,
60 int n
= 0, const wxString choices
[] = NULL
,
62 const wxValidator
& validator
= wxDefaultValidator
,
63 const wxString
& name
= wxChoiceNameStr
);
64 bool Create(wxWindow
*parent
, wxWindowID id
,
67 const wxArrayString
& choices
,
69 const wxValidator
& validator
= wxDefaultValidator
,
70 const wxString
& name
= wxChoiceNameStr
);
72 virtual unsigned int GetCount() const ;
73 virtual int GetSelection() const ;
74 virtual void SetSelection(int n
);
76 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
77 virtual wxString
GetString(unsigned int n
) const ;
78 virtual void SetString(unsigned int pos
, const wxString
& s
);
79 // osx specific event handling common for all osx-ports
81 virtual bool OSXHandleClicked( double timestampsec
);
84 virtual void DoDeleteOneItem(unsigned int n
);
85 virtual void DoClear();
87 virtual wxSize
DoGetBestSize() const ;
88 virtual int DoInsertItems(const wxArrayStringsAdapter
& items
,
90 void **clientData
, wxClientDataType type
);
92 virtual void DoSetItemClientData(unsigned int n
, void* clientData
);
93 virtual void* DoGetItemClientData(unsigned int n
) const;
95 wxArrayString m_strings
;
96 wxChoiceDataArray m_datas
;