]>
Commit | Line | Data |
---|---|---|
ffecfa5a | 1 | ///////////////////////////////////////////////////////////////////////////// |
e2731512 | 2 | // Name: src/palmos/choice.cpp |
ffecfa5a | 3 | // Purpose: wxChoice |
e2731512 | 4 | // Author: William Osborne - minimal working wxPalmOS port |
ffecfa5a | 5 | // Created: 10/13/04 |
e2731512 | 6 | // RCS-ID: $Id$ |
ffecfa5a JS |
7 | // Copyright: (c) William Osborne |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | // ============================================================================ | |
12 | // declarations | |
13 | // ============================================================================ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
ffecfa5a JS |
19 | // For compilers that support precompilation, includes "wx.h". |
20 | #include "wx/wxprec.h" | |
21 | ||
22 | #ifdef __BORLANDC__ | |
23 | #pragma hdrstop | |
24 | #endif | |
25 | ||
26 | #if wxUSE_CHOICE | |
27 | ||
b36e08d0 WS |
28 | #include "wx/choice.h" |
29 | ||
ffecfa5a | 30 | #ifndef WX_PRECOMP |
ffecfa5a JS |
31 | #include "wx/utils.h" |
32 | #include "wx/log.h" | |
33 | #include "wx/brush.h" | |
34 | #include "wx/settings.h" | |
35 | #endif | |
36 | ||
ffecfa5a JS |
37 | #if wxUSE_EXTENDED_RTTI |
38 | WX_DEFINE_FLAGS( wxChoiceStyle ) | |
39 | ||
40 | wxBEGIN_FLAGS( wxChoiceStyle ) | |
41 | // new style border flags, we put them first to | |
42 | // use them for streaming out | |
43 | wxFLAGS_MEMBER(wxBORDER_SIMPLE) | |
44 | wxFLAGS_MEMBER(wxBORDER_SUNKEN) | |
45 | wxFLAGS_MEMBER(wxBORDER_DOUBLE) | |
46 | wxFLAGS_MEMBER(wxBORDER_RAISED) | |
47 | wxFLAGS_MEMBER(wxBORDER_STATIC) | |
48 | wxFLAGS_MEMBER(wxBORDER_NONE) | |
49 | ||
50 | // old style border flags | |
51 | wxFLAGS_MEMBER(wxSIMPLE_BORDER) | |
52 | wxFLAGS_MEMBER(wxSUNKEN_BORDER) | |
53 | wxFLAGS_MEMBER(wxDOUBLE_BORDER) | |
54 | wxFLAGS_MEMBER(wxRAISED_BORDER) | |
55 | wxFLAGS_MEMBER(wxSTATIC_BORDER) | |
56 | wxFLAGS_MEMBER(wxBORDER) | |
57 | ||
58 | // standard window styles | |
59 | wxFLAGS_MEMBER(wxTAB_TRAVERSAL) | |
60 | wxFLAGS_MEMBER(wxCLIP_CHILDREN) | |
61 | wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) | |
62 | wxFLAGS_MEMBER(wxWANTS_CHARS) | |
63 | wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) | |
64 | wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) | |
65 | wxFLAGS_MEMBER(wxVSCROLL) | |
66 | wxFLAGS_MEMBER(wxHSCROLL) | |
67 | ||
68 | wxEND_FLAGS( wxChoiceStyle ) | |
69 | ||
70 | IMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice, wxControl,"wx/choice.h") | |
71 | ||
72 | wxBEGIN_PROPERTIES_TABLE(wxChoice) | |
73 | wxEVENT_PROPERTY( Select , wxEVT_COMMAND_CHOICE_SELECTED , wxCommandEvent ) | |
74 | ||
75 | wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
76 | wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
77 | wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
78 | wxPROPERTY_FLAGS( WindowStyle , wxChoiceStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style | |
79 | wxEND_PROPERTIES_TABLE() | |
80 | ||
81 | wxBEGIN_HANDLERS_TABLE(wxChoice) | |
82 | wxEND_HANDLERS_TABLE() | |
83 | ||
84 | wxCONSTRUCTOR_4( wxChoice , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size ) | |
85 | #else | |
b1294ada | 86 | IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControlWithItems) |
ffecfa5a JS |
87 | #endif |
88 | ||
89 | // ============================================================================ | |
90 | // implementation | |
91 | // ============================================================================ | |
92 | ||
93 | // ---------------------------------------------------------------------------- | |
94 | // creation | |
95 | // ---------------------------------------------------------------------------- | |
96 | ||
97 | bool wxChoice::Create(wxWindow *parent, | |
98 | wxWindowID id, | |
99 | const wxPoint& pos, | |
100 | const wxSize& size, | |
101 | int n, const wxString choices[], | |
102 | long style, | |
103 | const wxValidator& validator, | |
104 | const wxString& name) | |
105 | { | |
106 | return false; | |
107 | } | |
108 | ||
109 | bool wxChoice::CreateAndInit(wxWindow *parent, | |
110 | wxWindowID id, | |
111 | const wxPoint& pos, | |
112 | const wxSize& size, | |
113 | int n, const wxString choices[], | |
114 | long style, | |
115 | const wxValidator& validator, | |
116 | const wxString& name) | |
117 | { | |
324eeecb | 118 | return false; |
ffecfa5a JS |
119 | } |
120 | ||
121 | bool wxChoice::Create(wxWindow *parent, | |
122 | wxWindowID id, | |
123 | const wxPoint& pos, | |
124 | const wxSize& size, | |
125 | const wxArrayString& choices, | |
126 | long style, | |
127 | const wxValidator& validator, | |
128 | const wxString& name) | |
129 | { | |
130 | return false; | |
131 | } | |
132 | ||
ffecfa5a JS |
133 | wxChoice::~wxChoice() |
134 | { | |
135 | } | |
136 | ||
137 | // ---------------------------------------------------------------------------- | |
138 | // adding/deleting items to/from the list | |
139 | // ---------------------------------------------------------------------------- | |
140 | ||
a236aa20 VZ |
141 | int wxChoice::DoInsertItems(const wxArrayStringsAdapter& items, |
142 | unsigned int pos, | |
143 | void **clientData, | |
144 | wxClientDataType type) | |
ffecfa5a JS |
145 | { |
146 | return 0; | |
147 | } | |
148 | ||
a236aa20 | 149 | void wxChoice::DoDeleteOneItem(unsigned int n) |
ffecfa5a | 150 | { |
ffecfa5a JS |
151 | } |
152 | ||
a236aa20 | 153 | void wxChoice::DoClear() |
ffecfa5a JS |
154 | { |
155 | } | |
156 | ||
157 | void wxChoice::Free() | |
158 | { | |
159 | } | |
160 | ||
161 | // ---------------------------------------------------------------------------- | |
162 | // selection | |
163 | // ---------------------------------------------------------------------------- | |
164 | ||
165 | int wxChoice::GetSelection() const | |
166 | { | |
167 | return 0; | |
168 | } | |
169 | ||
170 | void wxChoice::SetSelection(int n) | |
171 | { | |
172 | } | |
173 | ||
174 | // ---------------------------------------------------------------------------- | |
175 | // string list functions | |
176 | // ---------------------------------------------------------------------------- | |
177 | ||
aa61d352 | 178 | unsigned int wxChoice::GetCount() const |
ffecfa5a JS |
179 | { |
180 | return 0; | |
181 | } | |
182 | ||
aa61d352 | 183 | void wxChoice::SetString(unsigned int n, const wxString& s) |
ffecfa5a JS |
184 | { |
185 | } | |
186 | ||
aa61d352 | 187 | wxString wxChoice::GetString(unsigned int n) const |
ffecfa5a | 188 | { |
aa61d352 | 189 | return wxEmptyString; |
ffecfa5a JS |
190 | } |
191 | ||
192 | // ---------------------------------------------------------------------------- | |
193 | // client data | |
194 | // ---------------------------------------------------------------------------- | |
195 | ||
aa61d352 | 196 | void wxChoice::DoSetItemClientData(unsigned int n, void* clientData) |
ffecfa5a JS |
197 | { |
198 | } | |
199 | ||
aa61d352 | 200 | void* wxChoice::DoGetItemClientData(unsigned int n) const |
ffecfa5a | 201 | { |
d3b9f782 | 202 | return NULL; |
ffecfa5a JS |
203 | } |
204 | ||
ffecfa5a JS |
205 | // ---------------------------------------------------------------------------- |
206 | // wxMSW specific helpers | |
207 | // ---------------------------------------------------------------------------- | |
208 | ||
209 | void wxChoice::UpdateVisibleHeight() | |
210 | { | |
211 | } | |
212 | ||
213 | void wxChoice::DoMoveWindow(int x, int y, int width, int height) | |
214 | { | |
215 | } | |
216 | ||
217 | void wxChoice::DoGetSize(int *w, int *h) const | |
218 | { | |
219 | } | |
220 | ||
221 | void wxChoice::DoSetSize(int x, int y, | |
222 | int width, int height, | |
223 | int sizeFlags) | |
224 | { | |
225 | } | |
226 | ||
227 | wxSize wxChoice::DoGetBestSize() const | |
228 | { | |
229 | return wxSize(0,0); | |
230 | } | |
231 | ||
ffecfa5a | 232 | #endif // wxUSE_CHOICE |