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:
@@ -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();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
@@ -150,6 +150,7 @@ public:
|
||||
|
||||
|
||||
void CreateGrid( int style, int extraStyle );
|
||||
void FinalizeFramePosition();
|
||||
|
||||
// These are used in CreateGrid(), and in tests to compose
|
||||
// grids for testing purposes.
|
||||
|
Reference in New Issue
Block a user