X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c0f0784084798f225cec198f530461e03014cd3..14ca3a3b0ead6b9f521368d35ca34c87678544a8:/src/msw/choice.cpp?ds=sidebyside diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index fd54852b9d..5b7f131e0b 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -246,7 +246,7 @@ wxChoice::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) // NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista) attrs.colBg = wnd->MSWGetThemeColour(L"EDIT", - EP_EDITTEXT, + EP_EDITTEXT, ETS_NORMAL, ThemeColourBackground, wxSYS_COLOUR_WINDOW); @@ -553,8 +553,21 @@ void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags) { + const int heightBest = GetBestSize().y; + // we need the real height below so get the current one if it's not given - if ( height != wxDefaultCoord && height != GetBestSize().y ) + if ( height == wxDefaultCoord ) + { + // height not specified, use the same as before + DoGetSize(NULL, &height); + } + else if ( height == heightBest ) + { + // we don't need to manually manage our height, let the system use the + // default one + m_heightOwn = wxDefaultCoord; + } + else // non-default height specified { // set our new own height but be careful not to make it too big: the // native control apparently stores it as a single byte and so setting @@ -568,10 +581,6 @@ void wxChoice::DoSetSize(int x, int y, else if ( m_heightOwn < COMBO_HEIGHT_ADJ ) m_heightOwn = COMBO_HEIGHT_ADJ; } - else // height not specified - { - DoGetSize(NULL, &height); - } // the height which we must pass to Windows should be the total height of