]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/gauge.h
Removing more CodeWarrior project files.
[wxWidgets.git] / interface / wx / gauge.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: gauge.h
e54c96f1 3// Purpose: interface of wxGauge
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxGauge
7c913512 11
3d2cf884
BP
12 A gauge is a horizontal or vertical bar which shows a quantity (often
13 time).
7c913512 14
23324ae1 15 wxGauge supports two working modes: determinate and indeterminate progress.
7c913512 16
3d2cf884
BP
17 The first is the usual working mode (see SetValue() and SetRange()) while
18 the second can be used when the program is doing some processing but you
19 don't know how much progress is being done. In this case, you can
20 periodically call the Pulse() function to make the progress bar switch to
21 indeterminate mode (graphically it's usually a set of blocks which move or
22 bounce in the bar control).
7c913512 23
23324ae1 24 wxGauge supports dynamic switch between these two work modes.
7c913512 25
23324ae1 26 There are no user commands for the gauge.
7c913512 27
23324ae1 28 @beginStyleTable
8c6791e4 29 @style{wxGA_HORIZONTAL}
23324ae1 30 Creates a horizontal gauge.
8c6791e4 31 @style{wxGA_VERTICAL}
23324ae1 32 Creates a vertical gauge.
8c6791e4 33 @style{wxGA_SMOOTH}
23324ae1
FM
34 Creates smooth progress bar with one pixel wide update step (not
35 supported by all platforms).
36 @endStyleTable
7c913512 37
23324ae1
FM
38 @library{wxcore}
39 @category{ctrl}
7e59b885 40 @appearance{gauge.png}
7c913512 41
e54c96f1 42 @see wxSlider, wxScrollBar
23324ae1
FM
43*/
44class wxGauge : public wxControl
45{
46public:
3d2cf884
BP
47 /**
48 Default constructor.
49 */
50 wxGauge();
94d17b78 51
23324ae1
FM
52 /**
53 Constructor, creating and showing a gauge.
3c4f71cc 54
7c913512 55 @param parent
4cc4bfaf 56 Window parent.
7c913512 57 @param id
4cc4bfaf 58 Window identifier.
7c913512 59 @param range
94d17b78
FM
60 Integer range (maximum value) of the gauge.
61 See SetRange() for more details about the meaning of this value
62 when using the gauge in indeterminate mode.
7c913512 63 @param pos
4cc4bfaf 64 Window position.
7c913512 65 @param size
4cc4bfaf 66 Window size.
7c913512 67 @param style
3d2cf884 68 Gauge style.
12fd0e1d
VZ
69 @param validator
70 Window validator.
7c913512 71 @param name
4cc4bfaf 72 Window name.
3c4f71cc 73
4cc4bfaf 74 @see Create()
23324ae1 75 */
7c913512
FM
76 wxGauge(wxWindow* parent, wxWindowID id, int range,
77 const wxPoint& pos = wxDefaultPosition,
78 const wxSize& size = wxDefaultSize,
79 long style = wxGA_HORIZONTAL,
80 const wxValidator& validator = wxDefaultValidator,
a44f3b5a 81 const wxString& name = wxGaugeNameStr);
23324ae1
FM
82
83 /**
84 Destructor, destroying the gauge.
85 */
adaaa686 86 virtual ~wxGauge();
23324ae1
FM
87
88 /**
3d2cf884
BP
89 Creates the gauge for two-step construction. See wxGauge() for further
90 details.
23324ae1
FM
91 */
92 bool Create(wxWindow* parent, wxWindowID id, int range,
93 const wxPoint& pos = wxDefaultPosition,
43c48e1e 94 const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL,
23324ae1 95 const wxValidator& validator = wxDefaultValidator,
43c48e1e 96 const wxString& name = wxGaugeNameStr);
23324ae1
FM
97
98 /**
99 Returns the width of the 3D bezel face.
3c4f71cc 100
23324ae1 101 @remarks This method is not implemented (returns 0) for most platforms.
3c4f71cc 102
4cc4bfaf 103 @see SetBezelFace()
23324ae1 104 */
328f5751 105 int GetBezelFace() const;
23324ae1
FM
106
107 /**
108 Returns the maximum position of the gauge.
3c4f71cc 109
4cc4bfaf 110 @see SetRange()
23324ae1 111 */
328f5751 112 int GetRange() const;
23324ae1
FM
113
114 /**
115 Returns the 3D shadow margin width.
3c4f71cc 116
23324ae1 117 @remarks This method is not implemented (returns 0) for most platforms.
3c4f71cc 118
4cc4bfaf 119 @see SetShadowWidth()
23324ae1 120 */
328f5751 121 int GetShadowWidth() const;
23324ae1
FM
122
123 /**
124 Returns the current position of the gauge.
3c4f71cc 125
4cc4bfaf 126 @see SetValue()
23324ae1 127 */
328f5751 128 int GetValue() const;
23324ae1
FM
129
130 /**
7c913512 131 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
23324ae1
FM
132 @false otherwise.
133 */
328f5751 134 bool IsVertical() const;
23324ae1
FM
135
136 /**
3d2cf884
BP
137 Switch the gauge to indeterminate mode (if required) and makes the
138 gauge move a bit to indicate the user that some progress has been made.
139
140 @note After calling this function the value returned by GetValue() is
141 undefined and thus you need to explicitely call SetValue() if you
142 want to restore the determinate mode.
23324ae1 143 */
adaaa686 144 virtual void Pulse();
23324ae1
FM
145
146 /**
147 Sets the 3D bezel face width.
3c4f71cc 148
23324ae1 149 @remarks This method is not implemented (doesn't do anything) for most
4cc4bfaf 150 platforms.
3c4f71cc 151
4cc4bfaf 152 @see GetBezelFace()
23324ae1
FM
153 */
154 void SetBezelFace(int width);
155
156 /**
3d2cf884
BP
157 Sets the range (maximum value) of the gauge. This function makes the
158 gauge switch to determinate mode, if it's not already.
3c4f71cc 159
94d17b78
FM
160 When the gauge is in indeterminate mode, under wxMSW the gauge
161 repeatedly goes from zero to @a range and back; under other ports
162 when in indeterminate mode, the @a range setting is ignored.
163
4cc4bfaf 164 @see GetRange()
23324ae1
FM
165 */
166 void SetRange(int range);
167
168 /**
169 Sets the 3D shadow width.
3c4f71cc 170
23324ae1 171 @remarks This method is not implemented (doesn't do anything) for most
4cc4bfaf 172 platforms.
23324ae1
FM
173 */
174 void SetShadowWidth(int width);
175
176 /**
3d2cf884
BP
177 Sets the position of the gauge. The @a pos must be between 0 and the
178 gauge range as returned by GetRange(), inclusive.
179
23324ae1
FM
180 This function makes the gauge switch to determinate mode, if it was in
181 indeterminate mode before.
3c4f71cc 182
7c913512 183 @param pos
4cc4bfaf 184 Position for the gauge level.
3c4f71cc 185
4cc4bfaf 186 @see GetValue()
23324ae1
FM
187 */
188 void SetValue(int pos);
189};
e54c96f1 190