]> git.saurik.com Git - wxWidgets.git/blame - interface/gauge.h
More initial reviews of d* interface headers.
[wxWidgets.git] / interface / gauge.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: gauge.h
e54c96f1 3// Purpose: interface of wxGauge
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxGauge
11 @wxheader{gauge.h}
7c913512 12
23324ae1 13 A gauge is a horizontal or vertical bar which shows a quantity (often time).
7c913512 14
23324ae1 15 wxGauge supports two working modes: determinate and indeterminate progress.
7c913512 16
23324ae1
FM
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
20 being done.
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).
7c913512 24
23324ae1 25 wxGauge supports dynamic switch between these two work modes.
7c913512 26
23324ae1 27 There are no user commands for the gauge.
7c913512 28
23324ae1 29 @beginStyleTable
8c6791e4 30 @style{wxGA_HORIZONTAL}
23324ae1 31 Creates a horizontal gauge.
8c6791e4 32 @style{wxGA_VERTICAL}
23324ae1 33 Creates a vertical gauge.
8c6791e4 34 @style{wxGA_SMOOTH}
23324ae1
FM
35 Creates smooth progress bar with one pixel wide update step (not
36 supported by all platforms).
37 @endStyleTable
7c913512 38
23324ae1
FM
39 @library{wxcore}
40 @category{ctrl}
41 @appearance{gauge.png}
7c913512 42
e54c96f1 43 @see wxSlider, wxScrollBar
23324ae1
FM
44*/
45class wxGauge : public wxControl
46{
47public:
48 //@{
49 /**
50 Constructor, creating and showing a gauge.
3c4f71cc 51
7c913512 52 @param parent
4cc4bfaf 53 Window parent.
7c913512 54 @param id
4cc4bfaf 55 Window identifier.
7c913512 56 @param range
4cc4bfaf 57 Integer range (maximum value) of the gauge. It is ignored when the gauge is
23324ae1 58 used in indeterminate mode.
7c913512 59 @param pos
4cc4bfaf 60 Window position.
7c913512 61 @param size
4cc4bfaf 62 Window size.
7c913512 63 @param style
4cc4bfaf 64 Gauge style. See wxGauge.
7c913512 65 @param name
4cc4bfaf 66 Window name.
3c4f71cc 67
4cc4bfaf 68 @see Create()
23324ae1
FM
69 */
70 wxGauge();
7c913512
FM
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");
23324ae1
FM
77 //@}
78
79 /**
80 Destructor, destroying the gauge.
81 */
82 ~wxGauge();
83
84 /**
85 Creates the gauge for two-step construction. See wxGauge()
86 for further details.
87 */
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");
94
95 /**
96 Returns the width of the 3D bezel face.
3c4f71cc 97
23324ae1 98 @remarks This method is not implemented (returns 0) for most platforms.
3c4f71cc 99
4cc4bfaf 100 @see SetBezelFace()
23324ae1 101 */
328f5751 102 int GetBezelFace() const;
23324ae1
FM
103
104 /**
105 Returns the maximum position of the gauge.
3c4f71cc 106
4cc4bfaf 107 @see SetRange()
23324ae1 108 */
328f5751 109 int GetRange() const;
23324ae1
FM
110
111 /**
112 Returns the 3D shadow margin width.
3c4f71cc 113
23324ae1 114 @remarks This method is not implemented (returns 0) for most platforms.
3c4f71cc 115
4cc4bfaf 116 @see SetShadowWidth()
23324ae1 117 */
328f5751 118 int GetShadowWidth() const;
23324ae1
FM
119
120 /**
121 Returns the current position of the gauge.
3c4f71cc 122
4cc4bfaf 123 @see SetValue()
23324ae1 124 */
328f5751 125 int GetValue() const;
23324ae1
FM
126
127 /**
7c913512 128 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
23324ae1
FM
129 @false otherwise.
130 */
328f5751 131 bool IsVertical() const;
23324ae1
FM
132
133 /**
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.
23324ae1
FM
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.
139 */
140 void Pulse();
141
142 /**
143 Sets the 3D bezel face width.
3c4f71cc 144
23324ae1 145 @remarks This method is not implemented (doesn't do anything) for most
4cc4bfaf 146 platforms.
3c4f71cc 147
4cc4bfaf 148 @see GetBezelFace()
23324ae1
FM
149 */
150 void SetBezelFace(int width);
151
152 /**
153 Sets the range (maximum value) of the gauge.
154 This function makes the gauge switch to determinate mode, if it's not already.
3c4f71cc 155
4cc4bfaf 156 @see GetRange()
23324ae1
FM
157 */
158 void SetRange(int range);
159
160 /**
161 Sets the 3D shadow width.
3c4f71cc 162
23324ae1 163 @remarks This method is not implemented (doesn't do anything) for most
4cc4bfaf 164 platforms.
23324ae1
FM
165 */
166 void SetShadowWidth(int width);
167
168 /**
4cc4bfaf 169 Sets the position of the gauge. The @a pos must be between 0 and the gauge
23324ae1 170 range as returned by GetRange(), inclusive.
23324ae1
FM
171 This function makes the gauge switch to determinate mode, if it was in
172 indeterminate mode before.
3c4f71cc 173
7c913512 174 @param pos
4cc4bfaf 175 Position for the gauge level.
3c4f71cc 176
4cc4bfaf 177 @see GetValue()
23324ae1
FM
178 */
179 void SetValue(int pos);
180};
e54c96f1 181