use best size instead of hard coded 80*26 in SetSize(wxSIZE_AUTO)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-03-27 20:46:58 +00:00
parent 0efd57325c
commit a63d48fa13
2 changed files with 24 additions and 16 deletions

View File

@@ -3004,18 +3004,22 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
m_x = x + pizza->xoffset;
m_y = y + pizza->yoffset;
}
if (width != -1) m_width = width;
if (height != -1) m_height = height;
if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH)
// calculate the best size if we should auto size the window
if ( (sizeFlags & wxSIZE_AUTO_WIDTH) ||
(sizeFlags & wxSIZE_AUTO_HEIGHT) )
{
if (width == -1) m_width = 80;
const wxSize sizeBest = GetBestSize();
if ( sizeFlags & wxSIZE_AUTO_WIDTH )
width = sizeBest.x;
if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
height = sizeBest.y;
}
if ((sizeFlags & wxSIZE_AUTO_HEIGHT) == wxSIZE_AUTO_HEIGHT)
{
if (height == -1) m_height = 26;
}
if (width != -1)
m_width = width;
if (height != -1)
m_height = height;
int minWidth = GetMinWidth(),
minHeight = GetMinHeight(),