]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/spinctrl.cpp
ifdef fixes for PalmOS6 (part of ticket 4700)
[wxWidgets.git] / src / palmos / spinctrl.cpp
CommitLineData
ffecfa5a 1/////////////////////////////////////////////////////////////////////////////
e2731512 2// Name: src/palmos/spinctrl.cpp
ffecfa5a 3// Purpose: wxSpinCtrl class implementation for Palm OS
e2731512 4// Author: William Osborne - minimal working wxPalmOS port
ffecfa5a
JS
5// Modified by:
6// Created: 10/13/04
e2731512 7// RCS-ID: $Id$
ffecfa5a
JS
8// Copyright: (c) William Osborne
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
ffecfa5a
JS
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#ifndef WX_PRECOMP
28 #include "wx/wx.h"
29#endif
30
31#if wxUSE_SPINCTRL
32
33#if defined(__WIN95__)
34
35#include "wx/spinctrl.h"
36#include "wx/palmos/private.h"
37
38// ----------------------------------------------------------------------------
39// macros
40// ----------------------------------------------------------------------------
41
42#if wxUSE_EXTENDED_RTTI
43WX_DEFINE_FLAGS( wxSpinCtrlStyle )
44
45wxBEGIN_FLAGS( wxSpinCtrlStyle )
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)
e2731512 54
ffecfa5a
JS
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 wxFLAGS_MEMBER(wxSP_HORIZONTAL)
74 wxFLAGS_MEMBER(wxSP_VERTICAL)
75 wxFLAGS_MEMBER(wxSP_ARROW_KEYS)
76 wxFLAGS_MEMBER(wxSP_WRAP)
77
78wxEND_FLAGS( wxSpinCtrlStyle )
79
80IMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinCtrl, wxControl,"wx/spinbut.h")
81
82wxBEGIN_PROPERTIES_TABLE(wxSpinCtrl)
83 wxEVENT_RANGE_PROPERTY( Spin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent )
84 wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SPINCTRL_UPDATED , wxCommandEvent )
e2731512 85 wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
ffecfa5a
JS
86 wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
87
88 wxPROPERTY( ValueString , wxString , SetValue , GetValue , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) ;
89 wxPROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
90 wxPROPERTY( Min , int , SetMin, GetMin, 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
91 wxPROPERTY( Max , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
92 wxPROPERTY_FLAGS( WindowStyle , wxSpinCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
93/*
94 TODO PROPERTIES
95 style wxSP_ARROW_KEYS
96*/
97wxEND_PROPERTIES_TABLE()
98
99wxBEGIN_HANDLERS_TABLE(wxSpinCtrl)
100wxEND_HANDLERS_TABLE()
101
e2731512 102wxCONSTRUCTOR_6( wxSpinCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , ValueString , wxPoint , Position , wxSize , Size , long , WindowStyle )
ffecfa5a
JS
103#else
104IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
105#endif
106
107BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
108 EVT_CHAR(wxSpinCtrl::OnChar)
109
110 EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
111
112 EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
113END_EVENT_TABLE()
114
115#define GetBuddyHwnd() (HWND)(m_hwndBuddy)
116
117// ----------------------------------------------------------------------------
118// constants
119// ----------------------------------------------------------------------------
120
121// the margin between the up-down control and its buddy (can be arbitrary,
122// choose what you like - or may be decide during run-time depending on the
123// font size?)
124static const int MARGIN_BETWEEN = 1;
125
126// ============================================================================
127// implementation
128// ============================================================================
129
130wxArraySpins wxSpinCtrl::ms_allSpins;
131
132/* static */
133wxSpinCtrl *wxSpinCtrl::GetSpinForTextCtrl(WXHWND hwndBuddy)
134{
135 return NULL;
136}
137
138// process a WM_COMMAND generated by the buddy text control
139bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id))
140{
141 return false;
142}
143
144void wxSpinCtrl::OnChar(wxKeyEvent& event)
145{
146}
147
148void wxSpinCtrl::OnSetFocus(wxFocusEvent& event)
149{
150}
151
152// ----------------------------------------------------------------------------
153// construction
154// ----------------------------------------------------------------------------
155
156bool wxSpinCtrl::Create(wxWindow *parent,
157 wxWindowID id,
158 const wxString& value,
159 const wxPoint& pos,
160 const wxSize& size,
161 long style,
162 int min, int max, int initial,
163 const wxString& name)
164{
165 return false;
166}
167
168wxSpinCtrl::~wxSpinCtrl()
169{
170}
171
172// ----------------------------------------------------------------------------
173// wxTextCtrl-like methods
174// ----------------------------------------------------------------------------
175
176void wxSpinCtrl::SetValue(const wxString& text)
177{
178}
179
180int wxSpinCtrl::GetValue() const
181{
182 return 0;
183}
184
185void wxSpinCtrl::SetSelection(long from, long to)
186{
187}
188
189// ----------------------------------------------------------------------------
190// forward some methods to subcontrols
191// ----------------------------------------------------------------------------
192
193bool wxSpinCtrl::SetFont(const wxFont& font)
194{
195 return false;
196}
197
198bool wxSpinCtrl::Show(bool show)
199{
200 return false;
201}
202
203bool wxSpinCtrl::Enable(bool enable)
204{
205 return false;
206}
207
208void wxSpinCtrl::SetFocus()
209{
210}
211
212// ----------------------------------------------------------------------------
213// event processing
214// ----------------------------------------------------------------------------
215
216void wxSpinCtrl::OnSpinChange(wxSpinEvent& eventSpin)
217{
218}
219
220// ----------------------------------------------------------------------------
221// size calculations
222// ----------------------------------------------------------------------------
223
224wxSize wxSpinCtrl::DoGetBestSize() const
225{
226 return wxSize(0,0);
227}
228
229void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
230{
231}
232
233// get total size of the control
234void wxSpinCtrl::DoGetSize(int *x, int *y) const
235{
236}
237
238void wxSpinCtrl::DoGetPosition(int *x, int *y) const
239{
240}
241
242#endif // __WIN95__
243
244#endif
245 // wxUSE_SPINCTRL
246