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:
@@ -182,7 +182,19 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
|
|||||||
// and now we may finally size the control properly (if needed)
|
// and now we may finally size the control properly (if needed)
|
||||||
if ( autoSize )
|
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;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user