]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/spinctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSpinCtrlBase class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SPINCTRL_H_
13 #define _WX_SPINCTRL_H_
15 #include "wx/spinbutt.h" // should make wxSpinEvent visible to the app
17 // ----------------------------------------------------------------------------
18 // a spin ctrl is a text control with a spin button which is usually used to
19 // prompt the user for a numeric input
20 // ----------------------------------------------------------------------------
22 /* there is no generic base class for this control because it's imlpemented
23 very differently under MSW and other platforms
25 class WXDLLEXPORT wxSpinCtrlBase : public wxControl
28 wxSpinCtrlBase() { Init(); }
31 virtual int GetValue() const = 0;
32 virtual int GetMin() const { return m_min; }
33 virtual int GetMax() const { return m_max; }
36 virtual void SetValue(const wxString& value) = 0;
37 virtual void SetValue(int val) = 0;
38 virtual void SetRange(int minVal, int maxVal) = 0;
41 // initialize m_min/max with the default values
42 void Init() { m_min = 0; m_max = 100; }
49 // ----------------------------------------------------------------------------
50 // include the platform-dependent class implementation
51 // ----------------------------------------------------------------------------
53 #if defined(__WXMSW__) && defined(__WIN32__)
54 #include "wx/msw/spinctrl.h"
55 #elif defined(__WXPM__)
56 #include "wx/os2/spinctrl.h"
57 #elif defined(__WXGTK__)
58 #include "wx/gtk/spinctrl.h"
59 #else // Win16 || !Win
60 #include "wx/generic/spinctlg.h"
63 // Macro must be defined here, not event.h, since it must reference wxSpinEventFunction
64 #define EVT_SPINCTRL(id, fn) \
65 DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_SPINCTRL_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & fn, (wxObject *) NULL ),
67 #endif // _WX_SPINCTRL_H_