Add maximum width for sample's frame

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2008-10-16 17:31:46 +00:00
parent 7bb89a662b
commit c324ed9459
2 changed files with 14 additions and 19 deletions

View File

@@ -1949,13 +1949,7 @@ void FormMain::FinalizePanel( bool wasCreated )
panelSizer->SetSizeHints( this );
if ( wasCreated )
{
SetSize(
(wxSystemSettings::GetMetric(wxSYS_SCREEN_X)/10)*4,
(wxSystemSettings::GetMetric(wxSYS_SCREEN_Y)/10)*8
);
Centre();
}
FinalizeFramePosition();
}
void FormMain::PopulateGrid()
@@ -2209,15 +2203,19 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
SetStatusText(wxEmptyString);
#endif // wxUSE_STATUSBAR
FinalizeFramePosition();
}
//
// Finalize
//
void FormMain::FinalizeFramePosition()
{
wxSize frameSize((wxSystemSettings::GetMetric(wxSYS_SCREEN_X)/10)*4,
(wxSystemSettings::GetMetric(wxSYS_SCREEN_Y)/10)*8);
if ( frameSize.x > 500 )
frameSize.x = 500;
SetSize(frameSize);
SetSize(
(wxSystemSettings::GetMetric(wxSYS_SCREEN_X)/10)*4,
(wxSystemSettings::GetMetric(wxSYS_SCREEN_Y)/10)*8
);
Centre();
}
@@ -2867,11 +2865,7 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) )
CreateGrid( style, extraStyle );
SetSize(
(wxSystemSettings::GetMetric(wxSYS_SCREEN_X)/10)*4,
(wxSystemSettings::GetMetric(wxSYS_SCREEN_Y)/10)*8
);
Centre();
FinalizeFramePosition();
}
// -----------------------------------------------------------------------