git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51498
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
// take the min size by default and limit it by max size
wxSize size = GetMinClientSize(window);
{
// take the min size by default and limit it by max size
wxSize size = GetMinClientSize(window);
wxTopLevelWindow *tlw = wxDynamicCast(window, wxTopLevelWindow);
if ( tlw )
wxTopLevelWindow *tlw = wxDynamicCast(window, wxTopLevelWindow);
if ( tlw )
// do nothing
return tlw->GetSize();
}
// do nothing
return tlw->GetSize();
}
// limit the window to the size of the display it is on
int disp = wxDisplay::GetFromWindow(window);
if ( disp == wxNOT_FOUND )
// limit the window to the size of the display it is on
int disp = wxDisplay::GetFromWindow(window);
if ( disp == wxNOT_FOUND )
- wxSize sizeMax = wxDisplay(disp).GetClientArea().GetSize();
-
+ sizeMax = wxDisplay(disp).GetClientArea().GetSize();
+
// space for decorations and toolbars etc.
wxSize tlw_client_size = tlw->GetClientSize();
wxSize tlw_size = tlw->GetSize();
sizeMax.x -= tlw_size.x - tlw_client_size.x;
sizeMax.y -= tlw_size.y - tlw_client_size.y;
// space for decorations and toolbars etc.
wxSize tlw_client_size = tlw->GetClientSize();
wxSize tlw_size = tlw->GetSize();
sizeMax.x -= tlw_size.x - tlw_client_size.x;
sizeMax.y -= tlw_size.y - tlw_client_size.y;
-
- if ( sizeMax.x != wxDefaultCoord && size.x > sizeMax.x )
- size.x = sizeMax.x;
- if ( sizeMax.y != wxDefaultCoord && size.y > sizeMax.y )
- size.y = sizeMax.y;
-
- // set client size
- tlw->SetClientSize( size );
-
- // return entire size
- return tlw->GetSize();
- wxSize sizeMax = GetMaxClientSize(window);
-
- if ( sizeMax.x != wxDefaultCoord && size.x > sizeMax.x )
- size.x = sizeMax.x;
- if ( sizeMax.y != wxDefaultCoord && size.y > sizeMax.y )
- size.y = sizeMax.y;
+ sizeMax = GetMaxClientSize(window);
+ }
- // set client size
- window->SetClientSize( size );
+ if ( sizeMax.x != wxDefaultCoord && size.x > sizeMax.x )
+ size.x = sizeMax.x;
+ if ( sizeMax.y != wxDefaultCoord && size.y > sizeMax.y )
+ size.y = sizeMax.y;
- // return entire size
- return window->GetSize();
- }
+ // set client size
+ window->SetClientSize( size );
+
+ // return entire size
+ return window->GetSize();
}
void wxSizer::FitInside( wxWindow *window )
}
void wxSizer::FitInside( wxWindow *window )