]>
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
16 wxGauge supports two working modes: determinate and indeterminate progress.
18 The first is the usual working mode (see SetValue() and SetRange()) while
19 the second can be used when the program is doing some processing but you
20 don't know how much progress is being done. In this case, you can
21 periodically call the Pulse() function to make the progress bar switch to
22 indeterminate mode (graphically it's usually a set of blocks which move or
23 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.
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
53 Constructor, creating and showing a gauge.
60 Integer range (maximum value) of the gauge. It is ignored when the
61 gauge is used in indeterminate mode.
73 wxGauge(wxWindow
* parent
, wxWindowID id
, int range
,
74 const wxPoint
& pos
= wxDefaultPosition
,
75 const wxSize
& size
= wxDefaultSize
,
76 long style
= wxGA_HORIZONTAL
,
77 const wxValidator
& validator
= wxDefaultValidator
,
78 const wxString
& name
= "gauge");
81 Destructor, destroying the gauge.
86 Creates the gauge for two-step construction. See wxGauge() for further
89 bool Create(wxWindow
* parent
, wxWindowID id
, int range
,
90 const wxPoint
& pos
= wxDefaultPosition
,
91 const wxSize
& size
= wxDefaultSize
,
92 long style
= wxGA_HORIZONTAL
,
93 const wxValidator
& validator
= wxDefaultValidator
,
94 const wxString
& name
= "gauge");
97 Returns the width of the 3D bezel face.
99 @remarks This method is not implemented (returns 0) for most platforms.
103 int GetBezelFace() const;
106 Returns the maximum position of the gauge.
110 int GetRange() const;
113 Returns the 3D shadow margin width.
115 @remarks This method is not implemented (returns 0) for most platforms.
117 @see SetShadowWidth()
119 int GetShadowWidth() const;
122 Returns the current position of the gauge.
126 int GetValue() const;
129 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
132 bool IsVertical() const;
135 Switch the gauge to indeterminate mode (if required) and makes the
136 gauge move a bit to indicate the user that some progress has been made.
138 @note After calling this function the value returned by GetValue() is
139 undefined and thus you need to explicitely call SetValue() if you
140 want to restore the determinate mode.
145 Sets the 3D bezel face width.
147 @remarks This method is not implemented (doesn't do anything) for most
152 void SetBezelFace(int width
);
155 Sets the range (maximum value) of the gauge. This function makes the
156 gauge switch to determinate mode, if it's not already.
160 void SetRange(int range
);
163 Sets the 3D shadow width.
165 @remarks This method is not implemented (doesn't do anything) for most
168 void SetShadowWidth(int width
);
171 Sets the position of the gauge. The @a pos must be between 0 and the
172 gauge range as returned by GetRange(), inclusive.
174 This function makes the gauge switch to determinate mode, if it was in
175 indeterminate mode before.
178 Position for the gauge level.
182 void SetValue(int pos
);