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