]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/spinbutt.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / motif / spinbutt.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/spinbutt.h
3 // Purpose: wxSpinButton class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_SPINBUTT_H_
12 #define _WX_SPINBUTT_H_
13
14 class WXDLLIMPEXP_FWD_CORE wxArrowButton; // internal
15
16 class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
17 {
18 DECLARE_DYNAMIC_CLASS(wxSpinButton)
19
20 public:
21 wxSpinButton() : m_up( 0 ), m_down( 0 ), m_pos( 0 ) { }
22
23 wxSpinButton(wxWindow *parent,
24 wxWindowID id = wxID_ANY,
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
27 long style = wxSP_VERTICAL,
28 const wxString& name = "wxSpinButton")
29 : m_up( 0 ),
30 m_down( 0 ),
31 m_pos( 0 )
32 {
33 Create(parent, id, pos, size, style, name);
34 }
35 virtual ~wxSpinButton();
36
37 bool Create(wxWindow *parent,
38 wxWindowID id = wxID_ANY,
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& size = wxDefaultSize,
41 long style = wxSP_VERTICAL,
42 const wxString& name = "wxSpinButton");
43
44 // accessors
45 int GetValue() const;
46 int GetMin() const { return m_min; }
47 int GetMax() const { return m_max; }
48
49 // operations
50 void SetValue(int val);
51 void SetRange(int minVal, int maxVal);
52
53 // Implementation
54 virtual void Command(wxCommandEvent& event)
55 { (void)ProcessCommand(event); }
56 virtual void ChangeFont(bool keepOriginalSize = true);
57 virtual void ChangeBackgroundColour();
58 virtual void ChangeForegroundColour();
59 public:
60 // implementation detail
61 void Increment( int delta );
62
63 private:
64 virtual void DoSetSize(int x, int y, int width, int height,
65 int sizeFlags = wxSIZE_AUTO);
66 virtual void DoMoveWindow(int x, int y, int width, int height);
67 virtual wxSize DoGetBestSize() const;
68
69 wxArrowButton* m_up;
70 wxArrowButton* m_down;
71 int m_pos;
72 };
73
74 #endif
75 // _WX_SPINBUTT_H_