diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 5ac3028c77..06707bc9b2 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -1932,17 +1932,17 @@ void FormMain::ReplaceGrid(int style, int extraStyle) // ----------------------------------------------------------------------- -FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size) : - wxFrame((wxFrame *)NULL, -1, title, pos, size, +FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size) + : wxFrame((wxFrame *)NULL, -1, title, pos, size, (wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCAPTION| wxTAB_TRAVERSAL|wxCLOSE_BOX) ) + , m_pPropGridManager(NULL) + , m_propGrid(NULL) + , m_hasHeader(false) + , m_labelEditingEnabled(false) { SetIcon(wxICON(sample)); - - m_propGrid = NULL; - m_pPropGridManager = NULL; - m_hasHeader = false; - m_labelEditingEnabled = false; + Centre(); #ifdef __WXMAC__ // we need this in order to allow the about menu relocation, since ABOUT is @@ -2133,8 +2133,6 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size m_panel->Layout(); - FinalizeFramePosition(); - #if wxUSE_LOGWINDOW // Create log window m_logWindow = new wxLogWindow(this, "Log Messages", false); @@ -2144,19 +2142,6 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size #endif } -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); - - Centre(); -} - // // Normally, wxPropertyGrid does not check whether item with identical // label already exists. However, since in this sample we use labels for @@ -3134,7 +3119,12 @@ bool cxApplication::OnInit() //wxLocale Locale; //Locale.Init(wxLANGUAGE_FINNISH); - FormMain* frame = Form1 = new FormMain( "wxPropertyGrid Sample", wxPoint(0,0), wxSize(300,500) ); + wxSize frameSize((wxSystemSettings::GetMetric(wxSYS_SCREEN_X) / 10) * 4, + (wxSystemSettings::GetMetric(wxSYS_SCREEN_Y) / 10) * 8); + if ( frameSize.x > 500 ) + frameSize.x = 500; + + FormMain* frame = Form1 = new FormMain( "wxPropertyGrid Sample", wxPoint(0,0), frameSize); frame->Show(true); // diff --git a/samples/propgrid/propgrid.h b/samples/propgrid/propgrid.h index 158c2e08ca..4e17958795 100644 --- a/samples/propgrid/propgrid.h +++ b/samples/propgrid/propgrid.h @@ -159,7 +159,6 @@ public: void CreateGrid( int style, int extraStyle ); void ReplaceGrid(int style, int extraStyle); - void FinalizeFramePosition(); // These are used in CreateGrid(), and in tests to compose // grids for testing purposes. diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index ba5174d9f8..ce7c2b49dc 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -1765,7 +1765,6 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // Test with multiple columns ReplaceGrid( -1, -1 ); - FinalizeFramePosition(); pgman = m_pPropGridManager; for ( i=3; i<12; i+=2 ) { @@ -1811,9 +1810,6 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman = m_pPropGridManager; } - // Restore original grid size - FinalizeFramePosition(); - RT_START_TEST(none) bool retVal;