]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/spinctlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/spinctlg.h
3 // Purpose: generic wxSpinCtrl class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_SPINCTRL_H_
13 #define _WX_GENERIC_SPINCTRL_H_
15 #include "wx/textctrl.h"
17 // ----------------------------------------------------------------------------
18 // generic wxSpinCtrl is just a text control
19 // ----------------------------------------------------------------------------
21 class WXDLLEXPORT wxSpinCtrl
: public wxTextCtrl
24 wxSpinCtrlBase() { Init(); }
30 if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%d"), &n
) != 1) )
36 int GetMin() const { return m_min
; }
37 int GetMax() const { return m_max
; }
40 void SetValue(const wxString
& value
) { wxTextCtrl::SetValue(value
); }
41 void SetValue(int val
) { wxString s
; s
<< val
; wxTextCtrl::SetValue(s
); }
42 void SetRange(int min
, int max
) { m_min
= min
; m_max
= max
; }
45 // initialize m_min/max with the default values
46 void Init() { SetRange(0, 100); }
52 #endif // _WX_GENERIC_SPINCTRL_H_