Introduce wxPenInfo class

This commit is contained in:
Adrien Tétar
2017-05-02 11:02:37 +02:00
committed by Vadim Zeitlin
parent f045323934
commit bc562289c6
14 changed files with 212 additions and 0 deletions

View File

@@ -100,6 +100,43 @@ enum wxPenCap
};
/**
@class wxPenInfo
This class is a helper used for wxPen creation using named parameter
idiom: it allows to specify various wxPen attributes using the chained
calls to its clearly named methods instead of passing them in the fixed
order to wxPen constructors.
@since 3.1.0
*/
class wxPenInfo
{
public:
wxPenInfo();
explicit wxPen(const wxColour& colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
wxPenInfo& ();
wxPenInfo& Colour(const wxColour& col);
wxPenInfo& Width(int width);
wxPenInfo& Style(wxPenStyle style);
wxPenInfo& Style(wxPenStyle style);
wxPenInfo& Stipple(const wxBitmap& stipple);
wxPenInfo& Dashes(int nb_dashes, const wxDash *dash);
wxPenInfo& Join(wxPenJoin join);
wxPenInfo& Cap(wxPenCap cap);
};
/**
@class wxPen
@@ -157,6 +194,11 @@ public:
*/
wxPen();
/**
Creates a pen object using the specified pen description.
*/
wxPen(const wxPenInfo& info);
/**
Constructs a pen from a colour object, pen width and style.