Fixed notebook redraw problems when using XP theme with Classic appearance.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -974,10 +974,11 @@ void wxNotebook::ApplyThemeBackground(wxWindow*, const wxColour&)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxUSE_UXTHEME
|
||||
long wxNotebook::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
static bool g_TestedForTheme = false;
|
||||
static bool g_UseTheme = false;
|
||||
static bool g_supportsThemes = false;
|
||||
switch ( nMsg )
|
||||
{
|
||||
case WM_ERASEBKGND:
|
||||
@@ -986,19 +987,25 @@ long wxNotebook::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
|
||||
|
||||
g_UseTheme = (commCtrlVersion >= 600);
|
||||
g_supportsThemes = (commCtrlVersion >= 600);
|
||||
g_TestedForTheme = true;
|
||||
}
|
||||
|
||||
// If using XP themes, it seems we can get away
|
||||
// If currently an XP theme is active, it seems we can get away
|
||||
// with not drawing a background, which reduces flicker.
|
||||
if (g_UseTheme)
|
||||
return true;
|
||||
if (g_supportsThemes)
|
||||
{
|
||||
wxUxThemeEngine *p = wxUxThemeEngine::Get();
|
||||
if (p && p->IsThemeActive() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
#endif // #if wxUSE_UXTHEME
|
||||
|
||||
#endif // wxUSE_NOTEBOOK
|
||||
|
Reference in New Issue
Block a user