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:
@@ -175,8 +175,10 @@ protected:
|
|||||||
// set the size of the given page to fit in the notebook
|
// set the size of the given page to fit in the notebook
|
||||||
void AdjustPageSize(wxNotebookPage *page);
|
void AdjustPageSize(wxNotebookPage *page);
|
||||||
|
|
||||||
// override WndProc
|
// override WndProc.
|
||||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
#if wxUSE_UXTHEME
|
||||||
|
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
#endif
|
||||||
|
|
||||||
// the current selection (-1 if none)
|
// the current selection (-1 if none)
|
||||||
int m_nSelection;
|
int m_nSelection;
|
||||||
|
@@ -974,10 +974,11 @@ void wxNotebook::ApplyThemeBackground(wxWindow*, const wxColour&)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_UXTHEME
|
||||||
long wxNotebook::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
long wxNotebook::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
static bool g_TestedForTheme = false;
|
static bool g_TestedForTheme = false;
|
||||||
static bool g_UseTheme = false;
|
static bool g_supportsThemes = false;
|
||||||
switch ( nMsg )
|
switch ( nMsg )
|
||||||
{
|
{
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
@@ -986,19 +987,25 @@ long wxNotebook::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
{
|
{
|
||||||
int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
|
int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
|
||||||
|
|
||||||
g_UseTheme = (commCtrlVersion >= 600);
|
g_supportsThemes = (commCtrlVersion >= 600);
|
||||||
g_TestedForTheme = true;
|
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.
|
// with not drawing a background, which reduces flicker.
|
||||||
if (g_UseTheme)
|
if (g_supportsThemes)
|
||||||
return true;
|
{
|
||||||
|
wxUxThemeEngine *p = wxUxThemeEngine::Get();
|
||||||
|
if (p && p->IsThemeActive() )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
#endif // #if wxUSE_UXTHEME
|
||||||
|
|
||||||
#endif // wxUSE_NOTEBOOK
|
#endif // wxUSE_NOTEBOOK
|
||||||
|
Reference in New Issue
Block a user