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