From af3581758b11d269198aaaf3367ecfd5b6c2520d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Sep 2017 01:28:38 +0200 Subject: [PATCH] Don't mention wxPenInfoBase in the documentation This is an implementation detail, don't confuse the user with this template class which isn't supposed to be used in the user code. Also improve the example in the documentation, the old one (using pen of width 0 but with a colour) didn't make much sense. --- interface/wx/graphics.h | 15 ++++++++------- interface/wx/pen.h | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index fdc263c4ac..cec978d8e4 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -1541,22 +1541,23 @@ public: calls to its clearly named methods instead of passing them in the fixed order to wxGraphicsPen constructors. - Typically you would use wxGraphicsPenInfo with a wxGraphicsContext: + Typically you would use wxGraphicsPenInfo with a wxGraphicsContext, e.g. to + start drawing with a dotted blue pen slightly wider than normal you could + write the following: @code wxGraphicsContext ctx = wxGraphicsContext::Create(dc); - ctx.SetPen(wxGraphicsPenInfo(*wxBLUE, 1.25)); + ctx.SetPen(wxGraphicsPenInfo(*wxBLUE).Width(1.25).Style(wxPENSTYLE_DOT)); @endcode @since 3.1.1 */ -class wxGraphicsPenInfo : public wxPenInfoBase +class wxGraphicsPenInfo { public: - - explicit wxGraphicsPenInfo(const wxColour& colour = wxColour(), wxDouble width = 1.0, wxPenStyle style = wxPENSTYLE_SOLID); - - static wxGraphicsPenInfo CreateFromPen(const wxPen& pen); + explicit wxGraphicsPenInfo(const wxColour& colour = wxColour(), + wxDouble width = 1.0, + wxPenStyle style = wxPENSTYLE_SOLID); wxGraphicsPenInfo& Colour(const wxColour& col); diff --git a/interface/wx/pen.h b/interface/wx/pen.h index a9ecddb59c..04000e478f 100644 --- a/interface/wx/pen.h +++ b/interface/wx/pen.h @@ -109,18 +109,20 @@ enum wxPenCap calls to its clearly named methods instead of passing them in the fixed order to wxPen constructors. - For instance, to create a blue pen with a width of 0: + For instance, to create a dotted blue pen with the given join style you + could do @code - wxPen pen(wxPenInfo(*wxBLUE, 0)); + wxPen pen(wxPenInfo(*wxBLUE).Style(wxPENSTYLE_DOT).Join(wxJOIN_BEVEL)); @endcode @since 3.1.1 */ -class wxPenInfo : public wxPenInfoBase +class wxPenInfo { public: - - explicit wxPenInfo(const wxColour& colour = wxColour(), int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); + explicit wxPenInfo(const wxColour& colour = wxColour(), + int width = 1, + wxPenStyle style = wxPENSTYLE_SOLID); wxPenInfo& Colour(const wxColour& col);