fix for releasing the HDC in WM_DRAWITEM handler

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-05-21 23:10:31 +00:00
parent 5260937e74
commit 7561aacd5e
3 changed files with 29 additions and 17 deletions

View File

@@ -73,8 +73,6 @@
class WXDLLEXPORT wxDC : public wxDCBase
{
DECLARE_DYNAMIC_CLASS(wxDC)
public:
wxDC();
~wxDC();
@@ -224,6 +222,20 @@ protected:
WXHBRUSH m_oldBrush;
WXHFONT m_oldFont;
WXHPALETTE m_oldPalette;
DECLARE_DYNAMIC_CLASS(wxDC)
};
// ----------------------------------------------------------------------------
// wxDCTemp: a wxDC which doesn't free the given HDC (used by wxWindows
// only/mainly)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDCTemp : public wxDC
{
public:
wxDCTemp(WXHDC hdc) { SetHDC(hdc); }
virtual ~wxDCTemp() { SetHDC((WXHDC)NULL); }
};
#endif