1 \section{\class{wxGauge
}}\label{wxgauge
}
3 A gauge is a horizontal or vertical bar which shows a quantity (often time).
5 wxGauge supports two working modes: determinate and indeterminate progress.
7 The first is the usual working mode (see
\helpref{SetValue
}{wxgaugesetvalue
}
8 and
\helpref{SetRange
}{wxgaugesetrange
}) while the second can be used when
9 the program is doing some processing but you don't know how much progress is
11 In this case, you can periodically call the
\helpref{Pulse
}{wxgaugepulse
}
12 function to make the progress bar switch to indeterminate mode (graphically
13 it's usually a set of blocks which move or bounce in the bar control).
15 wxGauge supports dynamic switch between these two work modes.
17 There are no user commands for the gauge.
19 \wxheading{Derived from
}
21 \helpref{wxControl
}{wxcontrol
}\\
22 \helpref{wxWindow
}{wxwindow
}\\
23 \helpref{wxEvtHandler
}{wxevthandler
}\\
24 \helpref{wxObject
}{wxobject
}
26 \wxheading{Include files
}
30 \wxheading{Window styles
}
33 \begin{twocollist
}\itemsep=
0pt
34 \twocolitem{\windowstyle{wxGA
\_HORIZONTAL}}{Creates a horizontal gauge.
}
35 \twocolitem{\windowstyle{wxGA
\_VERTICAL}}{Creates a vertical gauge.
}
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).
}
40 See also
\helpref{window styles overview
}{windowstyles
}.
42 \wxheading{Event handling
}
44 wxGauge is read-only so generates no events.
48 \helpref{wxSlider
}{wxslider
},
\helpref{wxScrollBar
}{wxscrollbar
}
50 \latexignore{\rtfignore{\wxheading{Members
}}}
53 \membersection{wxGauge::wxGauge
}\label{wxgaugector
}
55 \func{}{wxGauge
}{\void}
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"
}}
63 Constructor, creating and showing a gauge.
65 \wxheading{Parameters
}
67 \docparam{parent
}{Window parent.
}
69 \docparam{id
}{Window identifier.
}
71 \docparam{range
}{Integer range (maximum value) of the gauge. It is ignored when the gauge is used in indeterminate mode.
}
73 \docparam{pos
}{Window position.
}
75 \docparam{size
}{Window size.
}
77 \docparam{style
}{Gauge style. See
\helpref{wxGauge
}{wxgauge
}.
}
79 \docparam{name
}{Window name.
}
83 \helpref{wxGauge::Create
}{wxgaugecreate
}
86 \membersection{wxGauge::
\destruct{wxGauge
}}\label{wxgaugedtor
}
88 \func{}{\destruct{wxGauge
}}{\void}
90 Destructor, destroying the gauge.
93 \membersection{wxGauge::Create
}\label{wxgaugecreate
}
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"
}}
99 Creates the gauge for two-step construction. See
\helpref{wxGauge::wxGauge
}{wxgaugector
}\rtfsp
103 \membersection{wxGauge::GetBezelFace
}\label{wxgaugegetbezelface
}
105 \constfunc{int
}{GetBezelFace
}{\void}
107 Returns the width of the
3D bezel face.
111 This method is not implemented (returns $
0$) for most platforms.
115 \helpref{wxGauge::SetBezelFace
}{wxgaugesetbezelface
}
118 \membersection{wxGauge::GetRange
}\label{wxgaugegetrange
}
120 \constfunc{int
}{GetRange
}{\void}
122 Returns the maximum position of the gauge.
126 \helpref{wxGauge::SetRange
}{wxgaugesetrange
}
129 \membersection{wxGauge::GetShadowWidth
}\label{wxgaugegetshadowwidth
}
131 \constfunc{int
}{GetShadowWidth
}{\void}
133 Returns the
3D shadow margin width.
137 This method is not implemented (returns $
0$) for most platforms.
141 \helpref{wxGauge::SetShadowWidth
}{wxgaugesetshadowwidth
}
144 \membersection{wxGauge::GetValue
}\label{wxgaugegetvalue
}
146 \constfunc{int
}{GetValue
}{\void}
148 Returns the current position of the gauge.
152 \helpref{wxGauge::SetValue
}{wxgaugesetvalue
}
155 \membersection{wxGauge::IsVertical
}\label{wxgaugeisvertical
}
157 \constfunc{bool
}{IsVertical
}{\void}
159 Returns
\true if the gauge is vertical (has
\texttt{wxGA
\_VERTICAL} style) and
163 \membersection{wxGauge::SetBezelFace
}\label{wxgaugesetbezelface
}
165 \func{void
}{SetBezelFace
}{\param{int
}{width
}}
167 Sets the
3D bezel face width.
171 This method is not implemented (doesn't do anything) for most platforms.
175 \helpref{wxGauge::GetBezelFace
}{wxgaugegetbezelface
}
178 \membersection{wxGauge::SetRange
}\label{wxgaugesetrange
}
180 \func{void
}{SetRange
}{\param{int
}{range
}}
182 Sets the range (maximum value) of the gauge.
183 This function makes the gauge switch to determinate mode, if it's not already.
187 \helpref{wxGauge::GetRange
}{wxgaugegetrange
}
190 \membersection{wxGauge::SetShadowWidth
}\label{wxgaugesetshadowwidth
}
192 \func{void
}{SetShadowWidth
}{\param{int
}{width
}}
194 Sets the
3D shadow width.
198 This method is not implemented (doesn't do anything) for most platforms.
201 \membersection{wxGauge::SetValue
}\label{wxgaugesetvalue
}
203 \func{void
}{SetValue
}{\param{int
}{pos
}}
205 Sets the position of the gauge. The
\arg{pos
} must be between $
0$ and the gauge
206 range as returned by
\helpref{GetRange
}{wxgaugegetrange
}, inclusive.
208 This function makes the gauge switch to determinate mode, if it was in
209 indeterminate mode before.
211 \wxheading{Parameters
}
213 \docparam{pos
}{Position for the gauge level.
}
217 \helpref{wxGauge::GetValue
}{wxgaugegetvalue
}
220 \membersection{wxGauge::Pulse
}\label{wxgaugepulse
}
222 \func{void
}{Pulse
}{\void}
224 Switch the gauge to indeterminate mode (if required) and makes the gauge move
225 a bit to indicate the user that some progress has been made.
227 Note that after calling this function the value returned by
\helpref{GetValue
}{wxgaugegetvalue
}
228 is undefined and thus you need to explicitely call
\helpref{SetValue
}{wxgaugesetvalue
} if you
229 want to restore the determinate mode.