]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/choice.h
fix the new wxThreadEvent class adopting the new type-safe conventions for event...
[wxWidgets.git] / include / wx / osx / choice.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/choice.h
3 // Purpose: wxChoice class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CHOICE_H_
13 #define _WX_CHOICE_H_
14
15 #include "wx/control.h"
16
17 #include "wx/dynarray.h"
18 #include "wx/arrstr.h"
19
20 WXDLLIMPEXP_DATA_CORE(extern const char) wxChoiceNameStr[];
21
22 WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ;
23
24 // Choice item
25 class WXDLLIMPEXP_CORE wxChoice: public wxChoiceBase
26 {
27 DECLARE_DYNAMIC_CLASS(wxChoice)
28
29 public:
30 wxChoice()
31 : m_strings(), m_datas()
32 {}
33
34 virtual ~wxChoice() ;
35
36 wxChoice(wxWindow *parent, wxWindowID id,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 int n = 0, const wxString choices[] = NULL,
40 long style = 0,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxChoiceNameStr)
43 {
44 Create(parent, id, pos, size, n, choices, style, validator, name);
45 }
46 wxChoice(wxWindow *parent, wxWindowID id,
47 const wxPoint& pos,
48 const wxSize& size,
49 const wxArrayString& choices,
50 long style = 0,
51 const wxValidator& validator = wxDefaultValidator,
52 const wxString& name = wxChoiceNameStr)
53 {
54 Create(parent, id, pos, size, choices, style, validator, name);
55 }
56
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,
61 long style = 0,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = wxChoiceNameStr);
64 bool Create(wxWindow *parent, wxWindowID id,
65 const wxPoint& pos,
66 const wxSize& size,
67 const wxArrayString& choices,
68 long style = 0,
69 const wxValidator& validator = wxDefaultValidator,
70 const wxString& name = wxChoiceNameStr);
71
72 virtual unsigned int GetCount() const ;
73 virtual int GetSelection() const ;
74 virtual void SetSelection(int n);
75
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
80
81 virtual bool OSXHandleClicked( double timestampsec );
82
83 protected:
84 virtual void DoDeleteOneItem(unsigned int n);
85 virtual void DoClear();
86
87 virtual wxSize DoGetBestSize() const ;
88 virtual int DoInsertItems(const wxArrayStringsAdapter& items,
89 unsigned int pos,
90 void **clientData, wxClientDataType type);
91
92 virtual void DoSetItemClientData(unsigned int n, void* clientData);
93 virtual void* DoGetItemClientData(unsigned int n) const;
94
95 wxArrayString m_strings;
96 wxChoiceDataArray m_datas ;
97 wxMenu* m_popUpMenu ;
98 };
99
100 #endif
101 // _WX_CHOICE_H_