Author: bugman Date: Fri Dec 10 18:06:32 2010 New Revision: 11764 URL: http://svn.gna.org/viewcvs/relax?rev=11764&view=rev Log: The pipe.create user function menu entry and window have been created. Added: branches/bieri_gui/gui_bieri/user_functions/pipes.py - copied, changed from r11763, branches/bieri_gui/gui_bieri/user_functions/molecule.py Modified: branches/bieri_gui/gui_bieri/menu.py branches/bieri_gui/gui_bieri/user_functions/__init__.py Modified: branches/bieri_gui/gui_bieri/menu.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/menu.py?rev=11764&r1=11763&r2=11764&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/menu.py (original) +++ branches/bieri_gui/gui_bieri/menu.py Fri Dec 10 18:06:32 2010 @@ -194,7 +194,10 @@ [id_base + 000, "&molecule", paths.icon_16x16.molecule, None, [ [id_base + 001, "&add", paths.icon_16x16.add, self.gui.user_functions.molecule.add] ]], - [id_base + 100, "&script", paths.icon_16x16.uf_script, self.gui.user_functions.script.run, []] + [id_base + 100, "&pipe", paths.icon_16x16.load, None, [ + [id_base + 101, "&create", paths.icon_16x16.add, self.gui.user_functions.pipes.create] + ]], + [id_base + 200, "&script", paths.icon_16x16.uf_script, self.gui.user_functions.script.run, []] ] # Build. Modified: branches/bieri_gui/gui_bieri/user_functions/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/__init__.py?rev=11764&r1=11763&r2=11764&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/user_functions/__init__.py (original) +++ branches/bieri_gui/gui_bieri/user_functions/__init__.py Fri Dec 10 18:06:32 2010 @@ -28,12 +28,14 @@ # GUI module imports. from molecule import Molecule +from pipes import Pipes from script import Script # The package __all__ list. __all__ = ['base', 'molecule', + 'pipes', 'script'] @@ -53,6 +55,7 @@ # The user functions. self.molecule = Molecule(self.gui, self.interpreter) + self.pipes = Pipes(self.gui, self.interpreter) self.script = Script(self.gui, self.interpreter) @@ -61,3 +64,4 @@ # Send the commands onwards to the user function classes. self.molecule.destroy() + self.pipes.destroy() Copied: branches/bieri_gui/gui_bieri/user_functions/pipes.py (from r11763, branches/bieri_gui/gui_bieri/user_functions/molecule.py) URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/pipes.py?p2=branches/bieri_gui/gui_bieri/user_functions/pipes.py&p1=branches/bieri_gui/gui_bieri/user_functions/molecule.py&r1=11763&r2=11764&rev=11764&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/user_functions/molecule.py (original) +++ branches/bieri_gui/gui_bieri/user_functions/pipes.py Fri Dec 10 18:06:32 2010 @@ -21,13 +21,13 @@ ############################################################################### # Module docstring. -"""The molecule user function GUI elements.""" +"""The pipes user function GUI elements.""" # Python module imports. import wx # relax module imports. -from generic_fns.mol_res_spin import ALLOWED_MOL_TYPES +from generic_fns.pipes import VALID_TYPES # GUI module imports. from base import UF_base, UF_window @@ -35,60 +35,60 @@ # The container class. -class Molecule(UF_base): +class Pipes(UF_base): """The container class for holding all GUI elements.""" def setup(self): """Place all the GUI classes into this class for storage.""" # The dialogs. - self._add_window = Add_window(self.gui, self.interpreter) + self._create_window = Add_window(self.gui, self.interpreter) - def add(self, event): - """The molecule.add user function. + def create(self, event): + """The pipe.create user function. @param event: The wx event. @type event: wx event """ - self._add_window.Show() + self._create_window.Show() def destroy(self): """Close all windows.""" - self._add_window.Destroy() + self._create_window.Destroy() class Add_window(UF_window): - """The molecule.add() user function window.""" + """The pipe.create() user function window.""" # Some class variables. size_x = 600 size_y = 400 - frame_title = 'Add a molecule' + frame_title = 'Add a data pipe' image_path = WIZARD_IMAGE_PATH + 'molecule.png' - main_text = 'This dialog allows you to add new molecules to the relax data store. The molecule will be added to the current data pipe.' - title = 'Addition of new molecules' + main_text = 'This dialog allows you to add new data pipes to the relax data store.' + title = 'Addition of new data pipes' # Some private class variables. _spacing = 20 - def _evt_mol_type(self, event): - """Selection of the molecule type. + def _evt_pipe_type(self, event): + """Selection of the pipe type. @param event: The wx event. @type event: wx event """ # Store the choice. - self.mol_type = str(event.GetString()) + self.pipe_type = str(event.GetString()) def add_uf(self, sizer): - """Add the molecule specific GUI elements. + """Add the pipe specific GUI elements. @param sizer: A sizer object. @type sizer: wx.Sizer instance @@ -97,14 +97,14 @@ # Spacer. sizer.AddSpacer(self._spacing) - # The molecule name input. - sizer.Add(self.mol_name_element(), 1, wx.ALIGN_TOP|wx.SHAPED, self.border) + # The pipe name input. + sizer.Add(self.pipe_name_element(), 1, wx.ALIGN_TOP|wx.SHAPED, self.border) # Spacer. sizer.AddSpacer(self._spacing) # The type selection. - sizer.Add(self.mol_type_element(), 1, wx.ALIGN_TOP, self.border) + sizer.Add(self.pipe_type_element(), 1, wx.ALIGN_TOP, self.border) # Spacer. sizer.AddSpacer(self._spacing) @@ -114,14 +114,14 @@ """Execute the user function.""" # Get the name and type. - mol_name = str(self.mol_name.GetValue()) + pipe_name = str(self.pipe_name.GetValue()) # Set the name. - self.interpreter.molecule.create(mol_name=mol_name, type=self.mol_type) + self.interpreter.pipe.create(pipe_name=pipe_name, pipe_type=self.pipe_type) - def mol_name_element(self): - """Build the molecule name element. + def pipe_name_element(self): + """Build the pipe name element. @return: The box sizer. @rtype: wx.Sizer instance @@ -130,21 +130,21 @@ # Init. sizer = wx.BoxSizer(wx.HORIZONTAL) - # The molecule name. - text = wx.StaticText(self, -1, "The name of the molecule:", style=wx.ALIGN_RIGHT) + # The pipe name. + text = wx.StaticText(self, -1, "The data pipe name:", style=wx.ALIGN_RIGHT) sizer.Add(text, 1, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, self.border) # The input field. - self.mol_name = wx.TextCtrl(self, -1, '') - self.mol_name.SetMinSize((50, self.input_size)) - sizer.Add(self.mol_name, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, self.border) + self.pipe_name = wx.TextCtrl(self, -1, '') + self.pipe_name.SetMinSize((50, self.input_size)) + sizer.Add(self.pipe_name, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, self.border) # Return the sizer. return sizer - def mol_type_element(self): - """Build the molecule type element. + def pipe_type_element(self): + """Build the pipe type element. @return: The box sizer. @rtype: wx.Sizer instance @@ -153,14 +153,14 @@ # Init. sizer = wx.BoxSizer(wx.HORIZONTAL) - # The molecule typ. - text = wx.StaticText(self, -1, "The type of molecule:", style=wx.ALIGN_LEFT) + # The pipe type. + text = wx.StaticText(self, -1, "The type of data pipe:", style=wx.ALIGN_LEFT) sizer.Add(text, 1, wx.LEFT, self.border) # The input field. - type_choice = wx.Choice(self, -1, style=wx.ALIGN_LEFT, choices=[''] + ALLOWED_MOL_TYPES) + type_choice = wx.Choice(self, -1, style=wx.ALIGN_LEFT, choices=[''] + VALID_TYPES) sizer.Add(type_choice, 1, wx.LEFT, self.border) - self.Bind(wx.EVT_CHOICE, self._evt_mol_type, type_choice) + self.Bind(wx.EVT_CHOICE, self._evt_pipe_type, type_choice) # Return the sizer. return sizer