X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3185abc27836dab3e27221ec60e52fddc984e76b..4cb0e8d05cadea6be3a7bd93f1fea9a9e0df95f0:/include/wx/app.h?ds=sidebyside diff --git a/include/wx/app.h b/include/wx/app.h index 87642e3ecb..965ffaf723 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -22,12 +22,12 @@ #include "wx/cmdargs.h" // for wxCmdLineArgsArray used by wxApp::argv #include "wx/init.h" // we must declare wxEntry() #include "wx/intl.h" // for wxLayoutDirection +#include "wx/log.h" // for wxDISABLE_DEBUG_LOGGING_IN_RELEASE_BUILD() class WXDLLIMPEXP_FWD_BASE wxAppConsole; class WXDLLIMPEXP_FWD_BASE wxAppTraits; class WXDLLIMPEXP_FWD_BASE wxCmdLineParser; class WXDLLIMPEXP_FWD_BASE wxEventLoopBase; -class WXDLLIMPEXP_FWD_BASE wxLog; class WXDLLIMPEXP_FWD_BASE wxMessageOutput; #if wxUSE_GUI @@ -35,6 +35,11 @@ class WXDLLIMPEXP_FWD_BASE wxMessageOutput; class WXDLLIMPEXP_FWD_CORE wxWindow; #endif +// this macro should be used in any main() or equivalent functions defined in wx +#define wxDISABLE_DEBUG_SUPPORT() \ + wxDISABLE_ASSERTS_IN_RELEASE_BUILD(); \ + wxDISABLE_DEBUG_LOGGING_IN_RELEASE_BUILD() + // ---------------------------------------------------------------------------- // typedefs // ---------------------------------------------------------------------------- @@ -136,22 +141,17 @@ public: // be argv[0] // set/get the application name - wxString GetAppName() const - { - return m_appName.empty() ? m_className : m_appName; - } + wxString GetAppName() const; void SetAppName(const wxString& name) { m_appName = name; } // set/get the application display name: the display name is the name // shown to the user in titles, reports, etc while the app name is // used for paths, config, and other places the user doesn't see // - // so the app name could be myapp while display name could be "My App" - wxString GetAppDisplayName() const - { - return m_appDisplayName.empty() ? GetAppName().Capitalize() - : m_appDisplayName; - } + // by default the display name is the same as app name or a capitalized + // version of the program if app name was not set neither but it's + // usually better to set it explicitly to something nicer + wxString GetAppDisplayName() const; void SetAppDisplayName(const wxString& name) { m_appDisplayName = name; } @@ -777,8 +777,13 @@ public: // your compiler really, really wants main() to be in your main program (e.g. // hello.cpp). Now IMPLEMENT_APP should add this code if required. -#define IMPLEMENT_WXWIN_MAIN_CONSOLE \ - int main(int argc, char **argv) { return wxEntry(argc, argv); } +#define IMPLEMENT_WXWIN_MAIN_CONSOLE \ + int main(int argc, char **argv) \ + { \ + wxDISABLE_DEBUG_SUPPORT(); \ + \ + return wxEntry(argc, argv); \ + } // port-specific header could have defined it already in some special way #ifndef IMPLEMENT_WXWIN_MAIN