]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: spinctrl.h | |
e54c96f1 | 3 | // Purpose: interface of wxSpinCtrl |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxSpinCtrl | |
11 | @wxheader{spinctrl.h} | |
7c913512 FM |
12 | |
13 | wxSpinCtrl combines wxTextCtrl and | |
23324ae1 | 14 | wxSpinButton in one control. |
7c913512 | 15 | |
23324ae1 | 16 | @beginStyleTable |
8c6791e4 | 17 | @style{wxSP_ARROW_KEYS} |
23324ae1 | 18 | The user can use arrow keys to change the value. |
8c6791e4 | 19 | @style{wxSP_WRAP} |
23324ae1 FM |
20 | The value wraps at the minimum and maximum. |
21 | @endStyleTable | |
7c913512 | 22 | |
23324ae1 FM |
23 | @library{wxcore} |
24 | @category{ctrl} | |
0c7fe6f2 | 25 | <!-- @appearance{spinctrl.png} --> |
7c913512 | 26 | |
e54c96f1 | 27 | @see @ref overview_eventhandlingoverview, wxSpinButton, wxControl |
23324ae1 FM |
28 | */ |
29 | class wxSpinCtrl : public wxControl | |
30 | { | |
31 | public: | |
32 | //@{ | |
33 | /** | |
34 | ) | |
23324ae1 | 35 | Constructor, creating and showing a spin control. |
3c4f71cc | 36 | |
7c913512 | 37 | @param parent |
4cc4bfaf | 38 | Parent window. Must not be @NULL. |
7c913512 | 39 | @param value |
4cc4bfaf | 40 | Default value. |
7c913512 | 41 | @param id |
4cc4bfaf | 42 | Window identifier. The value wxID_ANY indicates a default value. |
7c913512 | 43 | @param pos |
4cc4bfaf FM |
44 | Window position. If wxDefaultPosition is specified then a default |
45 | position is chosen. | |
7c913512 | 46 | @param size |
4cc4bfaf FM |
47 | Window size. If wxDefaultSize is specified then a default size |
48 | is chosen. | |
7c913512 | 49 | @param style |
4cc4bfaf | 50 | Window style. See wxSpinButton. |
7c913512 | 51 | @param min |
4cc4bfaf | 52 | Minimal value. |
7c913512 | 53 | @param max |
4cc4bfaf | 54 | Maximal value. |
7c913512 | 55 | @param initial |
4cc4bfaf | 56 | Initial value. |
7c913512 | 57 | @param name |
4cc4bfaf | 58 | Window name. |
3c4f71cc | 59 | |
4cc4bfaf | 60 | @see Create() |
23324ae1 FM |
61 | */ |
62 | wxSpinCtrl(); | |
7c913512 FM |
63 | wxSpinCtrl(wxWindow* parent, wxWindowID id = -1, |
64 | const wxString& value = wxEmptyString, | |
65 | const wxPoint& pos = wxDefaultPosition, | |
66 | const wxSize& size = wxDefaultSize, | |
67 | long style = wxSP_ARROW_KEYS, | |
68 | int min = 0, int max = 100, | |
69 | int initial = 0); | |
23324ae1 FM |
70 | //@} |
71 | ||
72 | /** | |
73 | ) | |
23324ae1 | 74 | Creation function called by the spin control constructor. |
23324ae1 FM |
75 | See wxSpinCtrl() for details. |
76 | */ | |
77 | bool Create(wxWindow* parent, wxWindowID id = -1, | |
78 | const wxString& value = wxEmptyString, | |
79 | const wxPoint& pos = wxDefaultPosition, | |
80 | const wxSize& size = wxDefaultSize, | |
81 | long style = wxSP_ARROW_KEYS, | |
82 | int min = 0, int max = 100, | |
83 | int initial = 0); | |
84 | ||
85 | /** | |
86 | Gets maximal allowable value. | |
87 | */ | |
328f5751 | 88 | int GetMax() const; |
23324ae1 FM |
89 | |
90 | /** | |
91 | Gets minimal allowable value. | |
92 | */ | |
328f5751 | 93 | int GetMin() const; |
23324ae1 FM |
94 | |
95 | /** | |
96 | Gets the value of the spin control. | |
97 | */ | |
328f5751 | 98 | int GetValue() const; |
23324ae1 FM |
99 | |
100 | /** | |
101 | Sets range of allowable values. | |
102 | */ | |
103 | void SetRange(int minVal, int maxVal); | |
104 | ||
105 | /** | |
7c913512 | 106 | Select the text in the text part of the control between positions |
4cc4bfaf | 107 | @a from (inclusive) and @a to (exclusive). This is similar to |
23324ae1 | 108 | wxTextCtrl::SetSelection. |
1f1d2182 | 109 | @note this is currently only implemented for Windows and generic versions |
23324ae1 FM |
110 | of the control. |
111 | */ | |
112 | void SetSelection(long from, long to); | |
113 | ||
114 | //@{ | |
115 | /** | |
116 | Sets the value of the spin control. | |
117 | */ | |
118 | void SetValue(const wxString& text); | |
7c913512 | 119 | void SetValue(int value); |
23324ae1 FM |
120 | //@} |
121 | }; | |
e54c96f1 | 122 |