X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d4445d24d33828580f8bf2a1215ef906f70adb51..3f4a2351e4c677c88c18ea812b609477adee7380:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 1441653418..67feff0512 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -26,8 +26,9 @@ #if wxUSE_CHOICE && !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) +#include "wx/choice.h" + #ifndef WX_PRECOMP - #include "wx/choice.h" #include "wx/utils.h" #include "wx/log.h" #include "wx/brush.h" @@ -504,6 +505,8 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags) { + int heightOrig = height; + // the height which we must pass to Windows should be the total height of // the control including the drop down list while the height given to us // is, of course, just the height of the permanently visible part of it @@ -541,6 +544,11 @@ void wxChoice::DoSetSize(int x, int y, wxControl::DoSetSize(x, y, width, height, sizeFlags); + // If we're storing a pending size, make sure we store + // the original size for reporting back to the app. + if (m_pendingSize != wxDefaultSize) + m_pendingSize = wxSize(width, heightOrig); + // This solution works on XP, but causes choice/combobox lists to be // too short on W2K and earlier. #if 0 @@ -741,10 +749,7 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) if ( n > -1 ) { event.SetString(GetStringSelection()); - if ( HasClientObjectData() ) - event.SetClientObject( GetClientObject(n) ); - else if ( HasClientUntypedData() ) - event.SetClientData( GetClientData(n) ); + InitCommandEventWithItems(event, n); } ProcessCommand(event);