X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e69ba9cb20949c44b4812cf15cf8547a49dfb821..b081046a6646bba07fb953adb06ebfe8ffffc3f7:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index af029bf042..52cf225acc 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -179,8 +179,9 @@ bool wxChoice::MSWShouldPreProcessMessage(WXMSG *pMsg) { MSG *msg = (MSG *) pMsg; - // don't preprocess "ESC" if combobox is dropped down - if ( msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE ) + // if the dropdown list is visible, don't preprocess certain keys + if ( msg->message == WM_KEYDOWN + && (msg->wParam == VK_ESCAPE || msg->wParam == VK_RETURN) ) { if (::SendMessage(GetHwndOf(this), CB_GETDROPPEDSTATE, 0, 0)) { @@ -231,7 +232,8 @@ int wxChoice::DoAppend(const wxString& item) { // we need to refresh our size in order to have enough space for the // newly added items - UpdateVisibleHeight(); + if ( !IsFrozen() ) + UpdateVisibleHeight(); } return n; @@ -249,7 +251,8 @@ int wxChoice::DoInsert(const wxString& item, int pos) } else // ok { - UpdateVisibleHeight(); + if ( !IsFrozen() ) + UpdateVisibleHeight(); } return n; @@ -266,7 +269,8 @@ void wxChoice::Delete(int n) SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); - UpdateVisibleHeight(); + if ( !IsFrozen() ) + UpdateVisibleHeight(); } void wxChoice::Clear() @@ -275,7 +279,8 @@ void wxChoice::Clear() SendMessage(GetHwnd(), CB_RESETCONTENT, 0, 0); - UpdateVisibleHeight(); + if ( !IsFrozen() ) + UpdateVisibleHeight(); } void wxChoice::Free() @@ -476,8 +481,8 @@ void wxChoice::DoSetSize(int x, int y, size_t nItems = GetCount(); if ( !nItems ) nItems = 9; - else if ( nItems > 39 ) - nItems = 39; + else if ( nItems > 24 ) + nItems = 24; // add space for the drop down list const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0);