]> git.saurik.com Git - wxWidgets.git/blame - interface/spinbutt.h
mac paths updated
[wxWidgets.git] / interface / spinbutt.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: spinbutt.h
e54c96f1 3// Purpose: interface of wxSpinEvent
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxSpinEvent
11 @wxheader{spinbutt.h}
7c913512
FM
12
13 This event class is used for the events generated by
23324ae1 14 wxSpinButton and wxSpinCtrl.
7c913512 15
23324ae1
FM
16 @library{wxcore}
17 @category{events}
7c913512 18
e54c96f1 19 @see wxSpinButton and wxSpinCtrl
23324ae1
FM
20*/
21class wxSpinEvent : public wxNotifyEvent
22{
23public:
24 /**
25 The constructor is not normally used by the user code.
26 */
4cc4bfaf 27 wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
23324ae1
FM
28
29 /**
30 Retrieve the current spin button or control value.
31 */
328f5751 32 int GetPosition() const;
23324ae1
FM
33
34 /**
35 Set the value associated with the event.
36 */
37 void SetPosition(int pos);
38};
39
40
e54c96f1 41
23324ae1
FM
42/**
43 @class wxSpinButton
44 @wxheader{spinbutt.h}
7c913512 45
23324ae1
FM
46 A wxSpinButton has two small up and down (or left and right) arrow buttons. It
47 is often used next to a text control for increment and decrementing a value.
48 Portable programs should try to use wxSpinCtrl instead
49 as wxSpinButton is not implemented for all platforms but wxSpinCtrl is as it
50 degenerates to a simple wxTextCtrl on such platforms.
7c913512 51
1f1d2182 52 @note the range supported by this control (and wxSpinCtrl) depends on the
23324ae1
FM
53 platform but is at least @c -0x8000 to @c 0x7fff. Under GTK and
54 Win32 with sufficiently new version of @c comctrl32.dll (at least 4.71 is
55 required, 5.80 is recommended) the full 32 bit range is supported.
7c913512 56
23324ae1 57 @beginStyleTable
8c6791e4 58 @style{wxSP_HORIZONTAL}
23324ae1
FM
59 Specifies a horizontal spin button (note that this style is not
60 supported in wxGTK).
8c6791e4 61 @style{wxSP_VERTICAL}
23324ae1 62 Specifies a vertical spin button.
8c6791e4 63 @style{wxSP_ARROW_KEYS}
23324ae1 64 The user can use arrow keys to change the value.
8c6791e4 65 @style{wxSP_WRAP}
23324ae1
FM
66 The value wraps at the minimum and maximum.
67 @endStyleTable
7c913512 68
23324ae1
FM
69 @library{wxcore}
70 @category{ctrl}
0c7fe6f2 71 <!-- @appearance{spinbutton.png} -->
7c913512 72
e54c96f1 73 @see wxSpinCtrl
23324ae1
FM
74*/
75class wxSpinButton : public wxControl
76{
77public:
d930d177
RR
78 /**
79 Default constructor.
80 */
81 wxSpinButton();
82
23324ae1
FM
83 /**
84 Constructor, creating and showing a spin button.
3c4f71cc 85
7c913512 86 @param parent
4cc4bfaf 87 Parent window. Must not be @NULL.
7c913512 88 @param id
4cc4bfaf 89 Window identifier. The value wxID_ANY indicates a default value.
7c913512 90 @param pos
4cc4bfaf
FM
91 Window position. If wxDefaultPosition is specified then a default
92 position is chosen.
7c913512 93 @param size
4cc4bfaf
FM
94 Window size. If wxDefaultSize is specified then a default size
95 is chosen.
7c913512 96 @param style
4cc4bfaf 97 Window style. See wxSpinButton.
7c913512 98 @param name
4cc4bfaf 99 Window name.
3c4f71cc 100
4cc4bfaf 101 @see Create()
23324ae1 102 */
7c913512
FM
103 wxSpinButton(wxWindow* parent, wxWindowID id,
104 const wxPoint& pos = wxDefaultPosition,
105 const wxSize& size = wxDefaultSize,
106 long style = wxSP_HORIZONTAL,
107 const wxString& name = "spinButton");
23324ae1
FM
108
109 /**
110 Destructor, destroys the spin button control.
111 */
112 ~wxSpinButton();
113
114 /**
115 Scrollbar creation function called by the spin button constructor.
116 See wxSpinButton() for details.
117 */
118 bool Create(wxWindow* parent, wxWindowID id,
119 const wxPoint& pos = wxDefaultPosition,
120 const wxSize& size = wxDefaultSize,
121 long style = wxSP_HORIZONTAL,
122 const wxString& name = "spinButton");
123
124 /**
125 Returns the maximum permissible value.
3c4f71cc 126
4cc4bfaf 127 @see SetRange()
23324ae1 128 */
328f5751 129 int GetMax() const;
23324ae1
FM
130
131 /**
132 Returns the minimum permissible value.
3c4f71cc 133
4cc4bfaf 134 @see SetRange()
23324ae1 135 */
328f5751 136 int GetMin() const;
23324ae1
FM
137
138 /**
139 Returns the current spin button value.
3c4f71cc 140
4cc4bfaf 141 @see SetValue()
23324ae1 142 */
328f5751 143 int GetValue() const;
23324ae1
FM
144
145 /**
146 Sets the range of the spin button.
3c4f71cc 147
7c913512 148 @param min
4cc4bfaf 149 The minimum value for the spin button.
7c913512 150 @param max
4cc4bfaf 151 The maximum value for the spin button.
3c4f71cc 152
4cc4bfaf 153 @see GetMin(), GetMax()
23324ae1
FM
154 */
155 void SetRange(int min, int max);
156
157 /**
158 Sets the value of the spin button.
3c4f71cc 159
7c913512 160 @param value
4cc4bfaf 161 The value for the spin button.
23324ae1
FM
162 */
163 void SetValue(int value);
164};
e54c96f1 165