mailr13807 - in /branches/gui_testing/gui: menu.py user_functions/pipe.py


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

Header


Content

Posted by edward on July 21, 2011 - 14:49:
Author: bugman
Date: Thu Jul 21 14:49:29 2011
New Revision: 13807

URL: http://svn.gna.org/viewcvs/relax?rev=13807&view=rev
Log:
Created the pipe.hybridise user function page and menu entry.


Modified:
    branches/gui_testing/gui/menu.py
    branches/gui_testing/gui/user_functions/pipe.py

Modified: branches/gui_testing/gui/menu.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/menu.py?rev=13807&r1=13806&r2=13807&view=diff
==============================================================================
--- branches/gui_testing/gui/menu.py (original)
+++ branches/gui_testing/gui/menu.py Thu Jul 21 14:49:29 2011
@@ -182,6 +182,7 @@
                 [wx.NewId(), "&copy",   paths.icon_16x16.copy, 
self.gui.user_functions.pipe.copy],
                 [wx.NewId(), "crea&te", paths.icon_16x16.add, 
self.gui.user_functions.pipe.create],
                 [wx.NewId(), "&delete", paths.icon_16x16.remove, 
self.gui.user_functions.pipe.delete],
+                [wx.NewId(), "&hybridise", paths.icon_16x16.pipe_hybrid, 
self.gui.user_functions.pipe.hybridise],
                 [wx.NewId(), "&switch", paths.icon_16x16.pipe_switch, 
self.gui.user_functions.pipe.switch]
             ]],
             [wx.NewId(), "&relax_data", paths.icon_16x16.relax_data, None, [

Modified: branches/gui_testing/gui/user_functions/pipe.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/user_functions/pipe.py?rev=13807&r1=13806&r2=13807&view=diff
==============================================================================
--- branches/gui_testing/gui/user_functions/pipe.py (original)
+++ branches/gui_testing/gui/user_functions/pipe.py Thu Jul 21 14:49:29 2011
@@ -82,6 +82,20 @@
         wizard.run()
 
 
+    def hybridise(self, event):
+        """The pipe.hybridise user function.
+
+        @param event:   The wx event.
+        @type event:    wx event
+        """
+
+        # Execute the wizard.
+        wizard = Wiz_window(size_x=800, size_y=500, 
title=self.get_title('pipe', 'hybridise'))
+        page = Hybridise_page(wizard, self.gui)
+        wizard.add_page(page)
+        wizard.run()
+
+
     def switch(self, event):
         """The pipe.switch user function.
 
@@ -221,6 +235,40 @@
 
 
 
+class Hybridise_page(UF_page):
+    """The pipe.hybridise() user function page."""
+
+    # Some class variables.
+    image_path = WIZARD_IMAGE_PATH + 'pipe_hybrid.png'
+    uf_path = ['pipe', 'hybridise']
+
+
+    def add_contents(self, sizer):
+        """Add the pipe specific GUI elements.
+
+        @param sizer:   A sizer object.
+        @type sizer:    wx.Sizer instance
+        """
+
+        # The hybrid data pipe name input.
+        self.hybrid = self.input_field(sizer, "The hybrid pipe name:", 
tooltip=self.uf._doc_args_dict['hybrid'])
+
+        # The pipe selection.
+        self.pipes = self.combo_list(sizer, "The pipes to hybridise:", [[]], 
tooltip=self.uf._doc_args_dict['pipes'])
+
+
+    def on_execute(self):
+        """Execute the user function."""
+
+        # Get the name.
+        hybrid = gui_to_str(self.hybrid.GetValue())
+        pipes = gui_to_list(self.pipes.GetValue())
+
+        # Delete the data pipe.
+        self.gui.interpreter.pipe.hybridise(hybrid=hybrid, pipes=pipes)
+
+
+
 class Switch_page(UF_page):
     """The pipe.switch() user function page."""
 




Related Messages


Powered by MHonArc, Updated Thu Jul 21 16:40:03 2011