]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/gauge.tex
corrected typo in the creation date
[wxWidgets.git] / docs / latex / wx / gauge.tex
CommitLineData
a660d684
KB
1\section{\class{wxGauge}}\label{wxgauge}
2
3A gauge is a horizontal or vertical bar which shows a quantity (often time).
23ac7605
RR
4
5wxGauge supports two working modes: determinate and indeterminate progress.
6
7The first is the usual working mode (see \helpref{SetValue}{wxgaugesetvalue}
8and \helpref{SetRange}{wxgaugesetrange}) while the second can be used when
9the program is doing some processing but you don't know how much progress is
10being done.
11In this case, you can periodically call the \helpref{Pulse}{wxgaugepulse}
12function to make the progress bar switch to indeterminate mode (graphically
13it's usually a set of blocks which move or bounce in the bar control).
14
15wxGauge supports dynamic switch between these two work modes.
16
a660d684
KB
17There are no user commands for the gauge.
18
19\wxheading{Derived from}
20
21\helpref{wxControl}{wxcontrol}\\
22\helpref{wxWindow}{wxwindow}\\
9dff4182 23\helpref{wxEvtHandler}{wxevthandler}\\
a660d684
KB
24\helpref{wxObject}{wxobject}
25
954b8ae6
JS
26\wxheading{Include files}
27
28<wx/gauge.h>
29
a660d684
KB
30\wxheading{Window styles}
31
32\twocolwidtha{5cm}
33\begin{twocollist}\itemsep=0pt
34\twocolitem{\windowstyle{wxGA\_HORIZONTAL}}{Creates a horizontal gauge.}
35\twocolitem{\windowstyle{wxGA\_VERTICAL}}{Creates a vertical gauge.}
0a4e3323
VZ
36%\twocolitem{\windowstyle{wxGA\_PROGRESSBAR}}{Obsolete, doesn't do anything any more}
37\twocolitem{\windowstyle{wxGA\_SMOOTH}}{Creates smooth progress bar with one pixel wide update step (not supported by all platforms).}
a660d684
KB
38\end{twocollist}
39
40See also \helpref{window styles overview}{windowstyles}.
41
5de76427
JS
42\wxheading{Event handling}
43
44wxGauge is read-only so generates no events.
45
a660d684
KB
46\wxheading{See also}
47
48\helpref{wxSlider}{wxslider}, \helpref{wxScrollBar}{wxscrollbar}
49
50\latexignore{\rtfignore{\wxheading{Members}}}
51
0a4e3323 52
f0e8a2d0 53\membersection{wxGauge::wxGauge}\label{wxgaugector}
a660d684
KB
54
55\func{}{wxGauge}{\void}
56
57Default constructor.
58
eaaa6a06
JS
59\func{}{wxGauge}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
60\param{int}{ range}, \param{const wxPoint\& }{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
61\param{long}{ style = wxGA\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``gauge"}}
a660d684
KB
62
63Constructor, creating and showing a gauge.
64
65\wxheading{Parameters}
66
67\docparam{parent}{Window parent.}
68
69\docparam{id}{Window identifier.}
70
23ac7605 71\docparam{range}{Integer range (maximum value) of the gauge. It is ignored when the gauge is used in indeterminate mode.}
a660d684
KB
72
73\docparam{pos}{Window position.}
74
75\docparam{size}{Window size.}
76
77\docparam{style}{Gauge style. See \helpref{wxGauge}{wxgauge}.}
78
79\docparam{name}{Window name.}
80
a660d684
KB
81\wxheading{See also}
82
83\helpref{wxGauge::Create}{wxgaugecreate}
84
0a4e3323 85
f0e8a2d0 86\membersection{wxGauge::\destruct{wxGauge}}\label{wxgaugedtor}
a660d684
KB
87
88\func{}{\destruct{wxGauge}}{\void}
89
90Destructor, destroying the gauge.
91
0a4e3323 92
a660d684
KB
93\membersection{wxGauge::Create}\label{wxgaugecreate}
94
eaaa6a06
JS
95\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
96\param{int}{ range}, \param{const wxPoint\& }{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
97\param{long}{ style = wxGA\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``gauge"}}
a660d684 98
f0e8a2d0 99Creates the gauge for two-step construction. See \helpref{wxGauge::wxGauge}{wxgaugector}\rtfsp
a660d684
KB
100for further details.
101
0a4e3323 102
a660d684
KB
103\membersection{wxGauge::GetBezelFace}\label{wxgaugegetbezelface}
104
105\constfunc{int}{GetBezelFace}{\void}
106
107Returns the width of the 3D bezel face.
108
109\wxheading{Remarks}
110
0a4e3323 111This method is not implemented (returns $0$) for most platforms.
a660d684
KB
112
113\wxheading{See also}
114
115\helpref{wxGauge::SetBezelFace}{wxgaugesetbezelface}
116
0a4e3323 117
a660d684
KB
118\membersection{wxGauge::GetRange}\label{wxgaugegetrange}
119
120\constfunc{int}{GetRange}{\void}
121
122Returns the maximum position of the gauge.
123
124\wxheading{See also}
125
126\helpref{wxGauge::SetRange}{wxgaugesetrange}
127
0a4e3323 128
a660d684
KB
129\membersection{wxGauge::GetShadowWidth}\label{wxgaugegetshadowwidth}
130
131\constfunc{int}{GetShadowWidth}{\void}
132
133Returns the 3D shadow margin width.
134
135\wxheading{Remarks}
136
0a4e3323 137This method is not implemented (returns $0$) for most platforms.
a660d684
KB
138
139\wxheading{See also}
140
141\helpref{wxGauge::SetShadowWidth}{wxgaugesetshadowwidth}
142
0a4e3323 143
a660d684
KB
144\membersection{wxGauge::GetValue}\label{wxgaugegetvalue}
145
146\constfunc{int}{GetValue}{\void}
147
148Returns the current position of the gauge.
149
150\wxheading{See also}
151
152\helpref{wxGauge::SetValue}{wxgaugesetvalue}
153
0a4e3323
VZ
154
155\membersection{wxGauge::IsVertical}\label{wxgaugeisvertical}
156
157\constfunc{bool}{IsVertical}{\void}
158
159Returns \true if the gauge is vertical (has \texttt{wxGA\_VERTICAL} style) and
160\false otherwise.
161
162
a660d684
KB
163\membersection{wxGauge::SetBezelFace}\label{wxgaugesetbezelface}
164
eaaa6a06 165\func{void}{SetBezelFace}{\param{int }{width}}
a660d684
KB
166
167Sets the 3D bezel face width.
168
169\wxheading{Remarks}
170
0a4e3323 171This method is not implemented (doesn't do anything) for most platforms.
a660d684
KB
172
173\wxheading{See also}
174
175\helpref{wxGauge::GetBezelFace}{wxgaugegetbezelface}
176
0a4e3323 177
a660d684
KB
178\membersection{wxGauge::SetRange}\label{wxgaugesetrange}
179
eaaa6a06 180\func{void}{SetRange}{\param{int }{range}}
a660d684
KB
181
182Sets the range (maximum value) of the gauge.
23ac7605 183This function makes the gauge switch to determinate mode, if it's not already.
a660d684
KB
184
185\wxheading{See also}
186
187\helpref{wxGauge::GetRange}{wxgaugegetrange}
188
0a4e3323 189
a660d684
KB
190\membersection{wxGauge::SetShadowWidth}\label{wxgaugesetshadowwidth}
191
eaaa6a06 192\func{void}{SetShadowWidth}{\param{int }{width}}
a660d684
KB
193
194Sets the 3D shadow width.
195
196\wxheading{Remarks}
197
0a4e3323
VZ
198This method is not implemented (doesn't do anything) for most platforms.
199
a660d684
KB
200
201\membersection{wxGauge::SetValue}\label{wxgaugesetvalue}
202
eaaa6a06 203\func{void}{SetValue}{\param{int }{pos}}
a660d684
KB
204
205Sets the position of the gauge.
23ac7605 206This function makes the gauge switch to determinate mode, if it's not already.
a660d684
KB
207
208\wxheading{Parameters}
209
210\docparam{pos}{Position for the gauge level.}
211
212\wxheading{See also}
213
214\helpref{wxGauge::GetValue}{wxgaugegetvalue}
215
216
23ac7605
RR
217\membersection{wxGauge::Pulse}\label{wxgaugepulse}
218
219\func{void}{Pulse}{\void}
220
221Switch the gauge to indeterminate mode (if required) and makes the gauge move
222a bit to indicate the user that some progress has been made.
223
224Note that after calling this function the value returned by \helpref{GetValue}{wxgaugegetvalue}
225is undefined and thus you need to explicitely call \helpref{SetValue}{wxgaugesetvalue} if you
226want to restore the determinate mode.
b67a86d5 227