Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: spinbutt.h | |
3 | // Purpose: wxSpinButton class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_SPINBUTT_H_ | |
13 | #define _WX_SPINBUTT_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
83df96d6 | 16 | #pragma interface "spinbutt.h" |
9b6dbb09 JS |
17 | #endif |
18 | ||
dba00620 MB |
19 | class WXDLLEXPORT wxArrowButton; // internal |
20 | ||
31528cd3 | 21 | class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase |
9b6dbb09 | 22 | { |
31528cd3 | 23 | DECLARE_DYNAMIC_CLASS(wxSpinButton) |
83df96d6 | 24 | |
31528cd3 | 25 | public: |
dba00620 | 26 | wxSpinButton() : m_up( 0 ), m_down( 0 ), m_pos( 0 ) { } |
83df96d6 | 27 | |
31528cd3 | 28 | wxSpinButton(wxWindow *parent, |
83df96d6 JS |
29 | wxWindowID id = -1, |
30 | const wxPoint& pos = wxDefaultPosition, | |
31 | const wxSize& size = wxDefaultSize, | |
32 | long style = wxSP_VERTICAL, | |
33 | const wxString& name = "wxSpinButton") | |
dba00620 MB |
34 | : m_up( 0 ), |
35 | m_down( 0 ), | |
36 | m_pos( 0 ) | |
31528cd3 VZ |
37 | { |
38 | Create(parent, id, pos, size, style, name); | |
39 | } | |
40 | ~wxSpinButton(); | |
83df96d6 | 41 | |
31528cd3 | 42 | bool Create(wxWindow *parent, |
83df96d6 JS |
43 | wxWindowID id = -1, |
44 | const wxPoint& pos = wxDefaultPosition, | |
45 | const wxSize& size = wxDefaultSize, | |
46 | long style = wxSP_VERTICAL, | |
47 | const wxString& name = "wxSpinButton"); | |
48 | ||
31528cd3 VZ |
49 | // accessors |
50 | int GetValue() const; | |
51 | int GetMin() const { return m_min; } | |
52 | int GetMax() const { return m_max; } | |
83df96d6 | 53 | |
31528cd3 VZ |
54 | // operations |
55 | void SetValue(int val); | |
56 | void SetRange(int minVal, int maxVal); | |
83df96d6 | 57 | |
31528cd3 | 58 | // Implementation |
dba00620 MB |
59 | virtual void Command(wxCommandEvent& event) |
60 | { (void)ProcessCommand(event); }; | |
96be256b | 61 | virtual void ChangeFont(bool keepOriginalSize = true); |
31528cd3 VZ |
62 | virtual void ChangeBackgroundColour(); |
63 | virtual void ChangeForegroundColour(); | |
dba00620 MB |
64 | public: |
65 | // implementation detail | |
66 | void Increment( int delta ); | |
67 | ||
68 | private: | |
69 | virtual void DoSetSize(int x, int y, int width, int height, | |
70 | int sizeFlags = wxSIZE_AUTO); | |
71 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
72 | virtual wxSize DoGetBestSize() const; | |
73 | ||
74 | wxArrowButton* m_up; | |
75 | wxArrowButton* m_down; | |
76 | int m_pos; | |
9b6dbb09 JS |
77 | }; |
78 | ||
9b6dbb09 | 79 | #endif |
83df96d6 | 80 | // _WX_SPINBUTT_H_ |