X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4660e6acfcf29631ac601081f5a64b25ff27770a..374e9b153fcb3f4e547929ccc9b80bda76fd6f6e:/include/wx/dc.h diff --git a/include/wx/dc.h b/include/wx/dc.h index e824590966..a6423af998 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -93,8 +93,6 @@ protected: // global variables // --------------------------------------------------------------------------- -extern WXDLLEXPORT_DATA(int) wxPageNumber; - // --------------------------------------------------------------------------- // wxDC is the device context - object on which any drawing is done // --------------------------------------------------------------------------- @@ -876,7 +874,10 @@ private: class WXDLLEXPORT wxDCPenChanger { public: - wxDCPenChanger(wxDC& dc) : m_dc(dc), m_penOld() { } + wxDCPenChanger(wxDC& dc, const wxPen& pen) : m_dc(dc), m_penOld(dc.GetPen()) + { + m_dc.SetPen(pen); + } ~wxDCPenChanger() { @@ -884,13 +885,6 @@ public: m_dc.SetPen(m_penOld); } - void Set(const wxPen& pen) - { - if ( !m_penOld.Ok() ) - m_penOld = m_dc.GetPen(); - m_dc.SetPen(pen); - } - private: wxDC& m_dc; @@ -907,7 +901,10 @@ private: class WXDLLEXPORT wxDCBrushChanger { public: - wxDCBrushChanger(wxDC& dc) : m_dc(dc), m_brushOld() { } + wxDCBrushChanger(wxDC& dc, const wxBrush& brush) : m_dc(dc), m_brushOld(dc.GetBrush()) + { + m_dc.SetBrush(brush); + } ~wxDCBrushChanger() { @@ -915,13 +912,6 @@ public: m_dc.SetBrush(m_brushOld); } - void Set(const wxBrush& brush) - { - if ( !m_brushOld.Ok() ) - m_brushOld = m_dc.GetBrush(); - m_dc.SetBrush(brush); - } - private: wxDC& m_dc;