]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/gauge.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGauge
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
12 A gauge is a horizontal or vertical bar which shows a quantity (often
15 wxGauge supports two working modes: determinate and indeterminate progress.
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).
24 wxGauge supports dynamic switch between these two work modes.
26 There are no user commands for the gauge.
29 @style{wxGA_HORIZONTAL}
30 Creates a horizontal gauge.
32 Creates a vertical gauge.
34 Creates smooth progress bar with one pixel wide update step (not
35 supported by all platforms).
40 @appearance{gauge.png}
42 @see wxSlider, wxScrollBar
44 class wxGauge
: public wxControl
53 Constructor, creating and showing a gauge.
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.
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
,
81 const wxString
& name
= wxGaugeNameStr
);
84 Destructor, destroying the gauge.
89 Creates the gauge for two-step construction. See wxGauge() for further
92 bool Create(wxWindow
* parent
, wxWindowID id
, int range
,
93 const wxPoint
& pos
= wxDefaultPosition
,
94 const wxSize
& size
= wxDefaultSize
, long style
= wxGA_HORIZONTAL
,
95 const wxValidator
& validator
= wxDefaultValidator
,
96 const wxString
& name
= wxGaugeNameStr
);
99 Returns the width of the 3D bezel face.
101 @remarks This method is not implemented (returns 0) for most platforms.
105 int GetBezelFace() const;
108 Returns the maximum position of the gauge.
112 int GetRange() const;
115 Returns the 3D shadow margin width.
117 @remarks This method is not implemented (returns 0) for most platforms.
119 @see SetShadowWidth()
121 int GetShadowWidth() const;
124 Returns the current position of the gauge.
128 int GetValue() const;
131 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
134 bool IsVertical() const;
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.
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.
144 virtual void Pulse();
147 Sets the 3D bezel face width.
149 @remarks This method is not implemented (doesn't do anything) for most
154 void SetBezelFace(int width
);
157 Sets the range (maximum value) of the gauge. This function makes the
158 gauge switch to determinate mode, if it's not already.
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.
166 void SetRange(int range
);
169 Sets the 3D shadow width.
171 @remarks This method is not implemented (doesn't do anything) for most
174 void SetShadowWidth(int width
);
177 Sets the position of the gauge. The @a pos must be between 0 and the
178 gauge range as returned by GetRange(), inclusive.
180 This function makes the gauge switch to determinate mode, if it was in
181 indeterminate mode before.
184 Position for the gauge level.
188 void SetValue(int pos
);