Author: bugman Date: Thu Jun 9 12:41:41 2011 New Revision: 12914 URL: http://svn.gna.org/viewcvs/relax?rev=12914&view=rev Log: Regularisation of the fonts, titles, and subtitles in the Rx auto-analysis frames. Modified: 1.3/gui/analyses/auto_rx_base.py 1.3/gui/components/spectrum.py Modified: 1.3/gui/analyses/auto_rx_base.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/analyses/auto_rx_base.py?rev=12914&r1=12913&r2=12914&view=diff ============================================================================== --- 1.3/gui/analyses/auto_rx_base.py (original) +++ 1.3/gui/analyses/auto_rx_base.py Thu Jun 9 12:41:41 2011 @@ -35,6 +35,7 @@ # relax module imports. from auto_analyses.relax_fit import Relax_fit from data import Relax_data_store; ds = Relax_data_store() +from gui.analyses.base import Base_frame from relax_io import DummyFileObject from status import Status; status = Status() from gui import paths @@ -51,7 +52,7 @@ -class Auto_rx: +class Auto_rx(Base_frame): """The base class for the R1 and R2 frames.""" # Hardcoded variables. @@ -83,9 +84,6 @@ main_box = self.build_main_box() self.parent.SetSizer(main_box) - # Set the frame font size. - self.parent.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - def add_execute_relax(self, box): """Create and add the relax execution GUI element to the given box. @@ -100,6 +98,7 @@ # The label. label = wx.StaticText(self.parent, -1, "Execute relax ", style=wx.ALIGN_RIGHT) label.SetMinSize((118, 17)) + label.SetFont(self.gui.font_normal) sizer.Add(label, 0, wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) # The button. @@ -113,23 +112,6 @@ box.Add(sizer, 0, wx.ALIGN_RIGHT, 0) - def add_frame_title(self, box): - """Create and add the frame title to the given box. - - @param box: The box element to pack the frame title into. - @type box: wx.BoxSizer instance - """ - - # The title. - label = wx.StaticText(self.parent, -1, "Setup for %s relaxation analysis" % self.label) - - # The font properties. - label.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Sans")) - - # Pack the title. - box.Add(label, 0, wx.BOTTOM|wx.ADJUST_MINSIZE, 18) - - def add_frq(self, box): """Create and add the frequency selection GUI element to the given box. @@ -141,8 +123,9 @@ sizer = wx.BoxSizer(wx.HORIZONTAL) # The label. - label = wx.StaticText(self.parent, -1, "NMR Frequency [MHz]:", style=wx.ALIGN_RIGHT) + label = wx.StaticText(self.parent, -1, "NMR Frequency [MHz]") label.SetMinSize((230, 17)) + label.SetFont(self.gui.font_normal) sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) # The text input field. @@ -165,8 +148,9 @@ sizer = wx.BoxSizer(wx.HORIZONTAL) # The label. - label = wx.StaticText(self.parent, -1, "Results directory", style=wx.ALIGN_RIGHT) + label = wx.StaticText(self.parent, -1, "Results directory") label.SetMinSize((230, 17)) + label.SetFont(self.gui.font_normal) sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) # The text input field. @@ -195,8 +179,9 @@ sizer = wx.BoxSizer(wx.HORIZONTAL) # The label. - label = wx.StaticText(self.parent, -1, "Sequence file", style=wx.ALIGN_RIGHT) + label = wx.StaticText(self.parent, -1, "Sequence file") label.SetMinSize((230, 17)) + label.SetFont(self.gui.font_normal) sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) # The text input field. @@ -226,8 +211,9 @@ sizer = wx.BoxSizer(wx.HORIZONTAL) # The label. - label = wx.StaticText(self.parent, -1, "Sequence from PDB structure file", style=wx.ALIGN_RIGHT) + label = wx.StaticText(self.parent, -1, "Sequence from PDB structure file") label.SetMinSize((230, 17)) + label.SetFont(self.gui.font_normal) sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) # The text input field. @@ -257,8 +243,9 @@ sizer = wx.BoxSizer(wx.HORIZONTAL) # The label. - label = wx.StaticText(self.parent, -1, "Unresolved residues:", style=wx.ALIGN_RIGHT) + label = wx.StaticText(self.parent, -1, "Unresolved residues") label.SetMinSize((230, 17)) + label.SetFont(self.gui.font_normal) sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) # The text input field. @@ -386,7 +373,7 @@ box = wx.BoxSizer(wx.VERTICAL) # Add the frame title. - self.add_frame_title(box) + self.add_title(box, "Setup for %s relaxation analysis" % self.label) # Add the frequency selection GUI element. self.add_frq(box) @@ -404,7 +391,7 @@ self.add_unresolved_spins(box) # Add the peak list selection GUI element. - self.peak_intensity = Peak_intensity(gui=self.gui, parent=self.parent, data=self.data, label=self.label, box=box) + self.peak_intensity = Peak_intensity(gui=self.gui, parent=self.parent, subparent=self, data=self.data, label=self.label, box=box) # Add the execution GUI element. self.add_execute_relax(box) Modified: 1.3/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/components/spectrum.py?rev=12914&r1=12913&r2=12914&view=diff ============================================================================== --- 1.3/gui/components/spectrum.py (original) +++ 1.3/gui/components/spectrum.py Thu Jun 9 12:41:41 2011 @@ -207,13 +207,15 @@ class Peak_intensity: """The peak list selection class.""" - def __init__(self, gui=None, parent=None, data=None, label=None, width=688, height=300, box=None): + def __init__(self, gui=None, parent=None, subparent=None, data=None, label=None, width=688, height=300, box=None): """Build the peak list reading GUI element. @keyword gui: The main GUI object. @type gui: wx.Frame instance - @keyword parent: The parent GUI element that this is to be attached to. + @keyword parent: The parent GUI element that this is to be attached to (the panel object). @type parent: wx object + @keyword subparent: The subparent GUI element that this is to be attached to (the analysis object). + @type subparent: wx object @keyword data: The data storage container. @type data: class instance @keyword label: The type of analysis. @@ -229,6 +231,7 @@ # Store the arguments. self.gui = gui self.parent = parent + self.subparent = subparent self.data = data self.label = label @@ -239,7 +242,7 @@ self.num_rows = 50 # Add peak list selection header. - self.add_header(box) + self.subparent.add_subtitle(box, "Data points") # Add the cycle delay time element. self.add_cycle_delay(box) @@ -370,26 +373,6 @@ # Add grid to sizer, with spacing. sizer.Add(self.grid, -1, wx.EXPAND, 0) - - - def add_header(self, box): - """Add header for peak list section - - @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, "\nData points:", style=wx.ALIGN_RIGHT) - label.SetMinSize((230, 40)) - label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) - sizer.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) - - # Add the element to the box. - box.Add(sizer, 0, wx.ADJUST_MINSIZE, 0) def change_delay_down(self, event):