]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/brush.h
extracted GUI-specific part of utilsunx.cpp to a new unix/apptraits.cpp file and...
[wxWidgets.git] / include / wx / brush.h
index 08fc16b5ffa4d93a1bb5e68141d64c1603f60bce..12fdaf2fac8059e0c53fca2a2fe99d127d66653f 100644 (file)
@@ -96,5 +96,24 @@ public:
 
 extern WXDLLEXPORT_DATA(wxBrushList*)   wxTheBrushList;
 
-#endif
-    // _WX_BRUSH_H_BASE_
+// provide comparison operators to allow code such as
+//
+//      if ( brush.GetStyle() == wxTRANSPARENT )
+//
+// to compile without warnings which it would otherwise provoke from some
+// compilers as it compares elements of different enums
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+
+inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t)
+{
+    return wx_static_cast(int, s) == wx_static_cast(int, t);
+}
+
+inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
+{
+    return !(s == t);
+}
+
+#endif // FUTURE_WXWIN_COMPATIBILITY_3_0
+
+#endif // _WX_BRUSH_H_BASE_