]>
Commit | Line | Data |
---|---|---|
ffecfa5a JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: choice.cpp | |
3 | // Purpose: wxChoice | |
4 | // Author: William Osborne | |
5 | // Created: 10/13/04 | |
6 | // RCS-ID: $Id: | |
7 | // Copyright: (c) William Osborne | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | // ============================================================================ | |
12 | // declarations | |
13 | // ============================================================================ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
20 | #pragma implementation "choice.h" | |
21 | #endif | |
22 | ||
23 | // For compilers that support precompilation, includes "wx.h". | |
24 | #include "wx/wxprec.h" | |
25 | ||
26 | #ifdef __BORLANDC__ | |
27 | #pragma hdrstop | |
28 | #endif | |
29 | ||
30 | #if wxUSE_CHOICE | |
31 | ||
32 | #ifndef WX_PRECOMP | |
33 | #include "wx/choice.h" | |
34 | #include "wx/utils.h" | |
35 | #include "wx/log.h" | |
36 | #include "wx/brush.h" | |
37 | #include "wx/settings.h" | |
38 | #endif | |
39 | ||
40 | #include "wx/palmos/private.h" | |
41 | ||
42 | #if wxUSE_EXTENDED_RTTI | |
43 | WX_DEFINE_FLAGS( wxChoiceStyle ) | |
44 | ||
45 | wxBEGIN_FLAGS( wxChoiceStyle ) | |
46 | // new style border flags, we put them first to | |
47 | // use them for streaming out | |
48 | wxFLAGS_MEMBER(wxBORDER_SIMPLE) | |
49 | wxFLAGS_MEMBER(wxBORDER_SUNKEN) | |
50 | wxFLAGS_MEMBER(wxBORDER_DOUBLE) | |
51 | wxFLAGS_MEMBER(wxBORDER_RAISED) | |
52 | wxFLAGS_MEMBER(wxBORDER_STATIC) | |
53 | wxFLAGS_MEMBER(wxBORDER_NONE) | |
54 | ||
55 | // old style border flags | |
56 | wxFLAGS_MEMBER(wxSIMPLE_BORDER) | |
57 | wxFLAGS_MEMBER(wxSUNKEN_BORDER) | |
58 | wxFLAGS_MEMBER(wxDOUBLE_BORDER) | |
59 | wxFLAGS_MEMBER(wxRAISED_BORDER) | |
60 | wxFLAGS_MEMBER(wxSTATIC_BORDER) | |
61 | wxFLAGS_MEMBER(wxBORDER) | |
62 | ||
63 | // standard window styles | |
64 | wxFLAGS_MEMBER(wxTAB_TRAVERSAL) | |
65 | wxFLAGS_MEMBER(wxCLIP_CHILDREN) | |
66 | wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) | |
67 | wxFLAGS_MEMBER(wxWANTS_CHARS) | |
68 | wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) | |
69 | wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) | |
70 | wxFLAGS_MEMBER(wxVSCROLL) | |
71 | wxFLAGS_MEMBER(wxHSCROLL) | |
72 | ||
73 | wxEND_FLAGS( wxChoiceStyle ) | |
74 | ||
75 | IMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice, wxControl,"wx/choice.h") | |
76 | ||
77 | wxBEGIN_PROPERTIES_TABLE(wxChoice) | |
78 | wxEVENT_PROPERTY( Select , wxEVT_COMMAND_CHOICE_SELECTED , wxCommandEvent ) | |
79 | ||
80 | wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
81 | wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
82 | wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
83 | wxPROPERTY_FLAGS( WindowStyle , wxChoiceStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style | |
84 | wxEND_PROPERTIES_TABLE() | |
85 | ||
86 | wxBEGIN_HANDLERS_TABLE(wxChoice) | |
87 | wxEND_HANDLERS_TABLE() | |
88 | ||
89 | wxCONSTRUCTOR_4( wxChoice , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size ) | |
90 | #else | |
91 | IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) | |
92 | #endif | |
93 | ||
94 | // ============================================================================ | |
95 | // implementation | |
96 | // ============================================================================ | |
97 | ||
98 | // ---------------------------------------------------------------------------- | |
99 | // creation | |
100 | // ---------------------------------------------------------------------------- | |
101 | ||
102 | bool wxChoice::Create(wxWindow *parent, | |
103 | wxWindowID id, | |
104 | const wxPoint& pos, | |
105 | const wxSize& size, | |
106 | int n, const wxString choices[], | |
107 | long style, | |
108 | const wxValidator& validator, | |
109 | const wxString& name) | |
110 | { | |
111 | return false; | |
112 | } | |
113 | ||
114 | bool wxChoice::CreateAndInit(wxWindow *parent, | |
115 | wxWindowID id, | |
116 | const wxPoint& pos, | |
117 | const wxSize& size, | |
118 | int n, const wxString choices[], | |
119 | long style, | |
120 | const wxValidator& validator, | |
121 | const wxString& name) | |
122 | { | |
123 | return FALSE; | |
124 | } | |
125 | ||
126 | bool wxChoice::Create(wxWindow *parent, | |
127 | wxWindowID id, | |
128 | const wxPoint& pos, | |
129 | const wxSize& size, | |
130 | const wxArrayString& choices, | |
131 | long style, | |
132 | const wxValidator& validator, | |
133 | const wxString& name) | |
134 | { | |
135 | return false; | |
136 | } | |
137 | ||
138 | bool wxChoice::MSWShouldPreProcessMessage(WXMSG *pMsg) | |
139 | { | |
140 | return false; | |
141 | } | |
142 | ||
143 | WXDWORD wxChoice::MSWGetStyle(long style, WXDWORD *exstyle) const | |
144 | { | |
145 | return 0; | |
146 | } | |
147 | ||
148 | wxChoice::~wxChoice() | |
149 | { | |
150 | } | |
151 | ||
152 | // ---------------------------------------------------------------------------- | |
153 | // adding/deleting items to/from the list | |
154 | // ---------------------------------------------------------------------------- | |
155 | ||
156 | int wxChoice::DoAppend(const wxString& item) | |
157 | { | |
158 | return 0; | |
159 | } | |
160 | ||
161 | int wxChoice::DoInsert(const wxString& item, int pos) | |
162 | { | |
163 | return 0; | |
164 | } | |
165 | ||
166 | void wxChoice::Delete(int n) | |
167 | { | |
168 | } | |
169 | ||
170 | void wxChoice::Clear() | |
171 | { | |
172 | } | |
173 | ||
174 | void wxChoice::Free() | |
175 | { | |
176 | } | |
177 | ||
178 | // ---------------------------------------------------------------------------- | |
179 | // selection | |
180 | // ---------------------------------------------------------------------------- | |
181 | ||
182 | int wxChoice::GetSelection() const | |
183 | { | |
184 | return 0; | |
185 | } | |
186 | ||
187 | void wxChoice::SetSelection(int n) | |
188 | { | |
189 | } | |
190 | ||
191 | // ---------------------------------------------------------------------------- | |
192 | // string list functions | |
193 | // ---------------------------------------------------------------------------- | |
194 | ||
195 | int wxChoice::GetCount() const | |
196 | { | |
197 | return 0; | |
198 | } | |
199 | ||
200 | int wxChoice::FindString(const wxString& s) const | |
201 | { | |
202 | return 0; | |
203 | } | |
204 | ||
205 | void wxChoice::SetString(int n, const wxString& s) | |
206 | { | |
207 | } | |
208 | ||
209 | wxString wxChoice::GetString(int n) const | |
210 | { | |
211 | wxString str; | |
212 | ||
213 | return str; | |
214 | } | |
215 | ||
216 | // ---------------------------------------------------------------------------- | |
217 | // client data | |
218 | // ---------------------------------------------------------------------------- | |
219 | ||
220 | void wxChoice::DoSetItemClientData( int n, void* clientData ) | |
221 | { | |
222 | } | |
223 | ||
224 | void* wxChoice::DoGetItemClientData( int n ) const | |
225 | { | |
226 | return (void *)NULL; | |
227 | } | |
228 | ||
229 | void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData ) | |
230 | { | |
231 | } | |
232 | ||
233 | wxClientData* wxChoice::DoGetItemClientObject( int n ) const | |
234 | { | |
235 | return (wxClientData *)DoGetItemClientData(n); | |
236 | } | |
237 | ||
238 | // ---------------------------------------------------------------------------- | |
239 | // wxMSW specific helpers | |
240 | // ---------------------------------------------------------------------------- | |
241 | ||
242 | void wxChoice::UpdateVisibleHeight() | |
243 | { | |
244 | } | |
245 | ||
246 | void wxChoice::DoMoveWindow(int x, int y, int width, int height) | |
247 | { | |
248 | } | |
249 | ||
250 | void wxChoice::DoGetSize(int *w, int *h) const | |
251 | { | |
252 | } | |
253 | ||
254 | void wxChoice::DoSetSize(int x, int y, | |
255 | int width, int height, | |
256 | int sizeFlags) | |
257 | { | |
258 | } | |
259 | ||
260 | wxSize wxChoice::DoGetBestSize() const | |
261 | { | |
262 | return wxSize(0,0); | |
263 | } | |
264 | ||
265 | WXLRESULT wxChoice::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) | |
266 | { | |
267 | return 0; | |
268 | } | |
269 | ||
270 | bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) | |
271 | { | |
272 | return false; | |
273 | } | |
274 | ||
275 | WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), | |
276 | WXUINT WXUNUSED(message), | |
277 | WXWPARAM WXUNUSED(wParam), | |
278 | WXLPARAM WXUNUSED(lParam) | |
279 | ) | |
280 | { | |
281 | return (WXHBRUSH) 0; | |
282 | } | |
283 | ||
284 | #endif // wxUSE_CHOICE |