]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/gauge.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGauge
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 // ----------------------------------------------------------------------------
10 // wxGauge style flags
11 // ----------------------------------------------------------------------------
13 #define wxGA_HORIZONTAL wxHORIZONTAL
14 #define wxGA_VERTICAL wxVERTICAL
16 // Win32 only, is default (and only) on some other platforms
17 #define wxGA_SMOOTH 0x0020
22 A gauge is a horizontal or vertical bar which shows a quantity (often
25 wxGauge supports two working modes: determinate and indeterminate progress.
27 The first is the usual working mode (see SetValue() and SetRange()) while
28 the second can be used when the program is doing some processing but you
29 don't know how much progress is being done. In this case, you can
30 periodically call the Pulse() function to make the progress bar switch to
31 indeterminate mode (graphically it's usually a set of blocks which move or
32 bounce in the bar control).
34 wxGauge supports dynamic switch between these two work modes.
36 There are no user commands for the gauge.
39 @style{wxGA_HORIZONTAL}
40 Creates a horizontal gauge.
42 Creates a vertical gauge.
44 Creates smooth progress bar with one pixel wide update step (not
45 supported by all platforms).
52 @see wxSlider, wxScrollBar
54 class wxGauge
: public wxControl
63 Constructor, creating and showing a gauge.
70 Integer range (maximum value) of the gauge.
71 See SetRange() for more details about the meaning of this value
72 when using the gauge in indeterminate mode.
86 wxGauge(wxWindow
* parent
, wxWindowID id
, int range
,
87 const wxPoint
& pos
= wxDefaultPosition
,
88 const wxSize
& size
= wxDefaultSize
,
89 long style
= wxGA_HORIZONTAL
,
90 const wxValidator
& validator
= wxDefaultValidator
,
91 const wxString
& name
= wxGaugeNameStr
);
94 Destructor, destroying the gauge.
99 Creates the gauge for two-step construction. See wxGauge() for further
102 bool Create(wxWindow
* parent
, wxWindowID id
, int range
,
103 const wxPoint
& pos
= wxDefaultPosition
,
104 const wxSize
& size
= wxDefaultSize
, long style
= wxGA_HORIZONTAL
,
105 const wxValidator
& validator
= wxDefaultValidator
,
106 const wxString
& name
= wxGaugeNameStr
);
109 Returns the width of the 3D bezel face.
111 @remarks This method is not implemented (returns 0) for most platforms.
115 int GetBezelFace() const;
118 Returns the maximum position of the gauge.
122 int GetRange() const;
125 Returns the 3D shadow margin width.
127 @remarks This method is not implemented (returns 0) for most platforms.
129 @see SetShadowWidth()
131 int GetShadowWidth() const;
134 Returns the current position of the gauge.
138 int GetValue() const;
141 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
144 bool IsVertical() const;
147 Switch the gauge to indeterminate mode (if required) and makes the
148 gauge move a bit to indicate the user that some progress has been made.
150 @note After calling this function the value returned by GetValue() is
151 undefined and thus you need to explicitly call SetValue() if you
152 want to restore the determinate mode.
154 virtual void Pulse();
157 Sets the 3D bezel face width.
159 @remarks This method is not implemented (doesn't do anything) for most
164 void SetBezelFace(int width
);
167 Sets the range (maximum value) of the gauge. This function makes the
168 gauge switch to determinate mode, if it's not already.
170 When the gauge is in indeterminate mode, under wxMSW the gauge
171 repeatedly goes from zero to @a range and back; under other ports
172 when in indeterminate mode, the @a range setting is ignored.
176 void SetRange(int range
);
179 Sets the 3D shadow width.
181 @remarks This method is not implemented (doesn't do anything) for most
184 void SetShadowWidth(int width
);
187 Sets the position of the gauge. The @a pos must be between 0 and the
188 gauge range as returned by GetRange(), inclusive.
190 This function makes the gauge switch to determinate mode, if it was in
191 indeterminate mode before.
194 Position for the gauge level.
198 void SetValue(int pos
);