]> git.saurik.com Git - wxWidgets.git/commitdiff
Added internal wxHatchStyle enum.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 30 Jun 2012 23:41:15 +0000 (23:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 30 Jun 2012 23:41:15 +0000 (23:41 +0000)
It's annoying that the same code for hatched pens and brushes can't be reused
without relying on deprecated wxXXX_HATCH constants, so add new,
non-deprecated, wxHatchStyle enum that can be used in such code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/brush.h
include/wx/defs.h
include/wx/pen.h
interface/wx/brush.h
interface/wx/pen.h

index 40171d30b1d5a4e72f6e62a2f9cbc390913873e2..47b34619eb5efd5c9b0fd32cb7caaf23e0781e07 100644 (file)
@@ -27,14 +27,14 @@ enum wxBrushStyle
     wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
     wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
     wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
-    wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH,
-    wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH,
-    wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH,
-    wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH,
-    wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH,
-    wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH,
-    wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH,
-    wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH
+    wxBRUSHSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
+    wxBRUSHSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
+    wxBRUSHSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
+    wxBRUSHSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS,
+    wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
+    wxBRUSHSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
+    wxBRUSHSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST,
+    wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
 };
 
 
index 87097c1669434b715af093e843e20a244941459c..f12c460b86f9ec2e64eb589c9b11c2bf227b7beb 100644 (file)
@@ -2227,6 +2227,28 @@ enum wxHitTest
 /*  GDI descriptions */
 /*  ---------------------------------------------------------------------------- */
 
+// Hatch styles used by both pen and brush styles.
+//
+// NB: Do not use these constants directly, they're for internal use only, use
+//     wxBRUSHSTYLE_XXX_HATCH and wxPENSTYLE_XXX_HATCH instead.
+enum wxHatchStyle
+{
+    wxHATCHSTYLE_INVALID = -1,
+
+    /*
+        The value of the first style is chosen to fit with
+        wxDeprecatedGUIConstants values below, don't change it.
+     */
+    wxHATCHSTYLE_FIRST = 111,
+    wxHATCHSTYLE_BDIAGONAL = wxHATCHSTYLE_FIRST,
+    wxHATCHSTYLE_CROSSDIAG,
+    wxHATCHSTYLE_FDIAGONAL,
+    wxHATCHSTYLE_CROSS,
+    wxHATCHSTYLE_HORIZONTAL,
+    wxHATCHSTYLE_VERTICAL,
+    wxHATCHSTYLE_LAST = wxHATCHSTYLE_VERTICAL
+};
+
 /*
     WARNING: the following styles are deprecated; use the
              wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle,
@@ -2275,14 +2297,14 @@ enum wxDeprecatedGUIConstants
     /*  drawn with a Pen, and without any Brush -- and it can be stippled. */
     wxSTIPPLE =          110,
 
-    wxBDIAGONAL_HATCH,     /* In wxWidgets < 2.6 use WX_HATCH macro  */
-    wxCROSSDIAG_HATCH,     /* to verify these wx*_HATCH are in style */
-    wxFDIAGONAL_HATCH,     /* of wxBrush. In wxWidgets >= 2.6 use    */
-    wxCROSS_HATCH,         /* wxBrush::IsHatch() instead.            */
-    wxHORIZONTAL_HATCH,
-    wxVERTICAL_HATCH,
-    wxFIRST_HATCH = wxBDIAGONAL_HATCH,
-    wxLAST_HATCH = wxVERTICAL_HATCH
+    wxBDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
+    wxCROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
+    wxFDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
+    wxCROSS_HATCH = wxHATCHSTYLE_CROSS,
+    wxHORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
+    wxVERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
+    wxFIRST_HATCH = wxHATCHSTYLE_FIRST,
+    wxLAST_HATCH = wxHATCHSTYLE_LAST
 };
 #endif
 
index e97559b3056506e57a1197e5521d5419b0e6af80..9210013b1f1a8234119e8e1c8838727fc4acf784 100644 (file)
@@ -32,15 +32,14 @@ enum wxPenStyle
     wxPENSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
     wxPENSTYLE_STIPPLE = wxSTIPPLE,
 
-    wxPENSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH,
-    wxPENSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH,
-    wxPENSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH,
-    wxPENSTYLE_CROSS_HATCH = wxCROSS_HATCH,
-    wxPENSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH,
-    wxPENSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH,
-
-    wxPENSTYLE_FIRST_HATCH = wxFIRST_HATCH,
-    wxPENSTYLE_LAST_HATCH = wxLAST_HATCH
+    wxPENSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
+    wxPENSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
+    wxPENSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
+    wxPENSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS,
+    wxPENSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
+    wxPENSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
+    wxPENSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST,
+    wxPENSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
 };
 
 enum wxPenJoin
index 44f9c89e205d748344b7f3ac9f5d07c2567fb3de..24db3e93a298d9e6de199f749f3360f9fe8930f7 100644 (file)
@@ -30,26 +30,29 @@ enum wxBrushStyle
     wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
         /**< Uses a bitmap as a stipple. */
 
-    wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH,
+    wxBRUSHSTYLE_BDIAGONAL_HATCH,
         /**< Backward diagonal hatch. */
 
-    wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH,
+    wxBRUSHSTYLE_CROSSDIAG_HATCH,
         /**< Cross-diagonal hatch. */
 
-    wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH,
+    wxBRUSHSTYLE_FDIAGONAL_HATCH,
         /**< Forward diagonal hatch. */
 
-    wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH,
+    wxBRUSHSTYLE_CROSS_HATCH,
         /**< Cross hatch. */
 
-    wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH,
+    wxBRUSHSTYLE_HORIZONTAL_HATCH,
         /**< Horizontal hatch. */
 
-    wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH,
+    wxBRUSHSTYLE_VERTICAL_HATCH,
         /**< Vertical hatch. */
 
-    wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH,
-    wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH,
+    wxBRUSHSTYLE_FIRST_HATCH,
+        /**< First of the hatch styles (inclusive). */
+
+    wxBRUSHSTYLE_LAST_HATCH
+        /**< Last of the hatch styles (inclusive). */
 };
 
 
index 6d5c27341495c882522009406793fd9bf4709f38..fbdcbc90ba1a8014c41c69bba6f43e60fd5e9931 100644 (file)
@@ -64,8 +64,11 @@ enum wxPenStyle
     wxPENSTYLE_VERTICAL_HATCH,
         /**< Vertical hatch. */
 
-    wxPENSTYLE_FIRST_HATCH = wxPENSTYLE_BDIAGONAL_HATCH,
-    wxPENSTYLE_LAST_HATCH = wxPENSTYLE_VERTICAL_HATCH
+    wxPENSTYLE_FIRST_HATCH,
+        /**< First of the hatch styles (inclusive). */
+
+    wxPENSTYLE_LAST_HATCH
+        /**< Last of the hatch styles (inclusive). */
 };
 
 /**