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