mailr10536 - in /branches/bieri_gui/gui_bieri: analyses/auto_model_free.py relax_gui.py


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

Header


Content

Posted by edward on January 28, 2010 - 18:05:
Author: bugman
Date: Thu Jan 28 18:05:35 2010
New Revision: 10536

URL: http://svn.gna.org/viewcvs/relax?rev=10536&view=rev
Log:
Shifted the panel creation for the automatic model-free protocol into that 
module.

It was previously in relax_gui, but the auto_model_free module has references 
all over to it.  This
makes the code cleaner.


Modified:
    branches/bieri_gui/gui_bieri/analyses/auto_model_free.py
    branches/bieri_gui/gui_bieri/relax_gui.py

Modified: branches/bieri_gui/gui_bieri/analyses/auto_model_free.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_model_free.py?rev=10536&r1=10535&r2=10536&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/analyses/auto_model_free.py (original)
+++ branches/bieri_gui/gui_bieri/analyses/auto_model_free.py Thu Jan 28 
18:05:35 2010
@@ -47,11 +47,13 @@
 
 
 class Auto_model_free:
-    def __init__(self, gui):
+    def __init__(self, gui, notebook):
         """Build the automatic model-free protocol GUI element.
 
-        @param gui: The main GUI class.
-        @type gui:  gui_bieri.relax_gui.Main instance
+        @param gui:         The main GUI class.
+        @type gui:          gui_bieri.relax_gui.Main instance
+        @param notebook:    The notebook to pack this frame into.
+        @type notebook:     wx.Notebook instance
         """
 
         # Store the main class.
@@ -75,12 +77,15 @@
         self.data.structure_file = ''
         self.data.results_dir_model = getcwd()
 
+        # The parent GUI element for this class.
+        self.parent = wx.Panel(notebook, -1)
+
         # Build and pack the main sizer box, then add it to the automatic 
model-free analysis frame.
         main_box = self.build_main_box()
-        self.gui.modelfree.SetSizer(main_box)
+        self.parent.SetSizer(main_box)
 
         # Set the frame font size.
-        self.gui.modelfree.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, 
wx.NORMAL, 0, ""))
+        self.parent.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, 
""))
 
 
     def add_execute_relax(self, box):
@@ -91,8 +96,8 @@
         """
 
         # The elements.
-        label = wx.StaticText(self.gui.modelfree, -1, "Execute relax        
", style=wx.ALIGN_RIGHT)
-        button = wx.BitmapButton(self.gui.modelfree, -1, 
wx.Bitmap(IMAGE_PATH+'relax_start.gif', wx.BITMAP_TYPE_ANY))
+        label = wx.StaticText(self.parent, -1, "Execute relax        ", 
style=wx.ALIGN_RIGHT)
+        button = wx.BitmapButton(self.parent, -1, 
wx.Bitmap(IMAGE_PATH+'relax_start.gif', wx.BITMAP_TYPE_ANY))
 
         # Properties.
         label.SetMinSize((118, 17))
@@ -120,7 +125,7 @@
         """
 
         # The title.
