wxDCBgModeChanger Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxDCBgModeChanger Class Reference

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/dc.h>`

## Public Member Functions
| wxDCBgModeChanger (wxDC &dc)
| Trivial constructor not changing anything.
| wxDCBgModeChanger (wxDC &dc, int mode)
| Sets mode on the given dc, storing the old one.
void | Set (int mode)
| Set the text background mode to use.
| ~wxDCBgModeChanger ()
| Restores the text background mode originally selected in the DC passed to the ctor.

## Constructor & Destructor Documentation

## ◆ wxDCBgModeChanger() [1/2]

wxDCBgModeChanger::wxDCBgModeChanger | ( | wxDC & | dc | ) |

Trivial constructor not changing anything.

This constructor is useful if you don't know beforehand if the background mode needs to be changed or not. It simply creates the object which won't do anything in its destructor unless Set() is called – in which case it would reset the previous mode.

## ◆ wxDCBgModeChanger() [2/2]

wxDCBgModeChanger::wxDCBgModeChanger | ( | wxDC & | dc,
|  | int | mode )

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

Parameters

  dc | The DC where the mode must be temporary set.
  mode | The background mode to set, one of `wxBRUSHSTYLE_SOLID` or `wxBRUSHSTYLE_TRANSPARENT`.

## ◆ ~wxDCBgModeChanger()

wxDCBgModeChanger::~wxDCBgModeChanger | ( |  | ) |

Restores the text background mode originally selected in the DC passed to the ctor.

## Member Function Documentation

## ◆ Set()

void wxDCBgModeChanger::Set | ( | int | mode | ) |

Set the text background mode to use.

This method is meant to be called once only and only on the objects created with the constructor overload not taking mode argument and has the same effect as the other constructor, i.e. sets the background mode to the given one, and ensures that the old value is restored when this object is destroyed.