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()
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();
}
CreateGrid( style, extraStyle );
- SetSize(
- (wxSystemSettings::GetMetric(wxSYS_SCREEN_X)/10)*4,
- (wxSystemSettings::GetMetric(wxSYS_SCREEN_Y)/10)*8
- );
- Centre();
+ FinalizeFramePosition();
}
// -----------------------------------------------------------------------
void CreateGrid( int style, int extraStyle );
+ void FinalizeFramePosition();
// These are used in CreateGrid(), and in tests to compose
// grids for testing purposes.