-        label = wx.StaticText(self.gui.modelfree, -1, "Set-up for Model-free 
analysis:")
+        label = wx.StaticText(self.parent, -1, "Set-up for Model-free 
analysis:")
 
         # The font properties.
         label.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, 
"Sans"))
@@ -137,17 +142,17 @@
         """
 
         # The elements.
-        self.label_9 = wx.StaticText(self.gui.modelfree, -1, "Select 
Model-free models (default = all):")
-        self.m0 = wx.ToggleButton(self.gui.modelfree, -1, "m0")
-        self.m1 = wx.ToggleButton(self.gui.modelfree, -1, "m1")
-        self.m2 = wx.ToggleButton(self.gui.modelfree, -1, "m2")
-        self.m3 = wx.ToggleButton(self.gui.modelfree, -1, "m3")
-        self.m4 = wx.ToggleButton(self.gui.modelfree, -1, "m4")
-        self.m5 = wx.ToggleButton(self.gui.modelfree, -1, "m5")
-        self.m6 = wx.ToggleButton(self.gui.modelfree, -1, "m6")
-        self.m7 = wx.ToggleButton(self.gui.modelfree, -1, "m7")
-        self.m8 = wx.ToggleButton(self.gui.modelfree, -1, "m8")
-        self.m9 = wx.ToggleButton(self.gui.modelfree, -1, "m9")
+        self.label_9 = wx.StaticText(self.parent, -1, "Select Model-free 
models (default = all):")
+        self.m0 = wx.ToggleButton(self.parent, -1, "m0")
+        self.m1 = wx.ToggleButton(self.parent, -1, "m1")
+        self.m2 = wx.ToggleButton(self.parent, -1, "m2")
+        self.m3 = wx.ToggleButton(self.parent, -1, "m3")
+        self.m4 = wx.ToggleButton(self.parent, -1, "m4")
+        self.m5 = wx.ToggleButton(self.parent, -1, "m5")
+        self.m6 = wx.ToggleButton(self.parent, -1, "m6")
+        self.m7 = wx.ToggleButton(self.parent, -1, "m7")
+        self.m8 = wx.ToggleButton(self.parent, -1, "m8")
+        self.m9 = wx.ToggleButton(self.parent, -1, "m9")
 
         # Properties.
         self.m0.SetMinSize((70, 25))
@@ -217,9 +222,9 @@
         """
 
         # The elements.
