1999-07-10 17:17:24 -04:00
|
|
|
\section{\class{wxBusyInfo}}\label{wxbusyinfo}
|
|
|
|
|
|
|
|
This class makes it easy to tell your user that the program is temporarily busy.
|
|
|
|
Just create a wxBusyInfo object on the stack, and within the current scope,
|
|
|
|
a message window will be shown.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
2001-10-29 09:32:42 -05:00
|
|
|
wxBusyInfo wait("Please wait, working...");
|
1999-07-10 17:17:24 -04:00
|
|
|
|
2001-10-29 09:32:42 -05:00
|
|
|
for (int i = 0; i < 100000; i++)
|
|
|
|
{
|
|
|
|
DoACalculation();
|
|
|
|
}
|
1999-07-10 17:17:24 -04:00
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
It works by creating a window in the constructor,
|
|
|
|
and deleting it in the destructor.
|
|
|
|
|
2001-10-29 09:32:42 -05:00
|
|
|
You may also want to call wxTheApp->Yield() to refresh the window
|
|
|
|
periodically (in case it had been obscured by other windows, for
|
|
|
|
example) like this:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
wxWindowDisabler disableAll;
|
|
|
|
|
|
|
|
wxBusyInfo wait("Please wait, working...");
|
|
|
|
|
|
|
|
for (int i = 0; i < 100000; i++)
|
|
|
|
{
|
|
|
|
DoACalculation();
|
|
|
|
|
|
|
|
if ( !(i % 1000) )
|
|
|
|
wxTheApp->Yield();
|
|
|
|
}
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
but take care to not cause undesirable reentrancies when doing it (see
|
|
|
|
\helpref{wxApp::Yield()}{wxappyield} for more details). The simplest way to do
|
|
|
|
it is to use \helpref{wxWindowDisabler}{wxwindowdisabler} class as illustrated
|
|
|
|
in the above example.
|
|
|
|
|
1999-07-10 17:17:24 -04:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/busyinfo.h>
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxBusyInfo::wxBusyInfo}\label{wxbusyinfoctor}
|
1999-07-10 17:17:24 -04:00
|
|
|
|
2005-02-20 12:06:25 -05:00
|
|
|
\func{}{wxBusyInfo}{\param{const wxString\&}{ msg}, \param{wxWindow* }{parent = NULL}}
|
2001-10-29 09:32:42 -05:00
|
|
|
|
|
|
|
Constructs a busy info window as child of {\it parent} and displays {\it msg}
|
|
|
|
in it.
|
|
|
|
|
|
|
|
{\bf NB:} If {\it parent} is not {\tt NULL} you must ensure that it is not
|
|
|
|
closed while the busy info is shown.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxBusyInfo::\destruct{wxBusyInfo}}\label{wxbusyinfodtor}
|
2001-10-29 09:32:42 -05:00
|
|
|
|
|
|
|
\func{}{\destruct{wxBusyInfo}}{\void}
|
1999-07-10 17:17:24 -04:00
|
|
|
|
2001-10-29 09:32:42 -05:00
|
|
|
Hides and closes the window containing the information text.
|
1999-07-10 17:17:24 -04:00
|
|
|
|