]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
added GetControlBounds for accessing contrl.rect
[wxWidgets.git] / src / msw / listbox.cpp
index 462c26bb822ddd8c8297fb7c77b54811007ffa89..147e73c917c49c68fff0260baa60ca31ef0cc24b 100644 (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