-        self.label_10 = wx.StaticText(self.gui.modelfree, -1, "Select 
Model-free selection mode:      ")
-        self.aic = wx.RadioButton(self.gui.modelfree, -1, "AIC")
-        self.bic = wx.RadioButton(self.gui.modelfree, -1, "BIC")
+        self.label_10 = wx.StaticText(self.parent, -1, "Select Model-free 
selection mode:      ")
+        self.aic = wx.RadioButton(self.parent, -1, "AIC")
+        self.bic = wx.RadioButton(self.parent, -1, "BIC")
 
         # Properties.
         self.label_10.SetMinSize((240, 17))
@@ -248,10 +253,10 @@
         """
 
         # The elements.
-        self.text_structure = wx.StaticText(self.gui.modelfree, -1, 
"Structure file (.pdb)", style=wx.ALIGN_RIGHT)
-        self.textctrl_structure = StructureTextCtrl(self.gui.modelfree, -1, 
self.gui.structure_file_pdb_msg)
+        self.text_structure = wx.StaticText(self.parent, -1, "Structure file 
(.pdb)", style=wx.ALIGN_RIGHT)
+        self.textctrl_structure = StructureTextCtrl(self.parent, -1, 
self.gui.structure_file_pdb_msg)
         self.textctrl_structure.SetEditable(False)
-        button = wx.Button(self.gui.modelfree, -1, "Change")
+        button = wx.Button(self.parent, -1, "Change")
 
         # Properties.
         self.text_structure.SetMinSize((240, 17))
@@ -281,9 +286,9 @@
         """
 
         # Create the panel.
-        panel_4_copy_1 = wx.Panel(self.gui.modelfree, -1)
-        panel_4_copy = wx.Panel(self.gui.modelfree, -1)
-        panel_4 = wx.Panel(self.gui.modelfree, -1)
+        panel_4_copy_1 = wx.Panel(self.parent, -1)
+        panel_4_copy = wx.Panel(self.parent, -1)
+        panel_4 = wx.Panel(self.parent, -1)
 
         # The 1st panel contents.
         label_7 = wx.StaticText(panel_4, -1, "NMR freq 1:")
@@ -468,9 +473,9 @@
         """
 
         # The elements.
-        self.label_2_copy_copy_3_copy_copy_copy_copy_2 = 
wx.StaticText(self.gui.modelfree, -1, "Results directory", 
style=wx.ALIGN_RIGHT)
-        self.resultsdir_r21_copy_2 = wx.TextCtrl(self.gui.modelfree, -1, 
self.data.results_dir_model)
-        self.results_directory_r21_copy_2 = wx.Button(self.gui.modelfree, 
-1, "Change")
+        self.label_2_copy_copy_3_copy_copy_copy_copy_2 = 
wx.StaticText(self.parent, -1, "Results directory", style=wx.ALIGN_RIGHT)
+        self.resultsdir_r21_copy_2 = wx.TextCtrl(self.parent, -1, 
self.data.results_dir_model)
+        self.results_directory_r21_copy_2 = wx.Button(self.parent, -1, 
"Change")
 
         # Properties.
         results_dir_copy_copy_copy_1_copy_2 = wx.BoxSizer(wx.HORIZONTAL)
@@ -500,8 +505,8 @@
         """
 
         # The elements.
-        self.label_2_copy_copy_copy_2_copy_copy_copy_copy_1_copy = 
wx.StaticText(self.gui.modelfree, -1, "Unresolved residues:", 
style=wx.ALIGN_RIGHT)
-        self.unresolved_r21_copy_1_copy = wx.TextCtrl(self.gui.modelfree, 
-1, "")
+        self.label_2_copy_copy_copy_2_copy_copy_copy_copy_1_copy = 
wx.StaticText(self.parent, -1, "Unresolved residues:", style=wx.ALIGN_RIGHT)
+        self.unresolved_r21_copy_1_copy = wx.TextCtrl(self.parent, -1, "")
 
         # Properties.
         
self.label_2_copy_copy_copy_2_copy_copy_copy_copy_1_copy.SetMinSize((240, 17))
@@ -672,7 +677,7 @@
         box = wx.BoxSizer(wx.HORIZONTAL)
 
         # Add the model-free bitmap picture.
-        bitmap = wx.StaticBitmap(self.gui.modelfree, -1, 
wx.Bitmap(IMAGE_PATH+'modelfree.png', wx.BITMAP_TYPE_ANY))
+        bitmap = wx.StaticBitmap(self.parent, -1, 
wx.Bitmap(IMAGE_PATH+'modelfree.png', wx.BITMAP_TYPE_ANY))
         box.Add(bitmap, 0, wx.ADJUST_MINSIZE, 0)
 
         # Build the right hand box and pack it next to the bitmap.

Modified: branches/bieri_gui/gui_bieri/relax_gui.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/relax_gui.py?rev=10536&r1=10535&r2=10536&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/relax_gui.py (original)
+++ branches/bieri_gui/gui_bieri/relax_gui.py Thu Jan 28 18:05:35 2010
@@ -500,7 +500,7 @@
 
 
         # The automatic model-free protocol frame.
-        self.analysis_frames.append(Auto_model_free(self))
+        self.analysis_frames.append(Auto_model_free(self, self.notebook_2))
 
         ## results
         self.label_11 = wx.StaticText(self.results, -1, "NOE analysis")
@@ -1190,7 +1190,7 @@
         self.notebook_2.AddPage(self.frq1, "Frq. 1")
         self.notebook_2.AddPage(self.frq2, "Frq. 2")
         self.notebook_2.AddPage(self.frq3, "Frq. 3")
-        self.notebook_2.AddPage(self.modelfree, "Model-free")
+        self.notebook_2.AddPage(self.analysis_frames[0].parent, "Model-free")
         self.notebook_2.AddPage(self.results, "Results")
         sizer_8.Add(self.notebook_2, 1, wx.EXPAND, 0)
         self.SetSizer(sizer_8)
@@ -1746,7 +1746,6 @@
 
         self.notebook_2 = wx.Notebook(self, -1, style=wx.NB_LEFT)
         self.results = wx.Panel(self.notebook_2, -1)
-        self.modelfree = wx.Panel(self.notebook_2, -1)
         self.frq3 = wx.Panel(self.notebook_2, -1)
         self.notebook_3_copy_1 = wx.Notebook(self.frq3, -1, style=0)
         self.r2_1_copy_1 = wx.Panel(self.notebook_3_copy_1, -1)




Related Messages


Powered by MHonArc, Updated Thu Jan 28 18:20:03 2010