]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
853dcc57 | 2 | // Name: wx/os2/choice.h |
0e320a79 | 3 | // Purpose: wxChoice class |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CHOICE_H_ | |
13 | #define _WX_CHOICE_H_ | |
14 | ||
0e320a79 | 15 | // Choice item |
409c9842 | 16 | class WXDLLEXPORT wxChoice: public wxChoiceBase |
0e320a79 DW |
17 | { |
18 | DECLARE_DYNAMIC_CLASS(wxChoice) | |
19 | ||
dcd307ee DW |
20 | public: |
21 | // ctors | |
22 | inline wxChoice() { } | |
0e320a79 | 23 | |
fb49f3b3 DW |
24 | inline wxChoice( wxWindow* pParent |
25 | ,wxWindowID vId | |
26 | ,const wxPoint& rPos = wxDefaultPosition | |
27 | ,const wxSize& rSize = wxDefaultSize | |
28 | ,int n = 0 | |
29 | ,const wxString asChoices[] = NULL | |
30 | ,long lStyle = 0 | |
fb49f3b3 | 31 | ,const wxValidator& rValidator = wxDefaultValidator |
fb49f3b3 DW |
32 | ,const wxString& rsName = wxChoiceNameStr |
33 | ) | |
dcd307ee | 34 | { |
fb49f3b3 DW |
35 | Create( pParent |
36 | ,vId | |
37 | ,rPos | |
38 | ,rSize | |
39 | ,n | |
40 | ,asChoices | |
41 | ,lStyle | |
fb49f3b3 | 42 | ,rValidator |
fb49f3b3 DW |
43 | ,rsName |
44 | ); | |
dcd307ee | 45 | } |
0e320a79 | 46 | |
584ad2a3 MB |
47 | inline wxChoice( wxWindow* pParent |
48 | ,wxWindowID vId | |
49 | ,const wxPoint& rPos | |
50 | ,const wxSize& rSize | |
51 | ,const wxArrayString& asChoices | |
52 | ,long lStyle = 0 | |
53 | ,const wxValidator& rValidator = wxDefaultValidator | |
54 | ,const wxString& rsName = wxChoiceNameStr | |
55 | ) | |
56 | { | |
57 | Create( pParent | |
58 | ,vId | |
59 | ,rPos | |
60 | ,rSize | |
61 | ,asChoices | |
62 | ,lStyle | |
63 | ,rValidator | |
64 | ,rsName | |
65 | ); | |
66 | } | |
67 | ||
fb49f3b3 DW |
68 | bool Create( wxWindow* pParent |
69 | ,wxWindowID vId | |
70 | ,const wxPoint& rPos = wxDefaultPosition | |
71 | ,const wxSize& rSize = wxDefaultSize | |
72 | ,int n = 0 | |
73 | ,const wxString asChoices[] = NULL | |
74 | ,long lStyle = 0 | |
fb49f3b3 | 75 | ,const wxValidator& rValidator = wxDefaultValidator |
fb49f3b3 DW |
76 | ,const wxString& rsName = wxChoiceNameStr |
77 | ); | |
0e320a79 | 78 | |
584ad2a3 MB |
79 | bool Create( wxWindow* pParent |
80 | ,wxWindowID vId | |
81 | ,const wxPoint& rPos | |
82 | ,const wxSize& rSize | |
83 | ,const wxArrayString& asChoices | |
84 | ,long lStyle = 0 | |
85 | ,const wxValidator& rValidator = wxDefaultValidator | |
86 | ,const wxString& rsName = wxChoiceNameStr | |
87 | ); | |
88 | ||
fb49f3b3 | 89 | // |
dcd307ee | 90 | // Implement base class virtuals |
fb49f3b3 DW |
91 | // |
92 | virtual int DoAppend(const wxString& rsItem); | |
243dbf1a | 93 | virtual int DoInsert(const wxString& rsItem, int pos); |
fb49f3b3 DW |
94 | virtual void Delete(int n); |
95 | virtual void Clear(void); | |
37f214d5 | 96 | |
8228b893 | 97 | virtual size_t GetCount() const; |
fb49f3b3 DW |
98 | virtual int GetSelection(void) const ; |
99 | virtual void SetSelection(int n); | |
37f214d5 | 100 | |
dcd307ee | 101 | virtual wxString GetString(int n) const ; |
fb49f3b3 DW |
102 | virtual void SetString( int n |
103 | ,const wxString& rsStr | |
104 | ); | |
0e320a79 | 105 | |
fb49f3b3 | 106 | // |
dcd307ee | 107 | // OS2 only |
fb49f3b3 DW |
108 | // |
109 | virtual bool OS2Command( WXUINT uParam | |
110 | ,WXWORD wId | |
111 | ); | |
112 | MRESULT OS2WindowProc( WXUINT uMsg | |
113 | ,WXWPARAM wParam | |
114 | ,WXLPARAM lParam | |
115 | ); | |
0e320a79 DW |
116 | |
117 | protected: | |
fb49f3b3 DW |
118 | virtual void DoSetItemClientData( int n |
119 | ,void* pClientData | |
120 | ); | |
121 | virtual void* DoGetItemClientData(int n) const; | |
122 | virtual void DoSetItemClientObject( int n | |
123 | ,wxClientData* pClientData | |
124 | ); | |
125 | virtual wxClientData* DoGetItemClientObject(int n) const; | |
126 | virtual wxSize DoGetBestSize(void) const; | |
127 | virtual void DoSetSize( int nX | |
128 | ,int nY | |
129 | ,int nWidth | |
130 | ,int nHeight | |
131 | ,int nsizeFlags = wxSIZE_AUTO | |
132 | ); | |
133 | void Free(void); | |
134 | }; // end of CLASS wxChoice | |
0e320a79 | 135 | |
37f214d5 | 136 | #endif // _WX_CHOICE_H_ |