]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/spinbutt.h
few details fixed
[wxWidgets.git] / interface / wx / 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
7c913512
FM
11
12 This event class is used for the events generated by
23324ae1 13 wxSpinButton and wxSpinCtrl.
7c913512 14
23324ae1
FM
15 @library{wxcore}
16 @category{events}
7c913512 17
e54c96f1 18 @see wxSpinButton and wxSpinCtrl
23324ae1
FM
19*/
20class wxSpinEvent : public wxNotifyEvent
21{
22public:
23 /**
24 The constructor is not normally used by the user code.
25 */
4cc4bfaf 26 wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
23324ae1
FM
27
28 /**
29 Retrieve the current spin button or control value.
30 */
328f5751 31 int GetPosition() const;
23324ae1
FM
32
33 /**
34 Set the value associated with the event.
35 */
36 void SetPosition(int pos);
37};
38
39
e54c96f1 40
23324ae1
FM
41/**
42 @class wxSpinButton
7c913512 43
23324ae1
FM
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.
7c913512 49
1f1d2182 50 @note the range supported by this control (and wxSpinCtrl) depends on the
23324ae1
FM
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.
7c913512 54
23324ae1 55 @beginStyleTable
8c6791e4 56 @style{wxSP_HORIZONTAL}
23324ae1
FM
57 Specifies a horizontal spin button (note that this style is not
58 supported in wxGTK).
8c6791e4 59 @style{wxSP_VERTICAL}
23324ae1 60 Specifies a vertical spin button.
8c6791e4 61 @style{wxSP_ARROW_KEYS}
23324ae1 62 The user can use arrow keys to change the value.
8c6791e4 63 @style{wxSP_WRAP}
23324ae1
FM
64 The value wraps at the minimum and maximum.
65 @endStyleTable
7c913512 66
23324ae1
FM
67 @library{wxcore}
68 @category{ctrl}
0c7fe6f2 69 <!-- @appearance{spinbutton.png} -->
7c913512 70
e54c96f1 71 @see wxSpinCtrl
23324ae1
FM
72*/
73class wxSpinButton : public wxControl
74{
75public:
d930d177
RR
76 /**
77 Default constructor.
78 */
79 wxSpinButton();
80
23324ae1
FM
81 /**
82 Constructor, creating and showing a spin button.
3c4f71cc 83
7c913512 84 @param parent
4cc4bfaf 85 Parent window. Must not be @NULL.
7c913512 86 @param id
4cc4bfaf 87 Window identifier. The value wxID_ANY indicates a default value.
7c913512 88 @param pos
4cc4bfaf
FM
89 Window position. If wxDefaultPosition is specified then a default
90 position is chosen.
7c913512 91 @param size
4cc4bfaf
FM
92 Window size. If wxDefaultSize is specified then a default size
93 is chosen.
7c913512 94 @param style
4cc4bfaf 95 Window style. See wxSpinButton.
7c913512 96 @param name
4cc4bfaf 97 Window name.
3c4f71cc 98
4cc4bfaf 99 @see Create()
23324ae1 100 */
7c913512
FM
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");
23324ae1
FM
106
107 /**
108 Destructor, destroys the spin button control.
109 */
110 ~wxSpinButton();
111
112 /**
113 Scrollbar creation function called by the spin button constructor.
114 See wxSpinButton() for details.
115 */
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");
121
122 /**
123 Returns the maximum permissible value.
3c4f71cc 124
4cc4bfaf 125 @see SetRange()
23324ae1 126 */
328f5751 127 int GetMax() const;
23324ae1
FM
128
129 /**
130 Returns the minimum permissible value.
3c4f71cc 131
4cc4bfaf 132 @see SetRange()
23324ae1 133 */
328f5751 134 int GetMin() const;
23324ae1
FM
135
136 /**
137 Returns the current spin button value.
3c4f71cc 138
4cc4bfaf 139 @see SetValue()
23324ae1 140 */
328f5751 141 int GetValue() const;
23324ae1
FM
142
143 /**
144 Sets the range of the spin button.
3c4f71cc 145
7c913512 146 @param min
4cc4bfaf 147 The minimum value for the spin button.
7c913512 148 @param max
4cc4bfaf 149 The maximum value for the spin button.
3c4f71cc 150
4cc4bfaf 151 @see GetMin(), GetMax()
23324ae1
FM
152 */
153 void SetRange(int min, int max);
154
155 /**
156 Sets the value of the spin button.
3c4f71cc 157
7c913512 158 @param value
4cc4bfaf 159 The value for the spin button.
23324ae1
FM
160 */
161 void SetValue(int value);
162};
e54c96f1 163