lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 00ad371 2/3: Automatically restore the main f


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 00ad371 2/3: Automatically restore the main frame geometry
Date: Wed, 18 Apr 2018 08:36:03 -0400 (EDT)

branch: master
commit 00ad371e738401510784d2f7156dd708d25732a1
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Automatically restore the main frame geometry
    
    Use wxWidgets persistent objects support to preserve the position and
    size of the main frame between executions.
    
    [Amended by GWC to be acceptable to 'hooks/pre-commit'.]
---
 skeleton.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/skeleton.cpp b/skeleton.cpp
index e991bc7..f246b2d 100644
--- a/skeleton.cpp
+++ b/skeleton.cpp
@@ -94,6 +94,7 @@
 #include <wx/menu.h>
 #include <wx/msgdlg.h>
 #include <wx/msgout.h>
+#include <wx/persist/toplevel.h>
 #include <wx/textctrl.h>
 #include <wx/textdlg.h>                 // wxGetTextFromUser()
 #include <wx/toolbar.h>
@@ -745,8 +746,12 @@ bool Skeleton::OnInit()
 
         frame_->Bind(wxEVT_MENU_OPEN, &Skeleton::UponMenuOpen, this);
         frame_->DragAcceptFiles(true);
-        frame_->Centre(wxBOTH);
-        frame_->Maximize(true);
+
+        if(!wxPersistentRegisterAndRestore(frame_, "lmi_main"))
+            {
+            frame_->Centre(wxBOTH);
+            frame_->Maximize(true);
+            }
 
         if
             (  custom_io_0_run_if_file_exists(doc_manager_)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]