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
This commit is contained in:
Vadim Zeitlin
2004-11-24 21:54:00 +00:00
parent 41bd216844
commit df10208f26
2 changed files with 17 additions and 18 deletions

View File

@@ -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

View File

@@ -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,