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

@@ -773,14 +773,13 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
wxListBoxItem *pItem = (wxListBoxItem *)data;
wxDC dc;
dc.SetHDC((WXHDC)pStruct->hDC, FALSE);
wxDCTemp dc((WXHDC)pStruct->hDC);
wxRect rect(wxPoint(pStruct->rcItem.left, pStruct->rcItem.top),
wxPoint(pStruct->rcItem.right, pStruct->rcItem.bottom));
return pItem->OnDrawItem(dc, rect,
(wxOwnerDrawn::wxODAction)pStruct->itemAction,
(wxOwnerDrawn::wxODStatus)pStruct->itemState);
(wxOwnerDrawn::wxODAction)pStruct->itemAction,
(wxOwnerDrawn::wxODStatus)pStruct->itemState);
}
#endif