]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: src/palmos/combobox.cpp | |
3 | // Purpose: wxComboBox class | |
4 | // Author: William Osborne - minimal working wxPalmOS port | |
5 | // Modified by: | |
6 | // Created: 10/13/04 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) William Osborne | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // ============================================================================ | |
13 | // declarations | |
14 | // ============================================================================ | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // headers | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
20 | // For compilers that support precompilation, includes "wx.h". | |
21 | #include "wx/wxprec.h" | |
22 | ||
23 | #ifdef __BORLANDC__ | |
24 | #pragma hdrstop | |
25 | #endif | |
26 | ||
27 | #if wxUSE_COMBOBOX | |
28 | ||
29 | #ifndef WX_PRECOMP | |
30 | #include "wx/settings.h" | |
31 | #include "wx/log.h" | |
32 | // for wxEVT_COMMAND_TEXT_ENTER | |
33 | #include "wx/textctrl.h" | |
34 | #endif | |
35 | ||
36 | #include "wx/combobox.h" | |
37 | #include "wx/brush.h" | |
38 | #include "wx/clipbrd.h" | |
39 | #include "wx/palmos/private.h" | |
40 | ||
41 | #if wxUSE_TOOLTIPS | |
42 | #if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__) | |
43 | #include <commctrl.h> | |
44 | #endif | |
45 | #include "wx/tooltip.h" | |
46 | #endif // wxUSE_TOOLTIPS | |
47 | ||
48 | // ---------------------------------------------------------------------------- | |
49 | // wxWin macros | |
50 | // ---------------------------------------------------------------------------- | |
51 | ||
52 | #if wxUSE_EXTENDED_RTTI | |
53 | WX_DEFINE_FLAGS( wxComboBoxStyle ) | |
54 | ||
55 | wxBEGIN_FLAGS( wxComboBoxStyle ) | |
56 | // new style border flags, we put them first to | |
57 | // use them for streaming out | |
58 | wxFLAGS_MEMBER(wxBORDER_SIMPLE) | |
59 | wxFLAGS_MEMBER(wxBORDER_SUNKEN) | |
60 | wxFLAGS_MEMBER(wxBORDER_DOUBLE) | |
61 | wxFLAGS_MEMBER(wxBORDER_RAISED) | |
62 | wxFLAGS_MEMBER(wxBORDER_STATIC) | |
63 | wxFLAGS_MEMBER(wxBORDER_NONE) | |
64 | ||
65 | // old style border flags | |
66 | wxFLAGS_MEMBER(wxSIMPLE_BORDER) | |
67 | wxFLAGS_MEMBER(wxSUNKEN_BORDER) | |
68 | wxFLAGS_MEMBER(wxDOUBLE_BORDER) | |
69 | wxFLAGS_MEMBER(wxRAISED_BORDER) | |
70 | wxFLAGS_MEMBER(wxSTATIC_BORDER) | |
71 | wxFLAGS_MEMBER(wxBORDER) | |
72 | ||
73 | // standard window styles | |
74 | wxFLAGS_MEMBER(wxTAB_TRAVERSAL) | |
75 | wxFLAGS_MEMBER(wxCLIP_CHILDREN) | |
76 | wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) | |
77 | wxFLAGS_MEMBER(wxWANTS_CHARS) | |
78 | wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) | |
79 | wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) | |
80 | wxFLAGS_MEMBER(wxVSCROLL) | |
81 | wxFLAGS_MEMBER(wxHSCROLL) | |
82 | ||
83 | wxFLAGS_MEMBER(wxCB_SIMPLE) | |
84 | wxFLAGS_MEMBER(wxCB_SORT) | |
85 | wxFLAGS_MEMBER(wxCB_READONLY) | |
86 | wxFLAGS_MEMBER(wxCB_DROPDOWN) | |
87 | ||
88 | wxEND_FLAGS( wxComboBoxStyle ) | |
89 | ||
90 | IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h") | |
91 | ||
92 | wxBEGIN_PROPERTIES_TABLE(wxComboBox) | |
93 | wxEVENT_PROPERTY( Select , wxEVT_COMMAND_COMBOBOX_SELECTED , wxCommandEvent ) | |
94 | wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent ) | |
95 | ||
96 | // TODO DELEGATES | |
97 | wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
98 | wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
99 | wxPROPERTY( Value ,wxString, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
100 | wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
101 | wxPROPERTY_FLAGS( WindowStyle , wxComboBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style | |
102 | wxEND_PROPERTIES_TABLE() | |
103 | ||
104 | wxBEGIN_HANDLERS_TABLE(wxComboBox) | |
105 | wxEND_HANDLERS_TABLE() | |
106 | ||
107 | wxCONSTRUCTOR_5( wxComboBox , wxWindow* , Parent , wxWindowID , Id , wxString , Value , wxPoint , Position , wxSize , Size ) | |
108 | #else | |
109 | IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) | |
110 | #endif | |
111 | ||
112 | // ---------------------------------------------------------------------------- | |
113 | // function prototypes | |
114 | // ---------------------------------------------------------------------------- | |
115 | ||
116 | // --------------------------------------------------------------------------- | |
117 | // global vars | |
118 | // --------------------------------------------------------------------------- | |
119 | ||
120 | // the pointer to standard radio button wnd proc | |
121 | static WNDPROC gs_wndprocEdit = (WNDPROC)NULL; | |
122 | ||
123 | // ============================================================================ | |
124 | // implementation | |
125 | // ============================================================================ | |
126 | ||
127 | // ---------------------------------------------------------------------------- | |
128 | // wxComboBox callbacks | |
129 | // ---------------------------------------------------------------------------- | |
130 | ||
131 | WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) | |
132 | { | |
133 | return 0; | |
134 | } | |
135 | ||
136 | bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) | |
137 | { | |
138 | return false; | |
139 | } | |
140 | ||
141 | bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) | |
142 | { | |
143 | return false; | |
144 | } | |
145 | ||
146 | WXHWND wxComboBox::GetEditHWND() const | |
147 | { | |
148 | return (WXHWND)0; | |
149 | } | |
150 | ||
151 | // ---------------------------------------------------------------------------- | |
152 | // wxComboBox creation | |
153 | // ---------------------------------------------------------------------------- | |
154 | ||
155 | bool wxComboBox::Create(wxWindow *parent, wxWindowID id, | |
156 | const wxString& value, | |
157 | const wxPoint& pos, | |
158 | const wxSize& size, | |
159 | int n, const wxString choices[], | |
160 | long style, | |
161 | const wxValidator& validator, | |
162 | const wxString& name) | |
163 | { | |
164 | return false; | |
165 | } | |
166 | ||
167 | bool wxComboBox::Create(wxWindow *parent, wxWindowID id, | |
168 | const wxString& value, | |
169 | const wxPoint& pos, | |
170 | const wxSize& size, | |
171 | const wxArrayString& choices, | |
172 | long style, | |
173 | const wxValidator& validator, | |
174 | const wxString& name) | |
175 | { | |
176 | return false; | |
177 | } | |
178 | ||
179 | WXDWORD wxComboBox::MSWGetStyle(long style, WXDWORD *exstyle) const | |
180 | { | |
181 | return 0; | |
182 | } | |
183 | ||
184 | // ---------------------------------------------------------------------------- | |
185 | // wxComboBox text control-like methods | |
186 | // ---------------------------------------------------------------------------- | |
187 | ||
188 | void wxComboBox::SetValue(const wxString& value) | |
189 | { | |
190 | } | |
191 | ||
192 | // Clipboard operations | |
193 | void wxComboBox::Copy() | |
194 | { | |
195 | } | |
196 | ||
197 | void wxComboBox::Cut() | |
198 | { | |
199 | } | |
200 | ||
201 | void wxComboBox::Paste() | |
202 | { | |
203 | } | |
204 | ||
205 | void wxComboBox::SetEditable(bool WXUNUSED(editable)) | |
206 | { | |
207 | } | |
208 | ||
209 | void wxComboBox::SetInsertionPoint(long pos) | |
210 | { | |
211 | } | |
212 | ||
213 | void wxComboBox::SetInsertionPointEnd() | |
214 | { | |
215 | } | |
216 | ||
217 | long wxComboBox::GetInsertionPoint() const | |
218 | { | |
219 | return 0; | |
220 | } | |
221 | ||
222 | wxTextPos wxComboBox::GetLastPosition() const | |
223 | { | |
224 | return 0; | |
225 | } | |
226 | ||
227 | void wxComboBox::Replace(long from, long to, const wxString& value) | |
228 | { | |
229 | } | |
230 | ||
231 | void wxComboBox::Remove(long from, long to) | |
232 | { | |
233 | } | |
234 | ||
235 | void wxComboBox::SetSelection(long from, long to) | |
236 | { | |
237 | } | |
238 | ||
239 | bool wxComboBox::IsEditable() const | |
240 | { | |
241 | return false; | |
242 | } | |
243 | ||
244 | void wxComboBox::Undo() | |
245 | { | |
246 | } | |
247 | ||
248 | void wxComboBox::Redo() | |
249 | { | |
250 | } | |
251 | ||
252 | void wxComboBox::SelectAll() | |
253 | { | |
254 | } | |
255 | ||
256 | bool wxComboBox::CanCopy() const | |
257 | { | |
258 | return false; | |
259 | } | |
260 | ||
261 | bool wxComboBox::CanCut() const | |
262 | { | |
263 | return false; | |
264 | } | |
265 | ||
266 | bool wxComboBox::CanPaste() const | |
267 | { | |
268 | return false; | |
269 | } | |
270 | ||
271 | bool wxComboBox::CanUndo() const | |
272 | { | |
273 | return false; | |
274 | } | |
275 | ||
276 | bool wxComboBox::CanRedo() const | |
277 | { | |
278 | return false; | |
279 | } | |
280 | ||
281 | ||
282 | #endif // wxUSE_COMBOBOX | |
283 |