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

@@ -65,6 +65,8 @@ public:
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item) wxOVERRIDE;
protected:
virtual wxSize MSWGetFullItemSize(int w, int h) const wxOVERRIDE;
// pressing space or clicking the check box toggles the item
void OnKeyDown(wxKeyEvent& event);
void OnLeftClick(wxMouseEvent& event);