check for comctl32.dll version in wxUxThemeEngine::Initialize()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -310,10 +310,6 @@ public:
|
|||||||
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEPARENTBACKGROUND, DrawThemeParentBackground)
|
wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEPARENTBACKGROUND, DrawThemeParentBackground)
|
||||||
wxUX_THEME_DECLARE(PFNWXUENABLETHEMING, EnableTheming)
|
wxUX_THEME_DECLARE(PFNWXUENABLETHEMING, EnableTheming)
|
||||||
|
|
||||||
// This calls IsAppThemed but also checks the commctrl.dll version
|
|
||||||
// for a more reliable answer.
|
|
||||||
bool IsAppThemedEx() ;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// construcor is private as only Get() can create us and is also trivial as
|
// construcor is private as only Get() can create us and is also trivial as
|
||||||
// everything really happens in Initialize()
|
// everything really happens in Initialize()
|
||||||
|
@@ -108,6 +108,13 @@ wxUxThemeEngine* wxUxThemeEngine::Get()
|
|||||||
|
|
||||||
bool wxUxThemeEngine::Initialize()
|
bool wxUxThemeEngine::Initialize()
|
||||||
{
|
{
|
||||||
|
if ( wxTheApp->GetComCtl32Version() < 600 )
|
||||||
|
{
|
||||||
|
// not using theme-aware comctl32.dll anyhow, don't even try to use
|
||||||
|
// themes
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// we're prepared to handle the errors
|
// we're prepared to handle the errors
|
||||||
wxLogNull noLog;
|
wxLogNull noLog;
|
||||||
|
|
||||||
@@ -172,21 +179,5 @@ bool wxUxThemeEngine::Initialize()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This calls IsAppThemed but also checks the commctrl.dll version
|
|
||||||
// for a more reliable answer.
|
|
||||||
bool wxUxThemeEngine::IsAppThemedEx()
|
|
||||||
{
|
|
||||||
static bool g_TestedForTheme = FALSE;
|
|
||||||
static bool g_UseTheme = FALSE;
|
|
||||||
if (!g_TestedForTheme)
|
|
||||||
{
|
|
||||||
int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
|
|
||||||
|
|
||||||
g_UseTheme = (commCtrlVersion >= 600);
|
|
||||||
g_TestedForTheme = TRUE;
|
|
||||||
}
|
|
||||||
return IsAppThemed() && g_UseTheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // wxUSE_UXTHEME
|
#endif // wxUSE_UXTHEME
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user