Applied patch [ 1412216 ] non-themed fallback support for other wxNotebook orientation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-02-11 15:41:40 +00:00
parent 4496eadc93
commit 7cc1ad299f
2 changed files with 27 additions and 13 deletions

View File

@@ -275,19 +275,16 @@ bool wxNotebook::Create(wxWindow *parent,
style |= wxBORDER_SUNKEN;
#endif
// 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
#if !wxUSE_UXTHEME
// ComCtl32 notebook tabs simply don't work unless they're on top if we have uxtheme, we can
// work around it later (after control creation), but if we don't have uxtheme, we have to clear
// those styles
const int verComCtl32 = wxApp::GetComCtl32Version();
if ( verComCtl32 == 600 )
{
// check if we use themes at all -- if we don't, we're still ok
#if wxUSE_UXTHEME
if ( wxUxThemeEngine::GetIfActive() )
#endif
{
style &= ~(wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT);
}
style &= ~(wxNB_BOTTOM | wxNB_LEFT | wxNB_RIGHT);
}
#endif //wxUSE_UXTHEME
LPCTSTR className = WC_TABCONTROL;
@@ -348,6 +345,22 @@ bool wxNotebook::Create(wxWindow *parent,
// create backing store
UpdateBgBrush();
}
// comctl32.dll 6.0 doesn't support non-top tabs with visual styles (the
// control is simply not rendered correctly), so we disable themes
// if possible, otherwise we simply clear the styles.
// It's probably not possible to have UXTHEME without ComCtl32 6 or better, but lets
// check it anyway.
const int verComCtl32 = wxApp::GetComCtl32Version();
if ( verComCtl32 == 600 )
{
// check if we use themes at all -- if we don't, we're still okay
if ( wxUxThemeEngine::GetIfActive() && (style & (wxNB_BOTTOM|wxNB_LEFT|wxNB_RIGHT)))
{
wxUxThemeEngine::GetIfActive()->SetWindowTheme((HWND)this->GetHandle(), L"", L"");
SetBackgroundColour(GetThemeBackgroundColour()); //correct the background color for the new non-themed control
}
}
#endif // wxUSE_UXTHEME
// Undocumented hack to get flat notebook style