Author: bugman Date: Thu Jan 28 20:37:09 2010 New Revision: 10565 URL: http://svn.gna.org/viewcvs/relax?rev=10565&view=rev Log: Shifted the structure file selection GUI element into the add_structure_selection() method. Modified: branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py Modified: branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py?rev=10565&r1=10564&r2=10565&view=diff ============================================================================== --- branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py (original) +++ branches/bieri_gui/gui_bieri/analyses/auto_rx_base.py Thu Jan 28 20:37:09 2010 @@ -176,7 +176,6 @@ grid_sizer_1 = wx.FlexGridSizer(10, 2, 0, 0) sizer_13 = wx.BoxSizer(wx.VERTICAL) nmr_freq_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL) - results_dir_copy_copy_copy = wx.BoxSizer(wx.HORIZONTAL) sizer_5_copy_1 = wx.BoxSizer(wx.HORIZONTAL) sizer_6_copy_1 = wx.BoxSizer(wx.VERTICAL) exec_relax_copy_1 = wx.BoxSizer(wx.HORIZONTAL) @@ -187,10 +186,6 @@ sizer_8_copy_copy_copy_copy_1 = wx.BoxSizer(wx.HORIZONTAL) sizer_11.Add(results_dir_copy_copy, 1, wx.EXPAND, 0) - results_dir_copy_copy_copy.Add(self.structure_file, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) - results_dir_copy_copy_copy.Add(self.structure_r11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) - results_dir_copy_copy_copy.Add(self.results_directory_copy_copy_copy, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 10) - sizer_11.Add(results_dir_copy_copy_copy, 1, wx.EXPAND, 0) nmr_freq_copy_copy_copy.Add(self.label_2_copy_copy_copy_2_copy_copy, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) nmr_freq_copy_copy_copy.Add(self.unresolved_r11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) sizer_11.Add(nmr_freq_copy_copy_copy, 0, wx.EXPAND|wx.SHAPED, 0) @@ -253,9 +248,6 @@ self.label_2_copy_copy_5.SetMinSize((230, 17)) self.label_2_copy_copy_2_copy_1.SetMinSize((230, 17)) self.label_2_copy_copy_3_copy_1.SetMinSize((230, 17)) - self.structure_file.SetMinSize((230, 17)) - self.structure_r11.SetMinSize((350, 27)) - self.results_directory_copy_copy_copy.SetMinSize((103, 27)) self.label_2_copy_copy_copy_2_copy_copy.SetMinSize((230, 17)) self.unresolved_r11.SetMinSize((350, 27)) self.panel_2.SetMinSize((688, 5)) @@ -407,6 +399,37 @@ box.Add(sizer, 0, wx.EXPAND|wx.SHAPED, 0) + def add_structure_selection(self, box): + """Create and add the structure file selection GUI element to the given box. + + @param box: The box element to pack the structure file selection GUI element into. + @type box: wx.BoxSizer instance + """ + + # Horizontal packing for this element. + sizer = wx.BoxSizer(wx.HORIZONTAL) + + # The label. + label = wx.StaticText(self.parent, -1, "Structure file (.pdb)", style=wx.ALIGN_RIGHT) + label.SetMinSize((230, 17)) + sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) + + # The text input field. + self.field_structure = StructureTextCtrl(self.parent, -1, self.gui.structure_file_pdb_msg) + self.field_structure.SetEditable(False) + self.field_structure.SetMinSize((350, 27)) + sizer.Add(self.field_structure, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) + + # The button. + button = wx.Button(self.parent, -1, "Change") + button.SetMinSize((103, 27)) + self.gui.Bind(wx.EVT_BUTTON, self.field_structure.open_file, button) + sizer.Add(button, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 10) + + # Add the element to the box. + box.Add(sizer, 1, wx.EXPAND, 0) + + def build_main_box(self): """Construct the highest level box to pack into the automatic Rx analysis frame. @@ -448,10 +471,9 @@ # Add the results directory GUI element. self.add_results_dir(box) - self.structure_file = wx.StaticText(self.parent, -1, "Structure file (.pdb)", style=wx.ALIGN_RIGHT) - self.structure_r11 = StructureTextCtrl(self.parent, -1, self.gui.structure_file_pdb_msg) - self.structure_r11.SetEditable(False) - self.results_directory_copy_copy_copy = wx.Button(self.parent, -1, "Change") + # Add the structure file selection GUI element. + self.add_structure_selection(box) + self.label_2_copy_copy_copy_2_copy_copy = wx.StaticText(self.parent, -1, "Unresolved residues:", style=wx.ALIGN_RIGHT) self.unresolved_r11 = wx.TextCtrl(self.parent, -1, "") self.panel_2 = wx.Panel(self.parent, -1) @@ -491,7 +513,6 @@ self.relax_start_r1_1 = wx.BitmapButton(self.parent, -1, wx.Bitmap(IMAGE_PATH+'relax_start.gif', wx.BITMAP_TYPE_ANY)) #button actions - self.gui.Bind(wx.EVT_BUTTON, self.structure_r11.open_file, self.results_directory_copy_copy_copy) self.gui.Bind(wx.EVT_BUTTON, self.add_r1_1, self.addr11) self.gui.Bind(wx.EVT_BUTTON, self.refresh_r1_1, self.refreshr11) @@ -518,7 +539,7 @@ relax_times_r2_1[13] = str(self.r2_time_14.GetValue()) start_relax = exec_relax() if start_relax == True: - start_rx(self.resultsdir_r21.GetValue(), r2_list, relax_times_r2_1, self.structure_r11.GetValue(), self.nmrfreq_value_r11.GetValue(), 2, 1, self.unresolved_r11.GetValue(), self, 1, global_setting, file_setting, sequencefile) + start_rx(self.resultsdir_r21.GetValue(), r2_list, relax_times_r2_1, self.field_structure.GetValue(), self.nmrfreq_value_r11.GetValue(), 2, 1, self.unresolved_r11.GetValue(), self, 1, global_setting, file_setting, sequencefile) event.Skip()