]>
Commit | Line | Data |
---|---|---|
409c9842 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: msw/spinctrl.h | |
3 | // Purpose: wxSpinCtrl class declaration for Win32 | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/15/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_MSW_SPINCTRL_H_ | |
13 | #define _WX_MSW_SPINCTRL_H_ | |
14 | ||
15 | #include "wx/spinbutt.h" // the base class | |
16 | ||
17 | // ---------------------------------------------------------------------------- | |
3e7fb41b | 18 | // Under Win32 and OS2 PM, wxSpinCtrl is a wxSpinButton with a buddy |
409c9842 DW |
19 | // text window whose contents is automatically updated when the spin |
20 | // control is clicked. | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
23 | class WXDLLEXPORT wxSpinCtrl : public wxSpinButton | |
24 | { | |
25 | public: | |
26 | wxSpinCtrl() { } | |
27 | ||
28 | wxSpinCtrl(wxWindow *parent, | |
29 | wxWindowID id = -1, | |
3e7fb41b | 30 | const wxString& value = wxEmptyString, |
409c9842 DW |
31 | const wxPoint& pos = wxDefaultPosition, |
32 | const wxSize& size = wxDefaultSize, | |
33 | long style = wxSP_ARROW_KEYS, | |
34 | int min = 0, int max = 100, int initial = 0, | |
35 | const wxString& name = _T("wxSpinCtrl")) | |
36 | { | |
3e7fb41b | 37 | Create(parent, id, value, pos, size, style, min, max, initial, name); |
409c9842 DW |
38 | } |
39 | ||
40 | bool Create(wxWindow *parent, | |
41 | wxWindowID id = -1, | |
3e7fb41b | 42 | const wxString& value = wxEmptyString, |
409c9842 DW |
43 | const wxPoint& pos = wxDefaultPosition, |
44 | const wxSize& size = wxDefaultSize, | |
45 | long style = wxSP_ARROW_KEYS, | |
46 | int min = 0, int max = 100, int initial = 0, | |
47 | const wxString& name = _T("wxSpinCtrl")); | |
48 | ||
a5569657 DW |
49 | // a wxTextCtrl-like method (but we can't have GetValue returning wxString |
50 | // because the base class already has one returning int!) | |
51 | void SetValue(const wxString& text); | |
52 | ||
53 | // implementation only from now on | |
54 | // ------------------------------- | |
55 | ||
56 | virtual void SetValue(int val) { wxSpinButton::SetValue(val); } | |
57 | virtual int GetValue() const; | |
58 | virtual bool SetFont(const wxFont &font); | |
59 | ||
60 | virtual bool Enable(bool enable = TRUE); | |
61 | virtual bool Show(bool show = TRUE); | |
409c9842 DW |
62 | protected: |
63 | void DoMoveWindow(int x, int y, int width, int height); | |
64 | ||
a5569657 DW |
65 | virtual wxSize DoGetBestSize() const; |
66 | ||
67 | // the handler for wxSpinButton events | |
68 | void OnSpinChange(wxSpinEvent& event); | |
69 | ||
409c9842 DW |
70 | WXHWND m_hwndBuddy; |
71 | ||
a5569657 | 72 | private: |
409c9842 | 73 | DECLARE_DYNAMIC_CLASS(wxSpinCtrl) |
a5569657 | 74 | DECLARE_EVENT_TABLE() |
409c9842 DW |
75 | }; |
76 | ||
77 | #endif // _WX_MSW_SPINCTRL_H_ | |
78 | ||
79 |