]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/app.h
document wxProgressDialog::Update(maximumValue) behaviour and warn the user that...
[wxWidgets.git] / interface / wx / app.h
index a67a414d695f30b8d46999b962e045b809e64a89..9d358c7473d131a69679b6dc12a19b17bf780ae8 100644 (file)
@@ -91,6 +91,14 @@ public:
     */
     virtual int FilterEvent(wxEvent& event);
 
+    /**
+        Returns the main event loop instance, i.e. the event loop which is started
+        by OnRun() and which dispatches all events sent from the native toolkit
+        to the application (except when new event loops are temporarily set-up).
+        The returned value maybe @NULL. Put initialization code which needs a
+        non-@NULL main event loop into OnEventLoopEnter().
+    */
+    wxEventLoopBase* GetMainLoop() const;
 
     /**
         This function simply invokes the given method @a func of the specified
@@ -106,6 +114,45 @@ 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 posted events.
+
+        This happens during each event loop iteration in GUI mode but
+        it may be also called directly.
+    */
+    virtual void ProcessPendingEvents();
+
+    /**
+        Returns @true if there are pending events on the internal pending event list.
+    */
+    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.
@@ -254,6 +301,26 @@ public:
     */
     virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
 
+    /**
+        Called by wxEventLoopBase::SetActive(): you can override this function
+        and put here the code which needs an active event loop.
+
+        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);
+
     /**
         This function is called if an unhandled exception occurs inside the main
         application event loop. It can return @true to ignore the exception and to
@@ -493,6 +560,25 @@ public:
     In general, application-wide settings for GUI-only apps are accessible
     from wxApp (or from wxSystemSettings or wxSystemOptions classes).
 
+    @beginEventEmissionTable
+    @event{EVT_QUERY_END_SESSION(func)}
+        Process a query end session event, supplying the member function.
+        See wxCloseEvent.
+    @event{EVT_END_SESSION(func)}
+        Process an end session event, supplying the member function.
+        See wxCloseEvent.
+    @event{EVT_ACTIVATE_APP(func)}
+        Process a @c wxEVT_ACTIVATE_APP event. See wxActivateEvent.
+    @event{EVT_HIBERNATE(func)}
+        Process a hibernate event. See wxActivateEvent.
+    @event{EVT_DIALUP_CONNECTED(func)}
+        A connection with the network was established. See wxDialUpEvent.
+    @event{EVT_DIALUP_DISCONNECTED(func)}
+        The connection with the network was lost. See wxDialUpEvent.
+    @event{EVT_IDLE(func)}
+        Process a @c wxEVT_IDLE event. See wxIdleEvent.
+    @endEventTable
+
     @library{wxbase}
     @category{appmanagement}
 
@@ -514,7 +600,7 @@ public:
 
     /**
         Get display mode that is used use. This is only used in framebuffer
-        wxWin ports (such as wxMGL or wxDFB).
+        wxWidgets ports (such as wxMGL or wxDFB).
     */
     virtual wxVideoMode GetDisplayMode() const;
 
@@ -618,9 +704,8 @@ public:
     virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
 
     /**
-        Set display mode to use. This is only used in framebuffer wxWin
-        ports (such as wxMGL or wxDFB). This method should be called from
-        wxApp::OnInitGui.
+        Set display mode to use. This is only used in framebuffer wxWidgets
+        ports (such as wxMGL or wxDFB).
     */
     virtual bool SetDisplayMode(const wxVideoMode& info);