wxWidgets: wxDCPenChanger Class Reference

| Version: 3.0.4

Public Member Functions | List of all members
wxDCPenChanger Class Reference
Class List by Category » Graphics Device Interface (GDI)

`#include </usr/src/ports/wxWidgets3.0/wxWidgets3.0-3.0.4-1.x86_64/src/wxWidgets-3.0.4/interface/wx/dc.h>`

## Detailed Description

wxDCPenChanger is a small helper class for setting a pen on a wxDC and unsetting it automatically in the destructor, restoring the previous one.

##

Library: wxCore

<>< =''>:</>&;&;< =''>\ </></>

See also
  wxDC::SetPen(), wxDCFontChanger, wxDCTextColourChanger, wxDCBrushChanger, wxDCClipper

## Public Member Functions
| wxDCPenChanger (wxDC &dc, const wxPen &pen)
| Sets pen on the given dc, storing the old one. More...
| ~wxDCPenChanger ()
| Restores the pen originally selected in the DC passed to the ctor. More...

## Constructor & Destructor Documentation

## ◆ wxDCPenChanger()

wxDCPenChanger::wxDCPenChanger | ( | wxDC & | dc,
|  | const wxPen & | pen
| ) |  |

Sets pen on the given dc, storing the old one.

Parameters

  dc | The DC where the pen must be temporary set.
  pen | The pen to set.

## ◆ ~wxDCPenChanger()

wxDCPenChanger::~wxDCPenChanger | ( |  | ) |

Restores the pen originally selected in the DC passed to the ctor.