lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6031] Refactor to facilitate GUI-test automation


From: Greg Chicares
Subject: [lmi-commits] [6031] Refactor to facilitate GUI-test automation
Date: Fri, 07 Nov 2014 12:05:28 +0000

Revision: 6031
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6031
Author:   chicares
Date:     2014-11-07 12:05:26 +0000 (Fri, 07 Nov 2014)
Log Message:
-----------
Refactor to facilitate GUI-test automation

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/skeleton.cpp
    lmi/trunk/skeleton.hpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-11-07 01:22:20 UTC (rev 6030)
+++ lmi/trunk/ChangeLog 2014-11-07 12:05:26 UTC (rev 6031)
@@ -34617,3 +34617,10 @@
 Fix a problem with 'USE_SO_ATTRIBUTES=1'. See:
   http://lists.nongnu.org/archive/html/lmi/2014-10/msg00118.html
 
+20141107T1205Z <address@hidden> [516]
+
+  skeleton.cpp
+  skeleton.hpp
+Refactor to facilitate GUI-test automation. See:
+  http://lists.nongnu.org/archive/html/lmi/2014-11/msg00010.html
+

Modified: lmi/trunk/skeleton.cpp
===================================================================
--- lmi/trunk/skeleton.cpp      2014-11-07 01:22:20 UTC (rev 6030)
+++ lmi/trunk/skeleton.cpp      2014-11-07 12:05:26 UTC (rev 6031)
@@ -268,13 +268,24 @@
     return argument;
 }
 
+/// Create the MDI document manager.
+///
+/// This uses 'new' rather than 'new(wx)' because the object is
+/// explicitly deleted in OnExit().
+
+DocManagerEx* Skeleton::CreateDocManager()
+{
+    return new DocManagerEx;
+}
+
 void Skeleton::InitDocManager()
 {
-    // WX !! At least in wx-2.5.1, this can't be created in the
-    // constructor, because that would try to create an instance of
-    // class wxPageSetupDialogData, which apparently mustn't be done
-    // before the application object is constructed.
-    doc_manager_ = new DocManagerEx;
+    // WX !! At least in wx-2.5.1, the DocManagerEx instance must be
+    // created here. It can't be instantiated in the constructor
+    // because it creates a wxPageSetupDialogData instance, which
+    // apparently mustn't be done before the application object has
+    // been constructed.
+    doc_manager_ = CreateDocManager();
     doc_manager_->FileHistoryLoad(*config_);
 
     new(wx) wxDocTemplate

Modified: lmi/trunk/skeleton.hpp
===================================================================
--- lmi/trunk/skeleton.hpp      2014-11-07 01:22:20 UTC (rev 6030)
+++ lmi/trunk/skeleton.hpp      2014-11-07 12:05:26 UTC (rev 6031)
@@ -62,6 +62,9 @@
     wxMDIChildFrame* CreateChildFrame(wxDocument*, ViewEx*);
 
   protected:
+    // Virtual functions that are overridden in gui test.
+    virtual DocManagerEx* CreateDocManager();
+
     // wxApp overrides that are further overridden in gui test.
     virtual void OnAssertFailure
         (wxChar const* file




reply via email to

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