]> git.saurik.com Git - wxWidgets.git/commitdiff
Add DoGetBestSize to wxCheckListBox that adds room for the checkbox
authorRobin Dunn <robin@alldunn.com>
Tue, 15 Jun 2004 03:23:05 +0000 (03:23 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 15 Jun 2004 03:23:05 +0000 (03:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/checklst.h
src/msw/checklst.cpp

index 73385b20da94aa28f48087a1600ce3404ef020dd..4840d09253310d21d5c5b4b4a85ba30ebfd5bc7a 100644 (file)
@@ -88,6 +88,8 @@ protected:
   void OnKeyDown(wxKeyEvent& event);
   void OnLeftClick(wxMouseEvent& event);
 
+  wxSize DoGetBestSize() const;
+
 private:
   size_t    m_nItemHeight;  // height of checklistbox items (the same for all)
 
index bebe3235f35174190f635fe7994482bcffc5b27d..d6e48edde86098b1647e63b1fa9873589e6d3083 100644 (file)
@@ -547,5 +547,13 @@ int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const
   return nItem >= m_noItems ? wxNOT_FOUND : nItem;
 }
 
+
+wxSize wxCheckListBox::DoGetBestSize() const
+{
+    wxSize best = wxListBox::DoGetBestSize();
+    best.x += wxOwnerDrawn::GetDefaultMarginWidth();  // add room for the checkbox
+    return best;
+}
+
 #endif