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