Call SetSize for explicit sizees too in case it wasn't called before
earlier in the Create process. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -622,10 +622,7 @@ wxSize wxWindowBase::DoGetBestSize() const
|
|||||||
|
|
||||||
void wxWindowBase::SetBestSize(const wxSize& size)
|
void wxWindowBase::SetBestSize(const wxSize& size)
|
||||||
{
|
{
|
||||||
// the size only needs to be changed if the current size is incomplete,
|
// If the given size is incomplete then merge with the best size.
|
||||||
// i.e. one of the components was specified as default -- so if both
|
|
||||||
// were given, simply don't do anything and in particular don't call
|
|
||||||
// potentially expensive DoGetBestSize()
|
|
||||||
wxSize sizeBest;
|
wxSize sizeBest;
|
||||||
if ( size.x == -1 || size.y == -1 )
|
if ( size.x == -1 || size.y == -1 )
|
||||||
{
|
{
|
||||||
@@ -634,14 +631,16 @@ void wxWindowBase::SetBestSize(const wxSize& size)
|
|||||||
sizeBest.x = size.x;
|
sizeBest.x = size.x;
|
||||||
if ( size.y != -1 )
|
if ( size.y != -1 )
|
||||||
sizeBest.y = size.y;
|
sizeBest.y = size.y;
|
||||||
|
|
||||||
SetSize(sizeBest);
|
|
||||||
}
|
}
|
||||||
else // have explicit size
|
else // have complete explicit size
|
||||||
{
|
{
|
||||||
sizeBest = size;
|
sizeBest = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change the size if needed
|
||||||
|
if (GetSize() != sizeBest)
|
||||||
|
SetSize(sizeBest);
|
||||||
|
|
||||||
// don't shrink the control below its best size
|
// don't shrink the control below its best size
|
||||||
m_minWidth = sizeBest.x;
|
m_minWidth = sizeBest.x;
|
||||||
m_minHeight = sizeBest.y;
|
m_minHeight = sizeBest.y;
|
||||||
|
Reference in New Issue
Block a user