From: Vadim Zeitlin <vadim@wxwidgets.org> Date: Wed, 6 Jun 2001 00:05:42 +0000 (+0000) Subject: fixed bug in determining the best listbox size X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5b6d6b700804140ca7936ddf90d59c2d204263b0 fixed bug in determining the best listbox size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 147e73c917..e466ae97ee 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -663,7 +663,10 @@ wxSize wxListBox::DoGetBestSize() const wListbox += 3*cx; - int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*(wxMax(m_noItems, 7)); + // don't make the listbox too tall (limit height to 10 items) but don't + // make it too small neither + int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)* + wxMin(wxMax(m_noItems, 3), 10); return wxSize(wListbox, hListbox); }