From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 24 Nov 2004 21:54:00 +0000 (+0000)
Subject: don't disable non top tabs if visual themes are not used
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/df10208f26d2659e5995fd00debeb4eaa11174cc?ds=inline

don't disable non top tabs if visual themes are not used


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

diff --git a/docs/latex/wx/notebook.tex b/docs/latex/wx/notebook.tex
index 556e3ffe20..5e1bea62b8 100644
--- a/docs/latex/wx/notebook.tex
+++ b/docs/latex/wx/notebook.tex
@@ -24,14 +24,17 @@ managed by wxNotebook.
 \twocolwidtha{5cm}
 \begin{twocollist}\itemsep=0pt
 
-\twocolitem{\windowstyle{wxNB\_LEFT}}{Place tabs on the left side. Not supported under Windows XP.}
-\twocolitem{\windowstyle{wxNB\_RIGHT}}{Place tabs on the right side. Not supported under Windows XP.}
-\twocolitem{\windowstyle{wxNB\_BOTTOM}}{Place tabs under instead of above the notebook pages. Not supported under Windows XP.}
+\twocolitem{\windowstyle{wxNB\_LEFT}}{Place tabs on the left side.}
+\twocolitem{\windowstyle{wxNB\_RIGHT}}{Place tabs on the right side.}
+\twocolitem{\windowstyle{wxNB\_BOTTOM}}{Place tabs under instead of above the notebook pages.}
 \twocolitem{\windowstyle{wxNB\_FIXEDWIDTH}}{(Windows only) All tabs will have same width.}
 \twocolitem{\windowstyle{wxNB\_MULTILINE}}{(Windows only) There can be several rows of tabs.}
 
 \end{twocollist}
 
+The styles \texttt{wxNB\_LEFT}, \texttt{RIGHT} and \texttt{BOTTOM} are not
+supported under Microsoft Windows XP when using visual themes.
+
 See also \helpref{window styles overview}{windowstyles}.
 
 \input noteevt.inc
diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp
index b060534c71..f8896e0cc1 100644
--- a/src/msw/notebook.cpp
+++ b/src/msw/notebook.cpp
@@ -33,7 +33,6 @@
 #include  "wx/event.h"
 #include  "wx/control.h"
 #include  "wx/notebook.h"
-#include  "wx/sysopt.h"
 #include  "wx/app.h"
 
 #include  "wx/msw/private.h"
@@ -244,21 +243,18 @@ bool wxNotebook::Create(wxWindow *parent,
                         long style,
                         const wxString& name)
 {
-    // some versions of comctl32.dll 6.0 included with Windows XP don't
-    // support non-top tabs (the control is simply not rendered correctly) but
-    // we can't detect which ones, so be pessimistic by default and disable non
-    // top tabs under XP but allow the user to override this by using a special
-    // system option
-    bool nonTopTabsOk = wxSystemOptions::GetOptionInt(_T("msw.xp-tab-ok")) != 0;
-    if ( !nonTopTabsOk )
+    // comctl32.dll 6.0 doesn't support non-top tabs with visual styles (the
+    // control is simply not rendered correctly), so disable them in this case
+    const int verComCtl32 = wxApp::GetComCtl32Version();
+    if ( verComCtl32 == 600 )
     {
-        int verComCtl32 = wxApp::GetComCtl32Version();
-        nonTopTabsOk = verComCtl32 < 470 || verComCtl32 >= 600;
-    }
-
-    if ( !nonTopTabsOk )
-    {
-        style &= ~(wxNB_BOTTOM | wxNB_LEFT | wxNB_RIGHT);
+        // check if we use themes at all -- if we don't, we're still ok
+#if wxUSE_UXTHEME
+        if ( wxUxThemeEngine::GetIfActive() )
+#endif
+        {
+            style &= ~(wxNB_BOTTOM | wxNB_LEFT | wxNB_RIGHT);
+        }
     }
 
     if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL,