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