- // is, of course, just the height of the permanently visible part of it
- if ( height != wxDefaultCoord && height != heightCurrent )
- {
- // don't make the drop down list too tall, arbitrarily limit it to 40
- // items max and also don't leave it empty
- unsigned int nItems = GetCount();
- if ( !nItems )
- nItems = 9;
- else if ( nItems > 24 )
- nItems = 24;
-
- // add space for the drop down list
- const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0);
- height += hItem*(nItems + 1);
- }
- else // keep the same height as now
- {
- // normally wxWindow::DoSetSize() checks if we set the same size as the
- // window already has and does nothing in this case, but for us the
- // check fails as the size we pass to it includes the dropdown while
- // the size returned by our GetSize() does not, so test if the size
- // didn't really change ourselves here
- if ( width == wxDefaultCoord || width == widthCurrent )
- {
- // size doesn't change, what about position?
- int xCurrent, yCurrent;
- DoGetPosition(&xCurrent, &yCurrent);
- const bool defMeansUnchanged = !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE);
- if ( ((x == wxDefaultCoord && defMeansUnchanged) || x == xCurrent)
- &&
- ((y == wxDefaultCoord && defMeansUnchanged) || y == yCurrent) )
- {
- // nothing changes, nothing to do
- return;
- }
- }