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