From 73e90c71379ec6f7d83bdcdf68cc2574ef13a789 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 5 Jun 2003 13:29:52 +0000 Subject: [PATCH] Disable non-standard notebook styles if CommCtl doesn't support them. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 ++ src/msw/notebook.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 5f1df9d6b0..dd3dc20a84 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -240,6 +240,8 @@ wxMSW: enables XP theme engine code, and wxUSE_UXTHEME_AUTO tells wxWindows to use the theme tab colour for control backgrounds. Proper XP theme support is planned for 2.6 +- disable wxNB_RIGHT, wxNB_LEFT, wxNB_BOTTOM notebook styles + if the version of CommCtl doesn't support it (XP) wxMotif: diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index b9944576ff..7af2dbd933 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -32,6 +32,7 @@ #include "wx/event.h" #include "wx/control.h" #include "wx/notebook.h" +#include "wx/app.h" #include "wx/msw/private.h" @@ -158,6 +159,20 @@ bool wxNotebook::Create(wxWindow *parent, long style, const wxString& name) { + // Does ComCtl32 support non-top tabs? + int verComCtl32 = wxApp::GetComCtl32Version(); + if ( verComCtl32 < 470 || verComCtl32 >= 600 ) + { + if (style & wxNB_BOTTOM) + style &= ~wxNB_BOTTOM; + + if (style & wxNB_LEFT) + style &= ~wxNB_LEFT; + + if (style & wxNB_RIGHT) + style &= ~wxNB_RIGHT; + } + // base init if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE;