]>
git.saurik.com Git - wxWidgets.git/blob - interface/gauge.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGauge
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A gauge is a horizontal or vertical bar which shows a quantity (often time).
15 wxGauge supports two working modes: determinate and indeterminate progress.
17 The first is the usual working mode (see wxGauge::SetValue
18 and wxGauge::SetRange) while the second can be used when
19 the program is doing some processing but you don't know how much progress is
21 In this case, you can periodically call the wxGauge::Pulse
22 function to make the progress bar switch to indeterminate mode (graphically
23 it's usually a set of blocks which move or bounce in the bar control).
25 wxGauge supports dynamic switch between these two work modes.
27 There are no user commands for the gauge.
30 @style{wxGA_HORIZONTAL}:
31 Creates a horizontal gauge.
32 @style{wxGA_VERTICAL}:
33 Creates a vertical gauge.
35 Creates smooth progress bar with one pixel wide update step (not
36 supported by all platforms).
41 @appearance{gauge.png}
43 @see wxSlider, wxScrollBar
45 class wxGauge
: public wxControl
50 Constructor, creating and showing a gauge.
57 Integer range (maximum value) of the gauge. It is ignored when the gauge is
58 used in indeterminate mode.
64 Gauge style. See wxGauge.
71 wxGauge(wxWindow
* parent
, wxWindowID id
, int range
,
72 const wxPoint
& pos
= wxDefaultPosition
,
73 const wxSize
& size
= wxDefaultSize
,
74 long style
= wxGA_HORIZONTAL
,
75 const wxValidator
& validator
= wxDefaultValidator
,
76 const wxString
& name
= "gauge");
80 Destructor, destroying the gauge.
85 Creates the gauge for two-step construction. See wxGauge()
88 bool Create(wxWindow
* parent
, wxWindowID id
, int range
,
89 const wxPoint
& pos
= wxDefaultPosition
,
90 const wxSize
& size
= wxDefaultSize
,
91 long style
= wxGA_HORIZONTAL
,
92 const wxValidator
& validator
= wxDefaultValidator
,
93 const wxString
& name
= "gauge");
96 Returns the width of the 3D bezel face.
98 @remarks This method is not implemented (returns 0) for most platforms.
102 int GetBezelFace() const;
105 Returns the maximum position of the gauge.
109 int GetRange() const;
112 Returns the 3D shadow margin width.
114 @remarks This method is not implemented (returns 0) for most platforms.
116 @see SetShadowWidth()
118 int GetShadowWidth() const;
121 Returns the current position of the gauge.
125 int GetValue() const;
128 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
131 bool IsVertical() const;
134 Switch the gauge to indeterminate mode (if required) and makes the gauge move
135 a bit to indicate the user that some progress has been made.
136 Note that after calling this function the value returned by GetValue()
137 is undefined and thus you need to explicitely call SetValue() if you
138 want to restore the determinate mode.
143 Sets the 3D bezel face width.
145 @remarks This method is not implemented (doesn't do anything) for most
150 void SetBezelFace(int width
);
153 Sets the range (maximum value) of the gauge.
154 This function makes the gauge switch to determinate mode, if it's not already.
158 void SetRange(int range
);
161 Sets the 3D shadow width.
163 @remarks This method is not implemented (doesn't do anything) for most
166 void SetShadowWidth(int width
);
169 Sets the position of the gauge. The @a pos must be between 0 and the gauge
170 range as returned by GetRange(), inclusive.
171 This function makes the gauge switch to determinate mode, if it was in
172 indeterminate mode before.
175 Position for the gauge level.
179 void SetValue(int pos
);