Fix horizontal scrollbar handling for wxCheckListBox in wxMSW

The scrollbar wasn't shown when the control became only slightly more
narrow than its contents, resulting in truncation of the rightmost part
of the strings shown in it.

Fix this by accounting for the check box explicitly in wxListBox
SetHorizontalExtent() method using the new MSWGetFullItemSize() helper
which is also used to avoid code duplication between wxCheckListBox
MSWOnMeasure() and DoGetBestClientSize() methods.

Closes #18377.
This commit is contained in:
Vadim Zeitlin
2019-04-22 14:57:55 +02:00
parent 96422fde4d
commit 84dc4707d7
4 changed files with 30 additions and 18 deletions

View File

@@ -174,6 +174,13 @@ protected:
// this can't be called DoHitTest() because wxWindow already has this method
virtual int DoHitTestList(const wxPoint& point) const;
// This is a hook for wxCheckListBox, which uses it to add the checkbox
// width to the item width and to make it at least as tall as the checkbox.
virtual wxSize MSWGetFullItemSize(int w, int h) const
{
return wxSize(w, h);
}
// free memory (common part of Clear() and dtor)
void Free();