- wxControl::DoSetSize(x, y, width, height, sizeFlags);
+ int cx, cy;
+ wxGetCharSize(GetHWND(), &cx, &cy, &GetFont());
+
+ // what should the height of the drop down list be? we choose 10 items by
+ // default and also 10 items max (if we always use n, the list will never
+ // have vertical scrollbar)
+ int n = GetCount();
+ if ( !n )
+ n = 10;
+ else if ( n > 10 )
+ 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;