- // VZ: for unknown (to me) reasons, if we don't do this, the combobox
- // somehow is hidden by the static boxes, although static boxes do
- // put themselves at the very end of Z-order.
- if ( !::SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0,
- SWP_NOMOVE | SWP_NOSIZE) )
- {
- wxLogLastError(_T("SetWindowPos"));
- }
+ int n = GetCount();
+ if ( !n )
+ n = 10;
+
+ height = n * EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
+
+ wxControl::DoMoveWindow(x, y, width, height);
+}
+
+wxSize wxComboBox::DoGetBestSize() const
+{
+ // the choice calculates the horz size correctly, but not the vertical
+ // component: correct it
+ wxSize size = wxChoice::DoGetBestSize();
+
+ int cx, cy;
+ wxGetCharSize(GetHWND(), &cx, &cy, &GetFont());
+ size.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
+
+ return size;