Added internal wxHatchStyle enum.

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
This commit is contained in:
Vadim Zeitlin
2012-06-30 23:41:15 +00:00
parent e269b28e8e
commit c17eafaaf1
5 changed files with 62 additions and 35 deletions

View File

@@ -27,14 +27,14 @@ enum wxBrushStyle
wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE, wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK, wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
wxBRUSHSTYLE_STIPPLE = wxSTIPPLE, wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH, wxBRUSHSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH, wxBRUSHSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH, wxBRUSHSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH, wxBRUSHSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS,
wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH, wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH, wxBRUSHSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH, wxBRUSHSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST,
wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
}; };

View File

@@ -2227,6 +2227,28 @@ enum wxHitTest
/* GDI descriptions */ /* 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 WARNING: the following styles are deprecated; use the
wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle, wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle,
@@ -2275,14 +2297,14 @@ enum wxDeprecatedGUIConstants
/* drawn with a Pen, and without any Brush -- and it can be stippled. */ /* drawn with a Pen, and without any Brush -- and it can be stippled. */
wxSTIPPLE = 110, wxSTIPPLE = 110,
wxBDIAGONAL_HATCH, /* In wxWidgets < 2.6 use WX_HATCH macro */ wxBDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
wxCROSSDIAG_HATCH, /* to verify these wx*_HATCH are in style */ wxCROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
wxFDIAGONAL_HATCH, /* of wxBrush. In wxWidgets >= 2.6 use */ wxFDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
wxCROSS_HATCH, /* wxBrush::IsHatch() instead. */ wxCROSS_HATCH = wxHATCHSTYLE_CROSS,
wxHORIZONTAL_HATCH, wxHORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
wxVERTICAL_HATCH, wxVERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
wxFIRST_HATCH = wxBDIAGONAL_HATCH, wxFIRST_HATCH = wxHATCHSTYLE_FIRST,
wxLAST_HATCH = wxVERTICAL_HATCH wxLAST_HATCH = wxHATCHSTYLE_LAST
}; };
#endif #endif

View File

@@ -32,15 +32,14 @@ enum wxPenStyle
wxPENSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK, wxPENSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
wxPENSTYLE_STIPPLE = wxSTIPPLE, wxPENSTYLE_STIPPLE = wxSTIPPLE,
wxPENSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH, wxPENSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
wxPENSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH, wxPENSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
wxPENSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH, wxPENSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
wxPENSTYLE_CROSS_HATCH = wxCROSS_HATCH, wxPENSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS,
wxPENSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH, wxPENSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
wxPENSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH, wxPENSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
wxPENSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST,
wxPENSTYLE_FIRST_HATCH = wxFIRST_HATCH, wxPENSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
wxPENSTYLE_LAST_HATCH = wxLAST_HATCH
}; };
enum wxPenJoin enum wxPenJoin

View File

@@ -30,26 +30,29 @@ enum wxBrushStyle
wxBRUSHSTYLE_STIPPLE = wxSTIPPLE, wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
/**< Uses a bitmap as a stipple. */ /**< Uses a bitmap as a stipple. */
wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH, wxBRUSHSTYLE_BDIAGONAL_HATCH,
/**< Backward diagonal hatch. */ /**< Backward diagonal hatch. */
wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH, wxBRUSHSTYLE_CROSSDIAG_HATCH,
/**< Cross-diagonal hatch. */ /**< Cross-diagonal hatch. */
wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH, wxBRUSHSTYLE_FDIAGONAL_HATCH,
/**< Forward diagonal hatch. */ /**< Forward diagonal hatch. */
wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH, wxBRUSHSTYLE_CROSS_HATCH,
/**< Cross hatch. */ /**< Cross hatch. */
wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH, wxBRUSHSTYLE_HORIZONTAL_HATCH,
/**< Horizontal hatch. */ /**< Horizontal hatch. */
wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH, wxBRUSHSTYLE_VERTICAL_HATCH,
/**< Vertical hatch. */ /**< Vertical hatch. */
wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH, wxBRUSHSTYLE_FIRST_HATCH,
wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH, /**< First of the hatch styles (inclusive). */
wxBRUSHSTYLE_LAST_HATCH
/**< Last of the hatch styles (inclusive). */
}; };

View File

@@ -64,8 +64,11 @@ enum wxPenStyle
wxPENSTYLE_VERTICAL_HATCH, wxPENSTYLE_VERTICAL_HATCH,
/**< Vertical hatch. */ /**< Vertical hatch. */
wxPENSTYLE_FIRST_HATCH = wxPENSTYLE_BDIAGONAL_HATCH, wxPENSTYLE_FIRST_HATCH,
wxPENSTYLE_LAST_HATCH = wxPENSTYLE_VERTICAL_HATCH /**< First of the hatch styles (inclusive). */
wxPENSTYLE_LAST_HATCH
/**< Last of the hatch styles (inclusive). */
}; };
/** /**