mailr13078 - /branches/gui_testing/gui/wizard.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 17, 2011 - 10:11:
Author: bugman
Date: Fri Jun 17 10:11:50 2011
New Revision: 13078

URL: http://svn.gna.org/viewcvs/relax?rev=13078&view=rev
Log:
Created the add_page() and run() methods for the Wiz_window class.

These are currently non-functional.


Modified:
    branches/gui_testing/gui/wizard.py

Modified: branches/gui_testing/gui/wizard.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13078&r1=13077&r2=13078&view=diff
==============================================================================
--- branches/gui_testing/gui/wizard.py (original)
+++ branches/gui_testing/gui/wizard.py Fri Jun 17 10:11:50 2011
@@ -751,12 +751,8 @@
     size_y = 400
     frame_title = ''
 
-    def __init__(self, gui, interpreter, style=wx.DEFAULT_DIALOG_STYLE):
+    def __init__(self, style=wx.DEFAULT_DIALOG_STYLE):
         """Set up the window."""
-
-        # Store the args.
-        self.gui = gui
-        self.interpreter = interpreter
 
         # Execute the base class method.
         wx.Dialog.__init__(self, None, id=-1, title=self.frame_title, 
style=style)
@@ -770,3 +766,33 @@
 
         # Centre the dialog.
         self.Centre()
+
+        # Initialise the page storage.
+        self.pages = []
+
+
+    def add_page(self, panel):
+        """Add a new page to the wizard.
+
+        @param panel:   The page to add to the wizard.
+        @type panel:    wx.Panel instance
+        """
+
+        # Append the page.
+        self.pages.append(panel)
+
+
+    def run(self):
+        """Execute the wizard."""
+
+        # Loop over the pages.
+        for i in range(len(self.pages)):
+            # Destroy all of the original contents.
+            self.main_sizer.Clear(deleteWindows=True)
+
+            # Add the page.
+            self.main_sizer.Add(self.pages[i])
+
+            # Re-perform the window layout.
+            self.Layout()
+            self.Refresh()




Related Messages


Powered by MHonArc, Updated Fri Jun 17 10:20:02 2011