]>
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_
19 #include "wx/spinbutt.h" // should make wxSpinEvent visible to the app
21 // ----------------------------------------------------------------------------
22 // a spin ctrl is a text control with a spin button which is usually used to
23 // prompt the user for a numeric input
24 // ----------------------------------------------------------------------------
26 /* there is no generic base class for this control because it's imlpemented
27 very differently under MSW and other platforms
29 class WXDLLEXPORT wxSpinCtrlBase : public wxControl
32 wxSpinCtrlBase() { Init(); }
35 virtual int GetValue() const = 0;
36 virtual int GetMin() const { return m_min; }
37 virtual int GetMax() const { return m_max; }
40 virtual void SetValue(const wxString& value) = 0;
41 virtual void SetValue(int val) = 0;
42 virtual void SetRange(int minVal, int maxVal) = 0;
44 // as the wxTextCtrl method
45 virtual void SetSelection(long from, long to) = 0;
48 // initialize m_min/max with the default values
49 void Init() { m_min = 0; m_max = 100; }
56 // ----------------------------------------------------------------------------
57 // include the platform-dependent class implementation
58 // ----------------------------------------------------------------------------
60 #if defined(__WXUNIVERSAL__)
61 #include "wx/generic/spinctlg.h"
62 #elif defined(__WXMSW__)
63 #include "wx/msw/spinctrl.h"
64 #elif defined(__WXPM__)
65 #include "wx/os2/spinctrl.h"
66 #elif defined(__WXGTK__)
67 #include "wx/gtk/spinctrl.h"
68 #elif defined(__WXMOTIF__)
69 #include "wx/generic/spinctlg.h"
70 #elif defined(__WXMAC__)
71 #include "wx/mac/spinctrl.h"
72 #elif defined(__WXCOCOA__)
73 #include "wx/generic/spinctlg.h"
76 #define EVT_SPINCTRL(id, fn) \
77 wx__DECLARE_EVT1(wxEVT_COMMAND_SPINCTRL_UPDATED, id, wxSpinEventHandler(fn))
79 #endif // wxUSE_SPINCTRL
81 #endif // _WX_SPINCTRL_H_