1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxIdleEvent}}\label{wxidleevent}
|
|
|
|
|
2005-08-23 17:37:38 -04:00
|
|
|
This class is used for idle events, which are generated when the system becomes
|
|
|
|
idle. Note that, unless you do something specifically, the idle events are not
|
|
|
|
sent if the system remains idle once it has become it, e.g. only a single idle
|
|
|
|
event will be generated until something else resulting in more normal events
|
|
|
|
happens and only then is the next idle event sent again. If you need to ensure
|
|
|
|
a continuous stream of idle events, you can either use
|
|
|
|
\helpref{RequestMore}{wxidleeventrequestmore} method in your handler or call
|
|
|
|
\helpref{wxWakeUpIdle}{wxwakeupidle} periodically (for example from timer
|
|
|
|
event), but note that both of these approaches (and especially the first one)
|
|
|
|
increase the system load and so should be avoided if possible.
|
|
|
|
|
|
|
|
By default, idle events are sent to all windows (and also
|
|
|
|
\helpref{wxApp}{wxapp}, as usual). If this is causing a significant
|
2003-07-09 06:15:21 -04:00
|
|
|
overhead in your application, you can call \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode} with
|
|
|
|
the value wxIDLE\_PROCESS\_SPECIFIED, and set the wxWS\_EX\_PROCESS\_IDLE extra
|
|
|
|
window style for every window which should receive idle events.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxEvent}{wxevent}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/event.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Event table macros}
|
|
|
|
|
|
|
|
To process an idle event, use this event handler macro to direct input to a member
|
|
|
|
function that takes a wxIdleEvent argument.
|
|
|
|
|
|
|
|
\twocolwidtha{7cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{{\bf EVT\_IDLE(func)}}{Process a wxEVT\_IDLE event.}
|
|
|
|
\end{twocollist}%
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2003-07-09 06:15:21 -04:00
|
|
|
\helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxUpdateUIEvent}{wxupdateuievent},
|
|
|
|
\helpref{wxWindow::OnInternalIdle}{wxwindowoninternalidle}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-29 07:25:34 -04:00
|
|
|
\membersection{wxIdleEvent::wxIdleEvent}\label{wxidleeventctor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{wxIdleEvent}{\void}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
2003-07-09 06:15:21 -04:00
|
|
|
\membersection{wxIdleEvent::CanSend}\label{wxidleeventcansend}
|
|
|
|
|
|
|
|
\func{static bool}{CanSend}{\param{wxWindow*}{ window}}
|
|
|
|
|
|
|
|
Returns {\tt true} if it is appropriate to send idle events to
|
|
|
|
this window.
|
|
|
|
|
|
|
|
This function looks at the mode used (see \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode}),
|
|
|
|
and the wxWS\_EX\_PROCESS\_IDLE style in {\it window} to determine whether idle events should be sent to
|
|
|
|
this window now. By default this will always return {\tt true} because
|
|
|
|
the update mode is initially wxIDLE\_PROCESS\_ALL. You can change the mode
|
|
|
|
to only send idle events to windows with the wxWS\_EX\_PROCESS\_IDLE extra window style set.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2003-08-15 12:17:40 -04:00
|
|
|
\helpref{wxIdleEvent::SetMode}{wxidleeventsetmode}
|
2003-07-09 06:15:21 -04:00
|
|
|
|
|
|
|
\membersection{wxIdleEvent::GetMode}\label{wxidleeventgetmode}
|
|
|
|
|
|
|
|
\func{static wxIdleMode}{GetMode}{\void}
|
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
Static function returning a value specifying how wxWidgets
|
2003-07-09 06:15:21 -04:00
|
|
|
will send idle events: to all windows, or only to those which specify that they
|
|
|
|
will process the events.
|
|
|
|
|
|
|
|
See \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode}.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxIdleEvent::RequestMore}\label{wxidleeventrequestmore}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{void}{RequestMore}{\param{bool}{ needMore = true}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
Tells wxWidgets that more processing is required. This function can be called by an OnIdle
|
1998-05-20 10:25:30 -04:00
|
|
|
handler for a window or window event handler to indicate that wxApp::OnIdle should
|
|
|
|
forward the OnIdle event once more to the application windows. If no window calls this function
|
|
|
|
during OnIdle, then the application will remain in a passive event loop (not calling OnIdle) until a
|
|
|
|
new event is posted to the application by the windowing system.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2001-08-29 15:39:14 -04:00
|
|
|
\helpref{wxIdleEvent::MoreRequested}{wxidleeventmorerequested}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxIdleEvent::MoreRequested}\label{wxidleeventmorerequested}
|
|
|
|
|
|
|
|
\constfunc{bool}{MoreRequested}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the OnIdle function processing this event requested more processing time.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
2001-08-29 15:39:14 -04:00
|
|
|
\helpref{wxIdleEvent::RequestMore}{wxidleeventrequestmore}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2003-07-09 06:15:21 -04:00
|
|
|
\membersection{wxIdleEvent::SetMode}\label{wxidleeventsetmode}
|
|
|
|
|
|
|
|
\func{static void}{SetMode}{\param{wxIdleMode }{mode}}
|
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
Static function for specifying how wxWidgets will send idle events: to
|
2003-07-09 06:15:21 -04:00
|
|
|
all windows, or only to those which specify that they
|
|
|
|
will process the events.
|
|
|
|
|
|
|
|
{\it mode} can be one of the following values.
|
|
|
|
The default is wxIDLE\_PROCESS\_ALL.
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
enum wxIdleMode
|
|
|
|
{
|
|
|
|
// Send idle events to all windows
|
|
|
|
wxIDLE_PROCESS_ALL,
|
|
|
|
|
|
|
|
// Send idle events to windows that have
|
|
|
|
// the wxWS_EX_PROCESS_IDLE flag specified
|
|
|
|
wxIDLE_PROCESS_SPECIFIED
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|