X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/882a8f40e259edccf7ab628d8bddf08220fb3e2c..0b7e6e7da208b6a95fb23cb50286a09dc90d96d2:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 9bab1a0cdb..f00c1297c9 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -72,7 +72,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); // SetBackgroundColour(parent->GetBackgroundColour()) ; @@ -94,8 +96,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, int width = size.x; int height = size.y; - long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | - CBS_NOINTEGRALHEIGHT; + long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | + WS_VSCROLL | WS_HSCROLL | CBS_AUTOHSCROLL | CBS_NOINTEGRALHEIGHT; if (m_windowStyle & wxCB_READONLY) msStyle |= CBS_DROPDOWNLIST; @@ -330,9 +332,14 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height) 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);