| Version: 3.3.1

Public Member Functions | List of all members
wxPenInfo Class Reference

`#include <wx/pen.h>`

## Detailed Description

This class is a helper used for wxPen creation using named parameter idiom: it allows specifying various wxPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wxPen constructors.

For instance, to create a dotted blue pen with the given join style you could do

wxPen pen(wxPenInfo(*wxBLUE).Style(wxPENSTYLE_DOT).Join(wxJOIN_BEVEL));
wxPen
A pen is a tool for drawing outlines.
Definition: pen.h:327
wxPenInfo::wxPenInfo
wxPenInfo(const wxColour &colour=wxColour(), int width=1, wxPenStyle style=wxPENSTYLE_SOLID)
Constructor, which can set the colour, width and style for the pen.
wxJOIN_BEVEL
@ wxJOIN_BEVEL
The intersection of two lines will have a diagonal edge "cut" into it.
Definition: pen.h:101
wxPENSTYLE_DOT
@ wxPENSTYLE_DOT
Dotted style.
Definition: pen.h:21

Since
  3.1.1

## Public Member Functions
| wxPenInfo (const wxColour &colour=wxColour(), int width=1, wxPenStyle style=wxPENSTYLE_SOLID)
| Constructor, which can set the colour, width and style for the pen. More...
wxPenInfo & | Colour (const wxColour &col)
| Sets the colour for the pen. More...
wxPenInfo & | Width (int width)
| Sets the line width for the pen. More...
wxPenInfo & | Style (wxPenStyle style)
| Sets the style for the pen. More...
wxPenInfo & | Stipple (const wxBitmap &stipple)
| Sets the bitmap used for stippling. More...
wxPenInfo & | Dashes (int nb_dashes, const wxDash *dash)
| Sets the dash pattern used to draw the pen's line. More...
wxPenInfo & | Join (wxPenJoin join)
| Sets the join for the pen, which is the appearance of where two lines meet or overlap. More...
wxPenInfo & | Cap (wxPenCap cap)
| Sets the cap (i.e., the end point) for the pen. More...
wxPenInfo & | Quality (wxPenQuality quality)
| Set the pen quality. More...
wxPenInfo & | LowQuality ()
| Set low pen quality. More...
wxPenInfo & | HighQuality ()
| Set high pen quality. More...
wxColour | GetColour () const
| Returns the pen's colour. More...
wxBitmap | GetStipple () const
| Returns the pen's stipple bitmap. More...
wxPenStyle | GetStyle () const
| Returns the pen's style. More...
wxPenJoin | GetJoin () const
| Returns the pen's joining method. More...
wxPenCap | GetCap () const
| Returns the pen's cap (i.e., end-point style). More...
wxPenQuality | GetQuality () const
| Returns the pen's quality. More...
int | GetDashes (wxDash **ptr)
| Returns the pen's dash pattern and number of dashes in the pattern. More...
int | GetDashCount () const
| Returns the number of dashes in the pen's dash pattern. More...
wxDash * | GetDash () const
| Returns the pen's dash pattern. More...
bool | IsTransparent () const
| Returns whether the pen is transparent. More...
int | GetWidth () const
| Returns the pen's line width. More...

## Constructor & Destructor Documentation

## ◆ wxPenInfo()

wxPenInfo::wxPenInfo | ( | const wxColour & | colour = `wxColour()`,
|  | int | width = `1`,
|  | wxPenStyle | style = `wxPENSTYLE_SOLID`
| ) |  |
| explicit

Constructor, which can set the colour, width and style for the pen.

## Member Function Documentation

## ◆ Cap()

wxPenInfo& wxPenInfo::Cap | ( | wxPenCap | cap | ) |

Sets the cap (i.e., the end point) for the pen.

## ◆ Colour()

wxPenInfo& wxPenInfo::Colour | ( | const wxColour & | col | ) |

Sets the colour for the pen.

## ◆ Dashes()

wxPenInfo& wxPenInfo::Dashes | ( | int | nb_dashes,
|  | const wxDash * | dash
| ) |  |

Sets the dash pattern used to draw the pen's line.

## ◆ GetCap()

wxPenCap wxPenInfo::GetCap | ( |  | ) | const

Returns the pen's cap (i.e., end-point style).

## ◆ GetColour()

wxColour wxPenInfo::GetColour | ( |  | ) | const

Returns the pen's colour.

## ◆ GetDash()

wxDash* wxPenInfo::GetDash | ( |  | ) | const

Returns the pen's dash pattern.

## ◆ GetDashCount()

int wxPenInfo::GetDashCount | ( |  | ) | const

Returns the number of dashes in the pen's dash pattern.

## ◆ GetDashes()

int wxPenInfo::GetDashes | ( | wxDash ** | ptr | ) |

Returns the pen's dash pattern and number of dashes in the pattern.

## ◆ GetJoin()

wxPenJoin wxPenInfo::GetJoin | ( |  | ) | const

Returns the pen's joining method.

## ◆ GetQuality()

wxPenQuality wxPenInfo::GetQuality | ( |  | ) | const

Returns the pen's quality.

## ◆ GetStipple()

wxBitmap wxPenInfo::GetStipple | ( |  | ) | const

Returns the pen's stipple bitmap.

## ◆ GetStyle()

wxPenStyle wxPenInfo::GetStyle | ( |  | ) | const

Returns the pen's style.

## ◆ GetWidth()

int wxPenInfo::GetWidth | ( |  | ) | const

Returns the pen's line width.

## ◆ HighQuality()

wxPenInfo& wxPenInfo::HighQuality | ( |  | ) |

Set high pen quality.

This is the same as calling Quality() with wxPEN_QUALITY_HIGH.

Since
  3.1.5

## ◆ IsTransparent()

bool wxPenInfo::IsTransparent | ( |  | ) | const

Returns whether the pen is transparent.

## ◆ Join()

wxPenInfo& wxPenInfo::Join | ( | wxPenJoin | join | ) |

Sets the join for the pen, which is the appearance of where two lines meet or overlap.

## ◆ LowQuality()

wxPenInfo& wxPenInfo::LowQuality | ( |  | ) |

Set low pen quality.

This is the same as calling Quality() with wxPEN_QUALITY_LOW.

Since
  3.1.5

## ◆ Quality()

wxPenInfo& wxPenInfo::Quality | ( | wxPenQuality | quality | ) |

Set the pen quality.

Using LowQuality() or HighQuality() is usually more convenient.

See also
  wxPen::SetQuality()

Since
  3.1.5

## ◆ Stipple()

wxPenInfo& wxPenInfo::Stipple | ( | const wxBitmap & | stipple | ) |

Sets the bitmap used for stippling.

When the pen is used, a repeating pattern of this bitmap will be drawn.

## ◆ Style()

wxPenInfo& wxPenInfo::Style | ( | wxPenStyle | style | ) |

Sets the style for the pen.

## ◆ Width()

wxPenInfo& wxPenInfo::Width | ( | int | width | ) |

Sets the line width for the pen.