X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c51a665c649f7579fb39e62070cef4f66b3210d..50d4763f1710f6e45ac6af7112d1ce9effe93bc4:/interface/wx/app.h diff --git a/interface/wx/app.h b/interface/wx/app.h index d058e9c0ca..3261fd74aa 100644 --- a/interface/wx/app.h +++ b/interface/wx/app.h @@ -37,7 +37,8 @@ @see @ref overview_app, wxApp, wxAppTraits, wxEventLoopBase */ -class wxAppConsole : public wxEvtHandler +class wxAppConsole : public wxEvtHandler, + public wxEventFilter { protected: /** @@ -81,13 +82,14 @@ public: virtual void ExitMainLoop(); /** + Overridden wxEventFilter method. + This function is called before processing any event and allows the application - to preempt the processing of some events. + to preempt the processing of some events, see wxEventFilter + documentation for more information. - If this method returns -1 the event is processed normally, otherwise either - @true or @false should be returned and the event processing stops immediately - considering that the event had been already processed (for the former return - value) or that it is not going to be processed at all (for the latter one). + wxApp implementation of this method always return -1 indicating that + the event should be processed normally. */ virtual int FilterEvent(wxEvent& event); @@ -221,6 +223,8 @@ public: //@} + bool Yield(bool onlyIfNeeded = false); + /** Allows external code to modify global ::wxTheApp, but you should really know what you're doing if you call it. @@ -250,7 +254,6 @@ public: */ static bool IsMainLoopRunning(); - /** @name Callbacks for application-wide "events" */ @@ -372,7 +375,7 @@ public: /** This function may be called if something fatal happens: an unhandled - exception under Win32 or a a fatal signal under Unix, for example. However, + exception under Win32 or a fatal signal under Unix, for example. However, this will not happen by default: you have to explicitly call wxHandleFatalExceptions() to enable this. @@ -569,7 +572,7 @@ public: Under Windows and Linux/Unix, you should parse the command line arguments and check for files to be opened when starting your - application. Under OS X, you need to override MacOpenFile() + application. Under OS X, you need to override MacOpenFiles() since command line arguments are used differently there. You may use the wxCmdLineParser to parse command line arguments. @@ -632,7 +635,7 @@ public: /** Get display mode that is used use. This is only used in framebuffer - wxWidgets ports (such as wxMGL or wxDFB). + wxWidgets ports such as wxDFB. */ virtual wxVideoMode GetDisplayMode() const; @@ -724,7 +727,7 @@ public: /** Set display mode to use. This is only used in framebuffer wxWidgets - ports (such as wxMGL or wxDFB). + ports such as wxDFB. */ virtual bool SetDisplayMode(const wxVideoMode& info); @@ -802,12 +805,29 @@ public: */ virtual void MacNewFile(); + /** + Called in response of an openFiles message with Cocoa, or an + "open-document" Apple event with Carbon. + + You need to override this method in order to open one or more document + files after the user double clicked on it or if the files and/or + folders were dropped on either the application in the dock or the + application icon in Finder. + + By default this method calls MacOpenFile for each file/folder. + + @onlyfor{wxosx} + + @since 2.9.3 + */ + virtual void MacOpenFiles(const wxArrayString& fileNames); + /** Called in response of an "open-document" Apple event. - You need to override this method in order to open a document file after the - user double clicked on it or if the document file was dropped on either the - running application or the application icon in Finder. + @deprecated + This function is kept mostly for backwards compatibility. Please + override wxApp::MacOpenFiles method instead in any new code. @onlyfor{wxosx} */ @@ -834,17 +854,6 @@ public: */ virtual void MacReopenApp(); - - static long GetMacAboutMenuItemId(); - static long GetMacPreferencesMenuItemId(); - static long GetMacExitMenuItemId(); - static wxString GetMacHelpMenuTitleName(); - - static void SetMacAboutMenuItemId(long val); - static void SetMacPreferencesMenuItemId(long val); - static void SetMacExitMenuItemId(long val); - static void SetMacHelpMenuTitleName(const wxString& val); - //@} };