]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/checklst.cpp
fixing length param, see #10846
[wxWidgets.git] / src / msw / checklst.cpp
index 98a4e6763bbc39ef5464faf282c9ac885fc4d8a2..b06c404120cb9c8583c0948925ba36d8eb30d0cd 100644 (file)
@@ -47,6 +47,7 @@
 
 #include "wx/renderer.h"
 #include "wx/msw/private.h"
+#include "wx/msw/dc.h"
 
 // ----------------------------------------------------------------------------
 // private functions
@@ -145,7 +146,7 @@ private:
     wxCheckListBox *m_pParent;
     size_t          m_nIndex;
 
-    DECLARE_NO_COPY_CLASS(wxCheckListBoxItem)
+    wxDECLARE_NO_COPY_CLASS(wxCheckListBoxItem);
 };
 
 wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
@@ -174,8 +175,9 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
     if ( !wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) )
         return false;
 
+    wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();
     // now draw the check mark part
-    HDC hdc = GetHdcOf(dc);
+    HDC hdc = GetHdcOf(*impl);
 
     int nBmpWidth  = ::GetSystemMetrics(SM_CXMENUCHECK),
         nBmpHeight = ::GetSystemMetrics(SM_CYMENUCHECK);
@@ -213,6 +215,9 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
 
     ImageList_Destroy(himl);
 
+    if (stat & wxODHasFocus)
+        wxRendererNative::Get().DrawFocusRect(m_pParent, dc, rc);
+
     return true;
 }
 
@@ -506,20 +511,6 @@ void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
     }
 }
 
-int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const
-{
-    int nItem = (int)::SendMessage
-                             (
-                              (HWND)GetHWND(),
-                              LB_ITEMFROMPOINT,
-                              0,
-                              MAKELPARAM(x, y)
-                             );
-
-    return nItem >= (int)m_noItems ? wxNOT_FOUND : nItem;
-}
-
-
 wxSize wxCheckListBox::DoGetBestSize() const
 {
     wxSize best = wxListBox::DoGetBestSize();
@@ -528,4 +519,4 @@ wxSize wxCheckListBox::DoGetBestSize() const
     return best;
 }
 
-#endif
+#endif // wxUSE_CHECKLISTBOX