From d6959d6f9edf9ac65d2944549ad75302c8f19b9b Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Mon, 24 Jan 2005 14:30:51 +0000 Subject: [PATCH] applied patch #1044865 (fixes problem: "On Win2K, the month combobox's dropdown height in the wxCalendar is only about 1 pixel") git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/choice.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 362f98ccb7..b7feab4c5b 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -504,6 +504,23 @@ void wxChoice::DoSetSize(int x, int y, const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0); height += hItem*(nItems + 1); } + else + { + // We cannot pass wxDefaultCoord as height to wxControl. wxControl uses + // wxGetWindowRect() to determine the current height of the combobox, + // and then again sets the combobox's height to that value. Unfortunately, + // wxGetWindowRect doesn't include the dropdown list's height (at least + // on Win2K), so this would result in a combobox with dropdown height of + // 1 pixel. We have to determine the default height ourselves and call + // wxControl with that value instead. + int w, h; + RECT r; + DoGetSize(&w, &h); + if (::SendMessage(GetHwnd(), CB_GETDROPPEDCONTROLRECT, 0, (LPARAM) &r) != 0) + { + height = h + r.bottom - r.top; + } + } wxControl::DoSetSize(x, y, width, height, sizeFlags);