X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e40ed8535894eb47af679ad2b08e777c3605dd0..c9cc9a2f3e41341a4c04c67137b58faaeaa55366:/include/wx/app.h?ds=sidebyside diff --git a/include/wx/app.h b/include/wx/app.h index 1a9a083f5e..a4478b6977 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -313,10 +313,15 @@ public: //to the list of the handlers with _delayed_ pending events void DelayPendingEventHandler(wxEvtHandler* toDelay); + // deletes the current pending events + void DeletePendingEvents(); + // wxEventLoop redirections // ------------------------ + // all these functions are forwarded to the corresponding methods of the + // currently active event loop -- and do nothing if there is none virtual bool Pending(); virtual bool Dispatch(); @@ -326,13 +331,19 @@ public: bool Yield(bool onlyIfNeeded = false); virtual void WakeUpIdle(); + + // this method is called by the active event loop when there are no events + // to process + // + // by default it generates the idle events and if you override it in your + // derived class you should call the base class version to ensure that idle + // events are still sent out virtual bool ProcessIdle(); // debugging support // ----------------- -#ifdef __WXDEBUG__ // this function is called when an assert failure occurs, the base class // version does the normal processing (i.e. shows the usual assert failure // dialog box) @@ -352,7 +363,6 @@ public: int line, const wxChar *cond, const wxChar *msg); -#endif // __WXDEBUG__ // check that the wxBuildOptions object (constructed in the application // itself, usually the one from IMPLEMENT_APP() macro) matches the build @@ -420,11 +430,17 @@ protected: // been started yet or has already terminated) wxEventLoopBase *m_mainLoop; + + // pending events management vars: + // the array of the handlers with pending events which needs to be processed // inside ProcessPendingEvents() wxEvtHandlerArray m_handlersWithPendingEvents; - // helper array used by ProcessPendingEvents() + // helper array used by ProcessPendingEvents() to store the event handlers + // which have pending events but of these events none can be processed right now + // (because of a call to wxEventLoop::YieldFor() which asked to selectively process + // pending events) wxEvtHandlerArray m_handlersWithPendingDelayedEvents; #if wxUSE_THREADS @@ -432,6 +448,9 @@ protected: wxCriticalSection m_handlersWithPendingEventsLocker; #endif + // flag modified by Suspend/ResumeProcessingOfPendingEvents() + bool m_bDoPendingEventProcessing; + friend class WXDLLIMPEXP_FWD_BASE wxEvtHandler; // the application object is a singleton anyhow, there is no sense in