]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/idleevt.tex
wxRichTextAttr does not exist anymore - document instead wxTextAttr
[wxWidgets.git] / docs / latex / wx / idleevt.tex
CommitLineData
a660d684
KB
1\section{\class{wxIdleEvent}}\label{wxidleevent}
2
09f7f79f
VZ
3This class is used for idle events, which are generated when the system becomes
4idle. Note that, unless you do something specifically, the idle events are not
5sent if the system remains idle once it has become it, e.g. only a single idle
6event will be generated until something else resulting in more normal events
7happens and only then is the next idle event sent again. If you need to ensure
8a continuous stream of idle events, you can either use
9\helpref{RequestMore}{wxidleeventrequestmore} method in your handler or call
10\helpref{wxWakeUpIdle}{wxwakeupidle} periodically (for example from timer
11event), but note that both of these approaches (and especially the first one)
12increase the system load and so should be avoided if possible.
13
14By default, idle events are sent to all windows (and also
15\helpref{wxApp}{wxapp}, as usual). If this is causing a significant
e39af974
JS
16overhead in your application, you can call \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode} with
17the value wxIDLE\_PROCESS\_SPECIFIED, and set the wxWS\_EX\_PROCESS\_IDLE extra
18window style for every window which should receive idle events.
19
a660d684
KB
20\wxheading{Derived from}
21
22\helpref{wxEvent}{wxevent}\\
23\helpref{wxObject}{wxobject}
24
954b8ae6
JS
25\wxheading{Include files}
26
27<wx/event.h>
28
a7af285d
VZ
29\wxheading{Library}
30
31\helpref{wxBase}{librarieslist}
32
a660d684
KB
33\wxheading{Event table macros}
34
35To process an idle event, use this event handler macro to direct input to a member
36function that takes a wxIdleEvent argument.
37
38\twocolwidtha{7cm}
39\begin{twocollist}\itemsep=0pt
40\twocolitem{{\bf EVT\_IDLE(func)}}{Process a wxEVT\_IDLE event.}
41\end{twocollist}%
42
a660d684
KB
43\wxheading{See also}
44
e39af974
JS
45\helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxUpdateUIEvent}{wxupdateuievent},
46\helpref{wxWindow::OnInternalIdle}{wxwindowoninternalidle}
a660d684
KB
47
48\latexignore{\rtfignore{\wxheading{Members}}}
49
f0e8a2d0 50\membersection{wxIdleEvent::wxIdleEvent}\label{wxidleeventctor}
a660d684
KB
51
52\func{}{wxIdleEvent}{\void}
53
54Constructor.
55
e39af974
JS
56\membersection{wxIdleEvent::CanSend}\label{wxidleeventcansend}
57
58\func{static bool}{CanSend}{\param{wxWindow*}{ window}}
59
60Returns {\tt true} if it is appropriate to send idle events to
61this window.
62
63This function looks at the mode used (see \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode}),
64and the wxWS\_EX\_PROCESS\_IDLE style in {\it window} to determine whether idle events should be sent to
65this window now. By default this will always return {\tt true} because
66the update mode is initially wxIDLE\_PROCESS\_ALL. You can change the mode
67to only send idle events to windows with the wxWS\_EX\_PROCESS\_IDLE extra window style set.
68
69\wxheading{See also}
70
684761db 71\helpref{wxIdleEvent::SetMode}{wxidleeventsetmode}
e39af974
JS
72
73\membersection{wxIdleEvent::GetMode}\label{wxidleeventgetmode}
74
75\func{static wxIdleMode}{GetMode}{\void}
76
fc2171bd 77Static function returning a value specifying how wxWidgets
e39af974
JS
78will send idle events: to all windows, or only to those which specify that they
79will process the events.
80
81See \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode}.
82
a660d684
KB
83\membersection{wxIdleEvent::RequestMore}\label{wxidleeventrequestmore}
84
cc81d32f 85\func{void}{RequestMore}{\param{bool}{ needMore = true}}
a660d684 86
fc2171bd 87Tells wxWidgets that more processing is required. This function can be called by an OnIdle
a660d684
KB
88handler for a window or window event handler to indicate that wxApp::OnIdle should
89forward the OnIdle event once more to the application windows. If no window calls this function
90during OnIdle, then the application will remain in a passive event loop (not calling OnIdle) until a
91new event is posted to the application by the windowing system.
92
93\wxheading{See also}
94
4d5a0f67 95\helpref{wxIdleEvent::MoreRequested}{wxidleeventmorerequested}
a660d684
KB
96
97\membersection{wxIdleEvent::MoreRequested}\label{wxidleeventmorerequested}
98
99\constfunc{bool}{MoreRequested}{\void}
100
cc81d32f 101Returns true if the OnIdle function processing this event requested more processing time.
a660d684
KB
102
103\wxheading{See also}
104
4d5a0f67 105\helpref{wxIdleEvent::RequestMore}{wxidleeventrequestmore}
a660d684 106
e39af974
JS
107\membersection{wxIdleEvent::SetMode}\label{wxidleeventsetmode}
108
109\func{static void}{SetMode}{\param{wxIdleMode }{mode}}
110
fc2171bd 111Static function for specifying how wxWidgets will send idle events: to
e39af974
JS
112all windows, or only to those which specify that they
113will process the events.
114
115{\it mode} can be one of the following values.
116The default is wxIDLE\_PROCESS\_ALL.
117
118\begin{verbatim}
119enum wxIdleMode
120{
121 // Send idle events to all windows
122 wxIDLE_PROCESS_ALL,
123
124 // Send idle events to windows that have
125 // the wxWS_EX_PROCESS_IDLE flag specified
126 wxIDLE_PROCESS_SPECIFIED
127};
128\end{verbatim}
129