]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/spinbutt.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSpinEvent
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 This event class is used for the events generated by
13 wxSpinButton and wxSpinCtrl.
18 @see wxSpinButton and wxSpinCtrl
20 class wxSpinEvent
: public wxNotifyEvent
24 The constructor is not normally used by the user code.
26 wxSpinEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
29 Retrieve the current spin button or control value.
31 int GetPosition() const;
34 Set the value associated with the event.
36 void SetPosition(int pos
);
44 A wxSpinButton has two small up and down (or left and right) arrow buttons. It
45 is often used next to a text control for increment and decrementing a value.
46 Portable programs should try to use wxSpinCtrl instead
47 as wxSpinButton is not implemented for all platforms but wxSpinCtrl is as it
48 degenerates to a simple wxTextCtrl on such platforms.
50 @note the range supported by this control (and wxSpinCtrl) depends on the
51 platform but is at least @c -0x8000 to @c 0x7fff. Under GTK and
52 Win32 with sufficiently new version of @c comctrl32.dll (at least 4.71 is
53 required, 5.80 is recommended) the full 32 bit range is supported.
56 @style{wxSP_HORIZONTAL}
57 Specifies a horizontal spin button (note that this style is not
60 Specifies a vertical spin button.
61 @style{wxSP_ARROW_KEYS}
62 The user can use arrow keys to change the value.
64 The value wraps at the minimum and maximum.
69 <!-- @appearance{spinbutton.png} -->
73 class wxSpinButton
: public wxControl
82 Constructor, creating and showing a spin button.
85 Parent window. Must not be @NULL.
87 Window identifier. The value wxID_ANY indicates a default value.
89 Window position. If wxDefaultPosition is specified then a default
92 Window size. If wxDefaultSize is specified then a default size
95 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");
108 Destructor, destroys the spin button control.
110 virtual ~wxSpinButton();
113 Scrollbar creation function called by the spin button constructor.
114 See wxSpinButton() for details.
116 bool Create(wxWindow
* parent
, wxWindowID id
,
117 const wxPoint
& pos
= wxDefaultPosition
,
118 const wxSize
& size
= wxDefaultSize
,
119 long style
= wxSP_HORIZONTAL
,
120 const wxString
& name
= "spinButton");
123 Returns the maximum permissible value.
127 virtual int GetMax() const;
130 Returns the minimum permissible value.
134 virtual int GetMin() const;
137 Returns the current spin button value.
141 virtual int GetValue() const;
144 Sets the range of the spin button.
147 The minimum value for the spin button.
149 The maximum value for the spin button.
151 @see GetMin(), GetMax()
153 virtual void SetRange(int min
, int max
);
156 Sets the value of the spin button.
159 The value for the spin button.
161 virtual void SetValue(int value
);