]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/brush.h
Removed wxOSX conditional code from generic calendar control.
[wxWidgets.git] / include / wx / brush.h
index acddcd314c8a2c88d171f4c6aa68720f9bdf9d62..89ae912fa1cba1152a9846585203600ffb04c2d2 100644 (file)
@@ -56,10 +56,18 @@ public:
     virtual bool IsHatch() const
         { return (GetStyle()>=wxBRUSHSTYLE_FIRST_HATCH) && (GetStyle()<=wxBRUSHSTYLE_LAST_HATCH); }
 
-#if FUTURE_WXWIN_COMPATIBILITY_3_0
-    wxDEPRECATED_FUTURE( void SetStyle(int style) )
-        { SetStyle((wxBrushStyle)style); }
-#endif
+    // Convenient helpers for testing whether the brush is a transparent one:
+    // unlike GetStyle() == wxBRUSHSTYLE_TRANSPARENT, they work correctly even
+    // if the brush is invalid (they both return false in this case).
+    bool IsTransparent() const
+    {
+        return IsOk() && GetStyle() == wxBRUSHSTYLE_TRANSPARENT;
+    }
+
+    bool IsNonTransparent() const
+    {
+        return IsOk() && GetStyle() != wxBRUSHSTYLE_TRANSPARENT;
+    }
 };
 
 #if defined(__WXPALMOS__)
@@ -77,7 +85,7 @@ public:
 #elif defined(__WXDFB__)
     #include "wx/dfb/brush.h"
 #elif defined(__WXMAC__)
-    #include "wx/mac/brush.h"
+    #include "wx/osx/brush.h"
 #elif defined(__WXCOCOA__)
     #include "wx/cocoa/brush.h"
 #elif defined(__WXPM__)
@@ -111,9 +119,14 @@ extern WXDLLIMPEXP_DATA_CORE(wxBrushList*)   wxTheBrushList;
 // compilers as it compares elements of different enums
 #if FUTURE_WXWIN_COMPATIBILITY_3_0
 
+// Unfortunately some compilers have ambiguity issues when enum comparisons are
+// overloaded so we have to disable the overloads in this case, see
+// wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details.
+#ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM
+
 inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t)
 {
-    return wx_static_cast(int, s) == wx_static_cast(int, t);
+    return static_cast<int>(s) == static_cast<int>(t);
 }
 
 inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
@@ -121,6 +134,8 @@ inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
     return !(s == t);
 }
 
+#endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM
+
 #endif // FUTURE_WXWIN_COMPATIBILITY_3_0
 
 #endif // _WX_BRUSH_H_BASE_