]>
git.saurik.com Git - wxWidgets.git/blob - interface/spinbutt.h
1844319f9a1010b613e64a5ec0f365b37c40483d
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxSpinEvent class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 This event class is used for the events generated by
14 wxSpinButton and wxSpinCtrl.
20 wxSpinButton and wxSpinCtrl
22 class wxSpinEvent
: public wxNotifyEvent
26 The constructor is not normally used by the user code.
28 wxSpinEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
31 Retrieve the current spin button or control value.
33 int GetPosition() const;
36 Set the value associated with the event.
38 void SetPosition(int pos
);
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.
52 @b NB: the range supported by this control (and wxSpinCtrl) depends on the
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.
58 @style{wxSP_HORIZONTAL}:
59 Specifies a horizontal spin button (note that this style is not
61 @style{wxSP_VERTICAL}:
62 Specifies a vertical spin button.
63 @style{wxSP_ARROW_KEYS}:
64 The user can use arrow keys to change the value.
66 The value wraps at the minimum and maximum.
71 @appearance{spinbutton.png}
76 class wxSpinButton
: public wxControl
81 Constructor, creating and showing a spin button.
84 Parent window. Must not be @NULL.
86 Window identifier. The value wxID_ANY indicates a default value.
88 Window position. If wxDefaultPosition is specified then a default
91 Window size. If wxDefaultSize is specified then a default size
94 Window style. See wxSpinButton.
101 wxSpinButton(wxWindow
* parent
, wxWindowID id
,
102 const wxPoint
& pos
= wxDefaultPosition
,
103 const wxSize
& size
= wxDefaultSize
,
104 long style
= wxSP_HORIZONTAL
,
105 const wxString
& name
= "spinButton");
109 Destructor, destroys the spin button control.
114 Scrollbar creation function called by the spin button constructor.
115 See wxSpinButton() for details.
117 bool Create(wxWindow
* parent
, wxWindowID id
,
118 const wxPoint
& pos
= wxDefaultPosition
,
119 const wxSize
& size
= wxDefaultSize
,
120 long style
= wxSP_HORIZONTAL
,
121 const wxString
& name
= "spinButton");
124 Returns the maximum permissible value.
131 Returns the minimum permissible value.
138 Returns the current spin button value.
142 int GetValue() const;
145 Sets the range of the spin button.
148 The minimum value for the spin button.
150 The maximum value for the spin button.
152 @see GetMin(), GetMax()
154 void SetRange(int min
, int max
);
157 Sets the value of the spin button.
160 The value for the spin button.
162 void SetValue(int value
);