]> git.saurik.com Git - wxWidgets.git/commitdiff
Only draw borders if wxSP_3DBORDER specified, as before
authorJulian Smart <julian@anthemion.co.uk>
Fri, 1 Aug 2003 14:12:55 +0000 (14:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 1 Aug 2003 14:12:55 +0000 (14:12 +0000)
Added IsAppThemedEx which _really_ tells you if the app is
themed, and used it in wxRendererNative::GetDefault()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/uxtheme.h
src/generic/splitter.cpp
src/msw/renderer.cpp
src/msw/uxtheme.cpp

index 2518a03bcf10dafba8d52d46cfb6222f9875e7be..da91ed7d0e3957522ac96343bc53984c4a0157c2 100644 (file)
@@ -310,6 +310,10 @@ public:
     wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEPARENTBACKGROUND, DrawThemeParentBackground)
     wxUX_THEME_DECLARE(PFNWXUENABLETHEMING, EnableTheming)
 
+    // This calls IsAppThemed but also checks the commctrl.dll version
+    // for a more reliable answer.
+    bool IsAppThemedEx() ;
+
 private:
     // construcor is private as only Get() can create us and is also trivial as
     // everything really happens in Initialize()
index e4f0ad4b395bf272637ad3a6d9484a881e8d730d..a0e85324980a17aaaeff7c178534a7a3d575042c 100644 (file)
@@ -428,7 +428,8 @@ int wxSplitterWindow::GetBorderSize() const
 // Draw the sash
 void wxSplitterWindow::DrawSash(wxDC& dc)
 {
-    wxRendererNative::Get().DrawSplitterBorder
+    if (HasFlag(wxSP_3DBORDER))
+        wxRendererNative::Get().DrawSplitterBorder
                             (
                                 this,
                                 dc,
index 1421f42fb9e9407ea25b3b1407d7f573b6afd84c..0a9dd2ed81b6e8c5b5cfcffb24a4e7f253ab1ac8 100644 (file)
@@ -84,7 +84,7 @@ private:
 wxRendererNative& wxRendererNative::GetDefault()
 {
     wxUxThemeEngine *themeEngine = wxUxThemeEngine::Get();
-    return themeEngine && themeEngine->IsThemeActive() ? wxRendererXP::Get()
+    return themeEngine && themeEngine->IsAppThemedEx() ? wxRendererXP::Get()
                                                        : wxRendererMSW::Get();
 }
 
index dee239cd43c05712d18bf5bbded0a9269ea2a347..328bb33bf297220b024888f3013240d90e5f241b 100644 (file)
@@ -172,5 +172,21 @@ bool wxUxThemeEngine::Initialize()
     return true;
 }
 
+// This calls IsAppThemed but also checks the commctrl.dll version
+// for a more reliable answer.
+bool wxUxThemeEngine::IsAppThemedEx()
+{
+    static bool g_TestedForTheme = FALSE;
+    static bool g_UseTheme = FALSE;
+    if (!g_TestedForTheme)
+    {
+        int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
+        
+        g_UseTheme = (commCtrlVersion >= 600);
+        g_TestedForTheme = TRUE;
+    }
+    return IsAppThemed() && g_UseTheme;
+}
+
 #endif // wxUSE_UXTHEME