From 6d50c6a7021bc39d623331b26e7564edde0c3a5e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Jun 2004 03:23:05 +0000 Subject: [PATCH] Add DoGetBestSize to wxCheckListBox that adds room for the checkbox git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/checklst.h | 2 ++ src/msw/checklst.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/include/wx/msw/checklst.h b/include/wx/msw/checklst.h index 73385b20da..4840d09253 100644 --- a/include/wx/msw/checklst.h +++ b/include/wx/msw/checklst.h @@ -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) diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index bebe3235f3..d6e48edde8 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -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 -- 2.45.2