git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56365
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
panelSizer->SetSizeHints( this );
if ( 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()
}
void FormMain::PopulateGrid()
SetStatusText(wxEmptyString);
#endif // wxUSE_STATUSBAR
SetStatusText(wxEmptyString);
#endif // wxUSE_STATUSBAR
+ FinalizeFramePosition();
+}
+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
- );
CreateGrid( style, extraStyle );
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 CreateGrid( int style, int extraStyle );
+ void FinalizeFramePosition();
// These are used in CreateGrid(), and in tests to compose
// grids for testing purposes.
// These are used in CreateGrid(), and in tests to compose
// grids for testing purposes.