don't let wxChoice created with default size to shrink to nothing in a sizer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-05-02 16:06:51 +00:00
parent 072ce45768
commit 25736956ef

View File

@@ -182,7 +182,19 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
// and now we may finally size the control properly (if needed)
if ( autoSize )
{
SetBestSize(sizeOrig);
// we do the same thing as SetBestSize() but we need sizeBest here
wxSize sizeBest = DoGetBestSize();
if ( size.x != -1 )
sizeBest.x = sizeOrig.x;
if ( size.y != -1 )
sizeBest.y = sizeOrig.y;
SetSize(sizeBest);
// this is our true initial size, not the (1, 1) we had during
// CreateControl() call above: this is especially important if we're
// added to a sizer as we don't want to be shrunk to nothing by it
m_initialSize = sizeBest;
}
return TRUE;