]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/brush.h
Don't duplicate event sending code in wxGTK wxListBox.
[wxWidgets.git] / include / wx / brush.h
index fa0103cf4d6322be21682843d0bd61e5db5ede3c..c3a98ba5eb8347d2a623c642540ceb8f2454fc52 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__)
@@ -113,7 +121,7 @@ extern WXDLLIMPEXP_DATA_CORE(wxBrushList*)   wxTheBrushList;
 
 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)