wxDCTextColourChanger Class Reference
[Graphics Device Interface (GDI)]

#include <wx/dc.h>


Detailed Description

wxDCTextColourChanger is a small helper class for setting a foreground text colour on a wxDC and unsetting it automatically in the destructor, restoring the previous one.

Library:  wxCore

Category:  Graphics Device Interface (GDI)

See also:
wxDC::SetTextForeground(), wxDCFontChanger, wxDCPenChanger, wxDCBrushChanger, wxDCClipper

Public Member Functions

 wxDCTextColourChanger (wxDC &dc, const wxColour &col)
 Sets col on the given dc, storing the old one.
 ~wxDCTextColourChanger ()
 Restores the colour originally selected in the DC passed to the ctor.

List of all members.


Constructor & Destructor Documentation

wxDCTextColourChanger::wxDCTextColourChanger ( wxDC dc,
const wxColour col 
)

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

Parameters:
dc The DC where the colour must be temporary set.
col The colour to set.

wxDCTextColourChanger::~wxDCTextColourChanger (  ) 

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



wxWidgets logo

[ top ]