wxWidgets: wxDCPenChanger Class Reference

| Version: 3.0.2

- Main Page
- Related Pages
- Categories
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

`#include <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
Category: Graphics Device Interface (GDI)

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.
| ~wxDCPenChanger ()
| Restores the pen originally selected in the DC passed to the ctor.

## Constructor & Destructor Documentation

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 | ( |  | ) |

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