]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: spinbutt.h | |
3 | // Purpose: wxSpinButton class | |
a31a5f85 | 4 | // Author: Stefan Csomor |
0dbd6262 | 5 | // Modified by: |
a31a5f85 | 6 | // Created: 1998-01-01 |
0dbd6262 | 7 | // RCS-ID: $Id$ |
a31a5f85 | 8 | // Copyright: (c) Stefan Csomor |
0dbd6262 SC |
9 | // Licence: wxWindows licence |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_SPINBUTT_H_ | |
13 | #define _WX_SPINBUTT_H_ | |
14 | ||
af49c4b8 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
0dbd6262 SC |
16 | #pragma interface "spinbutt.h" |
17 | #endif | |
18 | ||
19 | #include "wx/control.h" | |
20 | #include "wx/event.h" | |
21 | ||
22 | /* | |
23 | The wxSpinButton is like a small scrollbar than is often placed next | |
24 | to a text control. | |
25 | ||
26 | wxSP_HORIZONTAL: horizontal spin button | |
27 | wxSP_VERTICAL: vertical spin button (the default) | |
28 | wxSP_ARROW_KEYS: arrow keys increment/decrement value | |
29 | wxSP_WRAP: value wraps at either end | |
30 | */ | |
31 | ||
e7549107 | 32 | class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase |
0dbd6262 | 33 | { |
e7549107 SC |
34 | public: |
35 | // construction | |
03e11df5 | 36 | wxSpinButton(); |
e7549107 SC |
37 | |
38 | wxSpinButton(wxWindow *parent, | |
39 | wxWindowID id = -1, | |
40 | const wxPoint& pos = wxDefaultPosition, | |
41 | const wxSize& size = wxDefaultSize, | |
42 | long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, | |
43 | const wxString& name = "wxSpinButton") | |
44 | { | |
45 | Create(parent, id, pos, size, style, name); | |
46 | } | |
47 | ||
48 | virtual ~wxSpinButton(); | |
49 | ||
50 | bool Create(wxWindow *parent, | |
51 | wxWindowID id = -1, | |
52 | const wxPoint& pos = wxDefaultPosition, | |
53 | const wxSize& size = wxDefaultSize, | |
54 | long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, | |
55 | const wxString& name = "wxSpinButton"); | |
56 | ||
57 | ||
58 | // accessors | |
03e11df5 GD |
59 | virtual int GetMin() const; |
60 | virtual int GetMax() const; | |
e7549107 SC |
61 | virtual int GetValue() const; |
62 | virtual void SetValue(int val); | |
63 | virtual void SetRange(int minVal, int maxVal); | |
64 | ||
65 | // implementation | |
66 | ||
5273bf2f | 67 | virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ; |
0dbd6262 SC |
68 | |
69 | protected: | |
f816930c | 70 | void MacHandleValueChanged( int inc ) ; |
4765d335 | 71 | virtual wxSize DoGetBestSize() const; |
e7549107 | 72 | int m_value ; |
0dbd6262 | 73 | |
e7549107 SC |
74 | private: |
75 | DECLARE_DYNAMIC_CLASS(wxSpinButton) | |
0dbd6262 SC |
76 | }; |
77 | ||
0dbd6262 SC |
78 | #endif |
79 | // _WX_SPINBUTT_H_ |