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
}
32 \helpref{wxCore
}{librarieslist
}
34 \wxheading{Window styles
}
37 \begin{twocollist
}\itemsep=
0pt
38 \twocolitem{\windowstyle{wxGA
\_HORIZONTAL}}{Creates a horizontal gauge.
}
39 \twocolitem{\windowstyle{wxGA
\_VERTICAL}}{Creates a vertical gauge.
}
40 %\twocolitem{\windowstyle{wxGA\_PROGRESSBAR}}{Obsolete, doesn't do anything any more}
41 \twocolitem{\windowstyle{wxGA
\_SMOOTH}}{Creates smooth progress bar with one pixel wide update step (not supported by all platforms).
}
44 See also
\helpref{window styles overview
}{windowstyles
}.
46 \wxheading{Event handling
}
48 wxGauge is read-only so generates no events.
52 \helpref{wxSlider
}{wxslider
},
\helpref{wxScrollBar
}{wxscrollbar
}
54 \latexignore{\rtfignore{\wxheading{Members
}}}
57 \membersection{wxGauge::wxGauge
}\label{wxgaugector
}
59 \func{}{wxGauge
}{\void}
63 \func{}{wxGauge
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
64 \param{int
}{ range
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
65 \param{long
}{ style = wxGA
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``gauge"
}}
67 Constructor, creating and showing a gauge.
69 \wxheading{Parameters
}
71 \docparam{parent
}{Window parent.
}
73 \docparam{id
}{Window identifier.
}
75 \docparam{range
}{Integer range (maximum value) of the gauge. It is ignored when the gauge is used in indeterminate mode.
}
77 \docparam{pos
}{Window position.
}
79 \docparam{size
}{Window size.
}
81 \docparam{style
}{Gauge style. See
\helpref{wxGauge
}{wxgauge
}.
}
83 \docparam{name
}{Window name.
}
87 \helpref{wxGauge::Create
}{wxgaugecreate
}
90 \membersection{wxGauge::
\destruct{wxGauge
}}\label{wxgaugedtor
}
92 \func{}{\destruct{wxGauge
}}{\void}
94 Destructor, destroying the gauge.
97 \membersection{wxGauge::Create
}\label{wxgaugecreate
}
99 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
100 \param{int
}{ range
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
101 \param{long
}{ style = wxGA
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``gauge"
}}
103 Creates the gauge for two-step construction. See
\helpref{wxGauge::wxGauge
}{wxgaugector
}\rtfsp
107 \membersection{wxGauge::GetBezelFace
}\label{wxgaugegetbezelface
}
109 \constfunc{int
}{GetBezelFace
}{\void}
111 Returns the width of the
3D bezel face.
115 This method is not implemented (returns $
0$) for most platforms.
119 \helpref{wxGauge::SetBezelFace
}{wxgaugesetbezelface
}
122 \membersection{wxGauge::GetRange
}\label{wxgaugegetrange
}
124 \constfunc{int
}{GetRange
}{\void}
126 Returns the maximum position of the gauge.
130 \helpref{wxGauge::SetRange
}{wxgaugesetrange
}
133 \membersection{wxGauge::GetShadowWidth
}\label{wxgaugegetshadowwidth
}
135 \constfunc{int
}{GetShadowWidth
}{\void}
137 Returns the
3D shadow margin width.
141 This method is not implemented (returns $
0$) for most platforms.
145 \helpref{wxGauge::SetShadowWidth
}{wxgaugesetshadowwidth
}
148 \membersection{wxGauge::GetValue
}\label{wxgaugegetvalue
}
150 \constfunc{int
}{GetValue
}{\void}
152 Returns the current position of the gauge.
156 \helpref{wxGauge::SetValue
}{wxgaugesetvalue
}
159 \membersection{wxGauge::IsVertical
}\label{wxgaugeisvertical
}
161 \constfunc{bool
}{IsVertical
}{\void}
163 Returns
\true if the gauge is vertical (has
\texttt{wxGA
\_VERTICAL} style) and
167 \membersection{wxGauge::SetBezelFace
}\label{wxgaugesetbezelface
}
169 \func{void
}{SetBezelFace
}{\param{int
}{width
}}
171 Sets the
3D bezel face width.
175 This method is not implemented (doesn't do anything) for most platforms.
179 \helpref{wxGauge::GetBezelFace
}{wxgaugegetbezelface
}
182 \membersection{wxGauge::SetRange
}\label{wxgaugesetrange
}
184 \func{void
}{SetRange
}{\param{int
}{range
}}
186 Sets the range (maximum value) of the gauge.
187 This function makes the gauge switch to determinate mode, if it's not already.
191 \helpref{wxGauge::GetRange
}{wxgaugegetrange
}
194 \membersection{wxGauge::SetShadowWidth
}\label{wxgaugesetshadowwidth
}
196 \func{void
}{SetShadowWidth
}{\param{int
}{width
}}
198 Sets the
3D shadow width.
202 This method is not implemented (doesn't do anything) for most platforms.
205 \membersection{wxGauge::SetValue
}\label{wxgaugesetvalue
}
207 \func{void
}{SetValue
}{\param{int
}{pos
}}
209 Sets the position of the gauge. The
\arg{pos
} must be between $
0$ and the gauge
210 range as returned by
\helpref{GetRange
}{wxgaugegetrange
}, inclusive.
212 This function makes the gauge switch to determinate mode, if it was in
213 indeterminate mode before.
215 \wxheading{Parameters
}
217 \docparam{pos
}{Position for the gauge level.
}
221 \helpref{wxGauge::GetValue
}{wxgaugegetvalue
}
224 \membersection{wxGauge::Pulse
}\label{wxgaugepulse
}
226 \func{void
}{Pulse
}{\void}
228 Switch the gauge to indeterminate mode (if required) and makes the gauge move
229 a bit to indicate the user that some progress has been made.
231 Note that after calling this function the value returned by
\helpref{GetValue
}{wxgaugegetvalue
}
232 is undefined and thus you need to explicitely call
\helpref{SetValue
}{wxgaugesetvalue
} if you
233 want to restore the determinate mode.