From: <ma...@us...> - 2004-02-15 16:54:01
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2407 Modified Files: MainDlg.cpp Log Message: Remember Maximized() state between sessions. Needed in case user closes maximized wxInterface on 800x600 res but starts it up on 1024x768 res for example. Thanks to Avi for this patch. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- MainDlg.cpp 14 Jan 2004 13:26:44 -0000 1.61 +++ MainDlg.cpp 15 Feb 2004 16:46:21 -0000 1.62 @@ -142,6 +142,7 @@ : wxFrame( parent, id, title, position, size, style ), m_locale(l) { int height, width, posx, posy; /* For storing values read from config */ bool isreadx, isready; /* For checking if value was read from config */ +bool maximized; /* Checking if we'r maximized */ start_up = true; cur_page = NULL; @@ -164,6 +165,11 @@ m_config->Read(wxT("/Frame/Width"), &width, 800); SetSize(width, height); /* Do this before loading pages! */ + m_config->Read(wxT("/Frame/Maximized"), &maximized, false); + if (maximized) { /* Separate check if we'r maximized, cos if */ + Maximize(); /* user closes ui maximized on 800x600 res & */ + } /* starts on 1024x768, it won't get maximized otherwise */ + isreadx = m_config->Read(wxT("/Frame/PosX"), &posx, 20); isready = m_config->Read(wxT("/Frame/PosY"), &posy, 20); if (!isreadx && !isready) { @@ -173,7 +179,7 @@ } wxPanel *statusbar = new wxPanel( - this, -1, wxDefaultPosition, wxDefaultSize, + this, -1, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE ); StatusBar(statusbar, true, true); @@ -224,6 +230,7 @@ m_config->Write(wxT("Width"), GetSize().GetWidth()); m_config->Write(wxT("PosX"), GetPosition().x); m_config->Write(wxT("PosY"), GetPosition().y); + m_config->Write(wxT("Maximized"), IsMaximized()); } m_config->SetPath(wxT("/General")); |