]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/spinctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msw/spinctrl.h
3 // Purpose: wxSpinCtrl class declaration for Win32
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_SPINCTRL_H_
13 #define _WX_MSW_SPINCTRL_H_
16 #pragma interface "spinctrl.h"
19 #include "wx/spinbutt.h" // the base class
21 // ----------------------------------------------------------------------------
22 // Under Win32, wxSpinCtrl is a wxSpinButton with a buddy (as MSDN docs call
23 // it) text window whose contents is automatically updated when the spin
24 // control is clicked.
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxSpinCtrl
: public wxSpinButton
32 wxSpinCtrl(wxWindow
*parent
,
34 const wxString
& value
= wxEmptyString
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxSP_ARROW_KEYS
,
38 int min
= 0, int max
= 100, int initial
= 0,
39 const wxString
& name
= _T("wxSpinCtrl"))
41 Create(parent
, id
, value
, pos
, size
, style
, min
, max
, initial
, name
);
44 bool Create(wxWindow
*parent
,
46 const wxString
& value
= wxEmptyString
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 long style
= wxSP_ARROW_KEYS
,
50 int min
= 0, int max
= 100, int initial
= 0,
51 const wxString
& name
= _T("wxSpinCtrl"));
53 // a wxTextCtrl-like method (but we can't have GetValue returning wxString
54 // because the base class already has one returning int!)
55 void SetValue(const wxString
& text
);
57 // implementation only from now on
58 // -------------------------------
60 virtual void SetValue(int val
) { wxSpinButton::SetValue(val
); }
61 virtual int GetValue() const;
62 virtual bool SetFont(const wxFont
&font
);
63 virtual void SetFocus();
65 virtual bool Enable(bool enable
= TRUE
);
66 virtual bool Show(bool show
= TRUE
);
69 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
70 virtual wxSize
DoGetBestSize() const;
72 // the handler for wxSpinButton events
73 void OnSpinChange(wxSpinEvent
& event
);
78 DECLARE_DYNAMIC_CLASS(wxSpinCtrl
)
82 #endif // _WX_MSW_SPINCTRL_H_