]> git.saurik.com Git - wxWidgets.git/commitdiff
added GetIfActive() method returning non-NULL engine only if themes are not only...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Nov 2004 17:17:00 +0000 (17:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Nov 2004 17:17:00 +0000 (17:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/uxtheme.h

index 7d5548bff43f526f81c1afd8033a7f45cdc74cf4..f7578a97467c4c4bb2cac7e10edf9cc1c080b08f 100644 (file)
@@ -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
 
 // ----------------------------------------------------------------------------