Added wxDCFontChanger ctor not changing font.
This is similar to the existing wxDCTextColourChanger ctor not changing colour and is useful in the same kind of situations: when the font may or not be changed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		| @@ -1377,8 +1377,21 @@ private: | ||||
| class WXDLLIMPEXP_CORE wxDCFontChanger | ||||
| { | ||||
| public: | ||||
|     wxDCFontChanger(wxDC& dc, const wxFont& font) : m_dc(dc), m_fontOld(dc.GetFont()) | ||||
|     wxDCFontChanger(wxDC& dc) | ||||
|         : m_dc(dc), m_fontOld() | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     wxDCFontChanger(wxDC& dc, const wxFont& font) | ||||
|         : m_dc(dc), m_fontOld(dc.GetFont()) | ||||
|     { | ||||
|         m_dc.SetFont(font); | ||||
|     } | ||||
|  | ||||
|     void Set(const wxFont& font) | ||||
|     { | ||||
|         if ( !m_fontOld.Ok() ) | ||||
|             m_fontOld = m_dc.GetFont(); | ||||
|         m_dc.SetFont(font); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user