added GetIfActive() method returning non-NULL engine only if themes are not only available, but really use
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -261,6 +261,10 @@ public:
|
||||
// get the theme engine or NULL if themes are not available
|
||||
static wxUxThemeEngine *Get();
|
||||
|
||||
// get the theme enging or NULL if themes are not available or not used for
|
||||
// this application
|
||||
static wxUxThemeEngine *GetIfActive();
|
||||
|
||||
// all uxtheme.dll functions
|
||||
wxUX_THEME_DECLARE(PFNWXUOPENTHEMEDATA, OpenThemeData)
|
||||
wxUX_THEME_DECLARE(PFNWXUCLOSETHEMEDATA, CloseThemeData)
|
||||
@@ -343,6 +347,14 @@ private:
|
||||
DECLARE_NO_COPY_CLASS(wxUxThemeEngine)
|
||||
};
|
||||
|
||||
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive()
|
||||
{
|
||||
wxUxThemeEngine *engine = Get();
|
||||
return engine && engine->IsAppThemed() && engine->IsThemeActive()
|
||||
? engine
|
||||
: NULL;
|
||||
}
|
||||
|
||||
#if !wxUSE_UXTHEME
|
||||
|
||||
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::Get()
|
||||
@@ -350,6 +362,11 @@ private:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // !wxUSE_UXTHEME
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user