]> git.saurik.com Git - wxWidgets.git/blame - interface/gauge.h
add wxShowEvent::IsShown() and wxIconizeEvent::IsIconized() instead of (now deprecate...
[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
3d2cf884
BP
13 A gauge is a horizontal or vertical bar which shows a quantity (often
14 time).
7c913512 15
23324ae1 16 wxGauge supports two working modes: determinate and indeterminate progress.
7c913512 17
3d2cf884
BP
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).
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}
3d2cf884 41 <!-- @appearance{gauge.png} -->
7c913512 42
e54c96f1 43 @see wxSlider, wxScrollBar
23324ae1
FM
44*/
45class wxGauge : public wxControl
46{
47public:
3d2cf884
BP
48 /**
49 Default constructor.
50 */
51 wxGauge();
23324ae1
FM
52 /**
53 Constructor, creating and showing a gauge.
3c4f71cc 54
7c913512 55 @param parent
4cc4bfaf 56 Window parent.
7c913512 57 @param id
4cc4bfaf 58 Window identifier.
7c913512 59 @param range
3d2cf884
BP
60 Integer range (maximum value) of the gauge. It is ignored when the
61 gauge is used in indeterminate mode.
7c913512 62 @param pos
4cc4bfaf 63 Window position.
7c913512 64 @param size
4cc4bfaf 65 Window size.
7c913512 66 @param style
3d2cf884 67 Gauge style.
7c913512 68 @param name
4cc4bfaf 69 Window name.
3c4f71cc 70
4cc4bfaf 71 @see Create()
23324ae1 72 */
7c913512
FM
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");
23324ae1
FM
79
80 /**
81 Destructor, destroying the gauge.
82 */
83 ~wxGauge();
84
85 /**
3d2cf884
BP
86 Creates the gauge for two-step construction. See wxGauge() for further
87 details.
23324ae1
FM
88 */
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");
95
96 /**
97 Returns the width of the 3D bezel face.
3c4f71cc 98
23324ae1 99 @remarks This method is not implemented (returns 0) for most platforms.
3c4f71cc 100
4cc4bfaf 101 @see SetBezelFace()
23324ae1 102 */
328f5751 103 int GetBezelFace() const;
23324ae1
FM
104
105 /**
106 Returns the maximum position of the gauge.
3c4f71cc 107
4cc4bfaf 108 @see SetRange()
23324ae1 109 */
328f5751 110 int GetRange() const;
23324ae1
FM
111
112 /**
113 Returns the 3D shadow margin width.
3c4f71cc 114
23324ae1 115 @remarks This method is not implemented (returns 0) for most platforms.
3c4f71cc 116
4cc4bfaf 117 @see SetShadowWidth()
23324ae1 118 */
328f5751 119 int GetShadowWidth() const;
23324ae1
FM
120
121 /**
122 Returns the current position of the gauge.
3c4f71cc 123
4cc4bfaf 124 @see SetValue()
23324ae1 125 */
328f5751 126 int GetValue() const;
23324ae1
FM
127
128 /**
7c913512 129 Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
23324ae1
FM
130 @false otherwise.
131 */
328f5751 132 bool IsVertical() const;
23324ae1
FM
133
134 /**
3d2cf884
BP
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.
137
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.
23324ae1
FM
141 */
142 void Pulse();
143
144 /**
145 Sets the 3D bezel face width.
3c4f71cc 146
23324ae1 147 @remarks This method is not implemented (doesn't do anything) for most
4cc4bfaf 148 platforms.
3c4f71cc 149
4cc4bfaf 150 @see GetBezelFace()
23324ae1
FM
151 */
152 void SetBezelFace(int width);
153
154 /**
3d2cf884
BP
155 Sets the range (maximum value) of the gauge. This function makes the
156 gauge switch to determinate mode, if it's not already.
3c4f71cc 157
4cc4bfaf 158 @see GetRange()
23324ae1
FM
159 */
160 void SetRange(int range);
161
162 /**
163 Sets the 3D shadow width.
3c4f71cc 164
23324ae1 165 @remarks This method is not implemented (doesn't do anything) for most
4cc4bfaf 166 platforms.
23324ae1
FM
167 */
168 void SetShadowWidth(int width);
169
170 /**
3d2cf884
BP
171 Sets the position of the gauge. The @a pos must be between 0 and the
172 gauge range as returned by GetRange(), inclusive.
173
23324ae1
FM
174 This function makes the gauge switch to determinate mode, if it was in
175 indeterminate mode before.
3c4f71cc 176
7c913512 177 @param pos
4cc4bfaf 178 Position for the gauge level.
3c4f71cc 179
4cc4bfaf 180 @see GetValue()
23324ae1
FM
181 */
182 void SetValue(int pos);
183};
e54c96f1 184