X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8eaaeb23796c69ea0f67cbd48fc5f667d9823d0..cafc76a4bbbcb59f1c48d9c8f592c671238ffb51:/include/wx/app.h diff --git a/include/wx/app.h b/include/wx/app.h index c95c47751c..3698f65a09 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -170,11 +170,13 @@ public: #if wxUSE_CMDLINE_PARSER // this one is called from OnInit() to add all supported options - // to the given parser + // to the given parser (don't forget to call the base class version if you + // override it!) virtual void OnInitCmdLine(wxCmdLineParser& parser); // called after successfully parsing the command line, return TRUE - // to continue and FALSE to exit + // to continue and FALSE to exit (don't forget to call the base class + // version if you override it!) virtual bool OnCmdLineParsed(wxCmdLineParser& parser); // called if "--help" option was specified, return TRUE to continue @@ -255,12 +257,12 @@ public: 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 // options of the library and abort if it doesn't - static bool CheckBuildOptions(const wxBuildOptions& buildOptions); - + static bool CheckBuildOptions(const char *optionsSignature, + const char *componentName); // implementation only from now on // ------------------------------- @@ -346,6 +348,9 @@ public: // Override: rarely in GUI applications, always in console ones. virtual int OnRun(); + // a matching function for OnInit() + virtual int OnExit(); + // very last clean up function // // Override: very rarely @@ -457,6 +462,13 @@ public: int GetPrintMode() const { return wxPRINT_POSTSCRIPT; } + // command line parsing (GUI-specific) + // ------------------------------------------------------------------------ + + virtual bool OnCmdLineParsed(wxCmdLineParser& parser); + virtual void OnInitCmdLine(wxCmdLineParser& parser); + + // miscellaneous other stuff // ------------------------------------------------------------------------ @@ -583,8 +595,7 @@ public: int main(int argc, char **argv) { return wxEntry(argc, argv); } #elif defined(__WXMSW__) && defined(WXUSINGDLL) // we need HINSTANCE declaration to define WinMain() - #include - #include "wx/msw/winundef.h" + #include "wx/msw/wrapwin.h" #define IMPLEMENT_WXWIN_MAIN \ extern int wxEntry(HINSTANCE hInstance, \ @@ -617,7 +628,8 @@ public: #define IMPLEMENT_APP_NO_MAIN(appname) \ wxAppConsole *wxCreateApp() \ { \ - wxAppConsole::CheckBuildOptions(wxBuildOptions()); \ + wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \ + "your program"); \ return new appname; \ } \ wxAppInitializer \