X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d9c0e97c580cff977d75760dc0d82c5852eec2c..dc134969ef4efd78faccc19fa616d715ab39c5f8:/src/msw/uxtheme.cpp?ds=sidebyside diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp index e41159bad0..4376d2549d 100644 --- a/src/msw/uxtheme.cpp +++ b/src/msw/uxtheme.cpp @@ -1,22 +1,18 @@ /////////////////////////////////////////////////////////////////////////////// // Name: src/msw/uxtheme.cpp // Purpose: implements wxUxThemeEngine class: support for XP themes -// Author: +// Author: John Platts, Vadim Zeitlin // Modified by: // Created: 2003 // RCS-ID: $Id$ -// Copyright: (c) 2003 wxWindows Dev-Team -// License: wxWindows license +// Copyright: (c) 2003 John Platts, Vadim Zeitlin +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ // declarations // ============================================================================ -#ifdef __GNUG__ - #pragma implementation "uxtheme.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -39,10 +35,7 @@ #include "wx/module.h" -#include "wx/msw/wrapwin.h" - #include "wx/msw/uxtheme.h" -#include "wx/msw/private.h" // ============================================================================ // wxUxThemeModule @@ -52,11 +45,11 @@ class wxUxThemeModule : public wxModule { public: - virtual bool OnInit() { return true; } - virtual void OnExit() - { - if ( wxUxThemeEngine::ms_themeEngine ) - { + virtual bool OnInit() { return true; } + virtual void OnExit() + { + if ( wxUxThemeEngine::ms_themeEngine ) + { // this is probably not necessary right now but try to be careful // and avoid the problems which we might have if someone ever // decides to show a message box using the theme engine from @@ -66,12 +59,12 @@ public: wxUxThemeEngine::ms_themeEngine = NULL; wxUxThemeEngine::ms_isThemeEngineAvailable = false; - delete themeEngine; - } - } + delete themeEngine; + } + } - DECLARE_DYNAMIC_CLASS(wxUxThemeModule) + DECLARE_DYNAMIC_CLASS(wxUxThemeModule) }; IMPLEMENT_DYNAMIC_CLASS(wxUxThemeModule, wxModule) @@ -111,6 +104,16 @@ wxUxThemeEngine* wxUxThemeEngine::Get() bool wxUxThemeEngine::Initialize() { + if ( wxApp::GetComCtl32Version() < 600 ) + { + // not using theme-aware comctl32.dll anyhow, don't even try to use + // themes + return false; + } + + // we're prepared to handle the errors + wxLogNull noLog; + if ( !m_dllUxTheme.Load(_T("uxtheme.dll")) ) return false;