]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: spinctrg.h | |
3 | // Purpose: interface of wxSpinCtrlDouble | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxSpinCtrlDouble | |
11 | ||
12 | wxSpinCtrlDouble combines wxTextCtrl and wxSpinButton in one control and | |
13 | displays a real number. (wxSpinCtrl displays an integer.) | |
14 | ||
15 | @beginStyleTable | |
16 | @style{wxSP_ARROW_KEYS} | |
17 | The user can use arrow keys to change the value. | |
18 | @style{wxSP_WRAP} | |
19 | The value wraps at the minimum and maximum. | |
20 | @endStyleTable | |
21 | ||
22 | @library{wxcore} | |
23 | @category{ctrl} | |
24 | <!-- @appearance{spinctrd.png} --> | |
25 | ||
26 | @see wxSpinButton, wxSpinCtrl, wxControl | |
27 | */ | |
28 | class wxSpinCtrlDouble : public wxControl | |
29 | { | |
30 | public: | |
31 | /** | |
32 | Default constructor. | |
33 | */ | |
34 | wxSpinCtrlDouble(); | |
35 | ||
36 | /** | |
37 | Constructor, creating and showing a spin control. | |
38 | ||
39 | @param parent | |
40 | Parent window. Must not be @NULL. | |
41 | @param value | |
42 | Default value (as text). | |
43 | @param id | |
44 | Window identifier. The value wxID_ANY indicates a default value. | |
45 | @param pos | |
46 | Window position. If wxDefaultPosition is specified then a default | |
47 | position is chosen. | |
48 | @param size | |
49 | Window size. If wxDefaultSize is specified then a default size | |
50 | is chosen. | |
51 | @param style | |
52 | Window style. See wxSpinButton. | |
53 | @param min | |
54 | Minimal value. | |
55 | @param max | |
56 | Maximal value. | |
57 | @param initial | |
58 | Initial value. | |
59 | @param inc | |
60 | Increment value. | |
61 | @param name | |
62 | Window name. | |
63 | ||
64 | @see Create() | |
65 | */ | |
66 | wxSpinCtrlDouble(wxWindow* parent, wxWindowID id = -1, | |
67 | const wxString& value = wxEmptyString, | |
68 | const wxPoint& pos = wxDefaultPosition, | |
69 | const wxSize& size = wxDefaultSize, | |
70 | long style = wxSP_ARROW_KEYS, | |
71 | double min = 0, double max = 100, | |
72 | double initial = 0, double inc = 1, | |
73 | const wxString& name = _T("wxSpinCtrlDouble")); | |
74 | ||
75 | /** | |
76 | Creation function called by the spin control constructor. | |
77 | See wxSpinCtrlDouble() for details. | |
78 | */ | |
79 | bool Create(wxWindow* parent, wxWindowID id = -1, | |
80 | const wxString& value = wxEmptyString, | |
81 | const wxPoint& pos = wxDefaultPosition, | |
82 | const wxSize& size = wxDefaultSize, | |
83 | long style = wxSP_ARROW_KEYS, | |
84 | double min = 0, double max = 100, | |
85 | double initial = 0, double inc = 1, | |
86 | const wxString& name = _T("wxSpinCtrlDouble")); | |
87 | ||
88 | /** | |
89 | Gets the number of digits in the display. | |
90 | */ | |
91 | unsigned GetDigits() const; | |
92 | ||
93 | /** | |
94 | Gets the increment value. | |
95 | */ | |
96 | double GetIncrement() const; | |
97 | ||
98 | /** | |
99 | Gets maximal allowable value. | |
100 | */ | |
101 | double GetMax() const; | |
102 | ||
103 | /** | |
104 | Gets minimal allowable value. | |
105 | */ | |
106 | double GetMin() const; | |
107 | ||
108 | /** | |
109 | Gets the value of the spin control. | |
110 | */ | |
111 | double GetValue() const; | |
112 | ||
113 | /** | |
114 | Sets the number of digits in the display. | |
115 | */ | |
116 | void SetDigits(unsigned digits); | |
117 | ||
118 | /** | |
119 | Sets the increment value. | |
120 | */ | |
121 | void SetIncrement(double inc); | |
122 | ||
123 | /** | |
124 | Sets range of allowable values. | |
125 | */ | |
126 | void SetRange(double minVal, double maxVal); | |
127 | ||
128 | /** | |
129 | Sets the value of the spin control. Use the variant using double instead. | |
130 | */ | |
131 | virtual void SetValue(const wxString& text); | |
132 | ||
133 | /** | |
134 | Sets the value of the spin control. | |
135 | */ | |
136 | void SetValue(double value); | |
137 | }; | |
138 |