X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55fd62c1e370bef69657f220ddd591743e842be8..a4ea083bbdf710d3234dcbd2eafb5d0e078f8348:/src/common/appbase.cpp?ds=sidebyside diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 5014ca25df..dba66974cb 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 19.06.2003 (extracted from common/appcmn.cpp) -// RCS-ID: $Id$ // Copyright: (c) 2003 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -256,6 +255,10 @@ int wxAppConsoleBase::OnRun() return MainLoop(); } +void wxAppConsoleBase::OnLaunched() +{ +} + int wxAppConsoleBase::OnExit() { #if wxUSE_CONFIG @@ -304,6 +307,15 @@ wxAppTraits *wxAppConsoleBase::GetTraitsIfExists() return app ? app->GetTraits() : NULL; } +/* static */ +wxAppTraits& wxAppConsoleBase::GetValidTraits() +{ + static wxConsoleAppTraits s_traitsConsole; + wxAppTraits* const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; + + return traits ? *traits : s_traitsConsole; +} + // ---------------------------------------------------------------------------- // wxEventLoop redirection // ---------------------------------------------------------------------------- @@ -312,6 +324,13 @@ int wxAppConsoleBase::MainLoop() { wxEventLoopBaseTiedPtr mainLoop(&m_mainLoop, CreateMainLoop()); +#if defined(__WXOSX__) && wxOSX_USE_COCOA_OR_IPHONE + // OnLaunched called from native app controller +#else + if (wxTheApp) + wxTheApp->OnLaunched(); +#endif + return m_mainLoop ? m_mainLoop->Run() : -1; }