X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d910ac1fcebc69cda4c0b85278af09a55c9a611..328bfc22243e3d4672ddf626db4f78e4269c7275:/src/common/appcmn.cpp?ds=sidebyside diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 18d3dcafff..0b7b957dc3 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -36,10 +36,60 @@ #include "wx/thread.h" #include "wx/confbase.h" +#ifdef __WXUNIVERSAL__ + #include "wx/univ/theme.h" +#endif // __WXUNIVERSAL__ + // =========================================================================== // implementation // =========================================================================== +wxAppBase::wxAppBase() +{ + wxTheApp = (wxApp *)this; + + // VZ: what's this? is it obsolete? + m_wantDebugOutput = FALSE; + +#if wxUSE_GUI + m_topWindow = (wxWindow *)NULL; + m_useBestVisual = FALSE; + m_exitOnFrameDelete = TRUE; + m_isActive = TRUE; +#endif // wxUSE_GUI +} + +// ---------------------------------------------------------------------------- +// initialization and termination +// ---------------------------------------------------------------------------- + +#if wxUSE_GUI +bool wxAppBase::OnInitGui() +{ +#ifdef __WXUNIVERSAL__ + if ( !wxTheme::CreateDefault() ) + return FALSE; +#endif // __WXUNIVERSAL__ + + return TRUE; +} +#endif // wxUSE_GUI + +int wxAppBase::OnExit() +{ +#if wxUSE_CONFIG + // delete the config object if any (don't use Get() here, but Set() + // because Get() could create a new config object) + delete wxConfigBase::Set((wxConfigBase *) NULL); +#endif // wxUSE_CONFIG + +#ifdef __WXUNIVERSAL__ + delete wxTheme::Set(NULL); +#endif // __WXUNIVERSAL__ + + return 0; +} + // --------------------------------------------------------------------------- // wxAppBase // ---------------------------------------------------------------------------- @@ -74,13 +124,15 @@ void wxAppBase::ProcessPendingEvents() wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); } -int wxAppBase::OnExit() -{ -#if wxUSE_CONFIG - // delete the config object if any (don't use Get() here, but Set() - // because Get() could create a new config object) - delete wxConfigBase::Set((wxConfigBase *) NULL); -#endif // wxUSE_CONFIG +// ---------------------------------------------------------------------------- +// misc +// ---------------------------------------------------------------------------- - return 0; +#if wxUSE_GUI + +void wxAppBase::SetActive(bool active, wxWindow * WXUNUSED(lastFocus)) +{ + m_isActive = active; } + +#endif // wxUSE_GUI