]>
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 /////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
11 // wxGauge style flags
12 // ----------------------------------------------------------------------------
14 #define wxGA_HORIZONTAL wxHORIZONTAL
15 #define wxGA_VERTICAL wxVERTICAL
17 // Win32 only, is default (and only) on some other platforms
18 #define wxGA_SMOOTH 0x0020
23 A gauge is a horizontal or vertical bar which shows a quantity (often
26 wxGauge supports two working modes: determinate and indeterminate progress.
28 The first is the usual working mode (see SetValue() and SetRange()) while
29 the second can be used when the program is doing some processing but you
30 don't know how much progress is being done. In this case, you can
31 periodically call the Pulse() function to make the progress bar switch to
32 indeterminate mode (graphically it's usually a set of blocks which move or
33 bounce in the bar control).
35 wxGauge supports dynamic switch between these two work modes.
37 There are no user commands for the gauge.
40 @style{wxGA_HORIZONTAL}
41 Creates a horizontal gauge.
43 Creates a vertical gauge.
45 Creates smooth progress bar with one pixel wide update step (not
46 supported by all platforms).
53 @see wxSlider, wxScrollBar
55 class wxGauge
: public wxControl
64 Constructor, creating and showing a gauge.
71 Integer range (maximum value) of the gauge.
72 See SetRange() for more details about the meaning of this value
73 when using the gauge in indeterminate mode.
87 wxGauge(wxWindow
* parent
, wxWindowID id
, int range
,
88 const wxPoint
& pos
= wxDefaultPosition
,
89 const wxSize
& size
= wxDefaultSize
,
90 long style
= wxGA_HORIZONTAL
,
91 const wxValidator
& validator
= wxDefaultValidator
,
92 const wxString
& name
= wxGaugeNameStr
);
95 Destructor, destroying the gauge.
100 Creates the gauge for two-step construction. See wxGauge() for further
103 bool Create(wxWindow
* parent
, wxWindowID id
, int range
,
104 const wxPoint
& pos
= wxDefaultPosition
,
105 const wxSize
& size
= wxDefaultSize
, long style
= wxGA_HORIZONTAL
,
106 const wxValidator
& validator
= wxDefaultValidator
,
107 const wxString
& name
= wxGaugeNameStr
);
110 Returns the width of the 3D bezel face.
112 @remarks This method is not implemented (returns 0) for most platforms.
116 int GetBezelFace() const;
119 Returns the maximum position of the gauge.
123 int GetRange() const;
126 Returns the 3D shadow margin width.
128 @remarks This method is not implemented (returns 0) for most platforms.
130 @see SetShadowWidth()
132 int GetShadowWidth() const;
135 Returns the current position of the gauge.
139 int GetValue() const;
142 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
145 bool IsVertical() const;
148 Switch the gauge to indeterminate mode (if required) and makes the
149 gauge move a bit to indicate the user that some progress has been made.
151 @note After calling this function the value returned by GetValue() is
152 undefined and thus you need to explicitly call SetValue() if you
153 want to restore the determinate mode.
155 virtual void Pulse();
158 Sets the 3D bezel face width.
160 @remarks This method is not implemented (doesn't do anything) for most
165 void SetBezelFace(int width
);
168 Sets the range (maximum value) of the gauge. This function makes the
169 gauge switch to determinate mode, if it's not already.
171 When the gauge is in indeterminate mode, under wxMSW the gauge
172 repeatedly goes from zero to @a range and back; under other ports
173 when in indeterminate mode, the @a range setting is ignored.
177 void SetRange(int range
);
180 Sets the 3D shadow width.
182 @remarks This method is not implemented (doesn't do anything) for most
185 void SetShadowWidth(int width
);
188 Sets the position of the gauge. The @a pos must be between 0 and the
189 gauge range as returned by GetRange(), inclusive.
191 This function makes the gauge switch to determinate mode, if it was in
192 indeterminate mode before.
195 Position for the gauge level.
199 void SetValue(int pos
);