X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec38d07d0343b3fc5af03becd17ce798b96e05db..c602c59b6e623d7775c16ce6412b64b34dc5dd94:/interface/wx/app.h diff --git a/interface/wx/app.h b/interface/wx/app.h index f664be76f9..4053532457 100644 --- a/interface/wx/app.h +++ b/interface/wx/app.h @@ -114,6 +114,65 @@ public: //@} + /** + @name Pending events + + Pending events are handled by wxAppConsole rather than wxEventLoopBase + to allow queuing of events even when there's no event loop + (e.g. in wxAppConsole::OnInit). + */ + //@{ + + /** + Process all pending events; it is necessary to call this function to + process events posted with wxEvtHandler::QueueEvent or wxEvtHandler::AddPendingEvent. + + This happens during each event loop iteration (see wxEventLoopBase) in GUI mode but + it may be also called directly. + + Note that this function does not only process the pending events for the wxApp object + itself (which derives from wxEvtHandler) but also the pending events for @e any + event handler of this application. + + This function will immediately return and do nothing if SuspendProcessingOfPendingEvents() + was called. + */ + virtual void ProcessPendingEvents(); + + /** + Deletes the pending events of all wxEvtHandlers of this application. + + See wxEvtHandler::DeletePendingEvents() for warnings about deleting the pending + events. + */ + void DeletePendingEvents(); + + /** + Returns @true if there are pending events on the internal pending event list. + + Whenever wxEvtHandler::QueueEvent or wxEvtHandler::AddPendingEvent() are + called (not only for wxApp itself, but for any event handler of the application!), + the internal wxApp's list of handlers with pending events is updated and this + function will return true. + */ + bool HasPendingEvents() const; + + /** + Temporary suspends processing of the pending events. + + @see ResumeProcessingOfPendingEvents() + */ + void SuspendProcessingOfPendingEvents(); + + /** + Resume processing of the pending events previously stopped because of a + call to SuspendProcessingOfPendingEvents(). + */ + void ResumeProcessingOfPendingEvents(); + + //@} + + /** Allows external code to modify global ::wxTheApp, but you should really know what you're doing if you call it. @@ -153,7 +212,7 @@ public: Called in response of an "open-application" Apple event. Override this to create a new document in your app. - @onlyfor{wxmac} + @onlyfor{wxosx} */ virtual void MacNewFile(); @@ -164,28 +223,28 @@ public: user double clicked on it or if the document file was dropped on either the running application or the application icon in Finder. - @onlyfor{wxmac} + @onlyfor{wxosx} */ virtual void MacOpenFile(const wxString& fileName); /** Called in response of a "get-url" Apple event. - @onlyfor{wxmac} + @onlyfor{wxosx} */ virtual void MacOpenURL(const wxString& url); /** Called in response of a "print-document" Apple event. - @onlyfor{wxmac} + @onlyfor{wxosx} */ virtual void MacPrintFile(const wxString& fileName); /** Called in response of a "reopen-application" Apple event. - @onlyfor{wxmac} + @onlyfor{wxosx} */ virtual void MacReopenApp(); @@ -269,12 +328,16 @@ public: Note that this function is called whenever an event loop is activated; you may want to use wxEventLoopBase::IsMain() to perform initialization specific for the app's main event loop. + + @see OnEventLoopExit() */ virtual void OnEventLoopEnter(wxEventLoopBase* loop); /** Called by wxEventLoopBase::OnExit() for each event loop which is exited. + + @see OnEventLoopEnter() */ virtual void OnEventLoopExit(wxEventLoopBase* loop);