Author: bugman Date: Fri Jun 8 12:47:04 2012 New Revision: 16759 URL: http://svn.gna.org/viewcvs/relax?rev=16759&view=rev Log: Converted all of the list GUI element 'stretch' args to 'proportion'. Instead of a flag, this is now the direct window proportion parameter used in the wx.Sizer.Add() methods. This has been changed in the BMRB export window so that the central molecule list GUI element is half the size of the others. Modified: branches/uf_redesign/gui/components/base_list.py branches/uf_redesign/gui/components/spectrum.py branches/uf_redesign/gui/export_bmrb.py Modified: branches/uf_redesign/gui/components/base_list.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/components/base_list.py?rev=16759&r1=16758&r2=16759&view=diff ============================================================================== --- branches/uf_redesign/gui/components/base_list.py (original) +++ branches/uf_redesign/gui/components/base_list.py Fri Jun 8 12:47:04 2012 @@ -43,7 +43,7 @@ class Base_list(object): """The GUI element for listing the software used in the analysis.""" - def __init__(self, gui=None, parent=None, box=None, id=None, stretch=False, button_placement='default'): + def __init__(self, gui=None, parent=None, box=None, id=None, proportion=0, button_placement='default'): """Build the base list GUI element. @keyword gui: The main GUI object. @@ -54,8 +54,8 @@ @type box: wx.BoxSizer instance @keyword id: A unique identification string. This is used to register the update method with the GUI user function observer object. @type id: str - @keyword stretch: A flag which if True will allow the static box to stretch with the window. - @type stretch: bool + @keyword proportion: The window proportion parameter. + @type proportion: bool @keyword button_placement: Override the button visibility and placement. The value of 'default' will leave the buttons at the default setting. The value of 'top' will place the buttons at the top, 'bottom' will place them at the bottom, and None will turn off the buttons. @type button_placement: str or None """ @@ -63,7 +63,7 @@ # Store the arguments. self.gui = gui self.parent = parent - self.stretch = stretch + self.proportion = proportion # Variables to be overridden. self.title = "" @@ -83,11 +83,6 @@ if button_placement != 'default': self.button_placement = button_placement - # Stretching. - self.proportion = 0 - if stretch: - self.proportion = 1 - # First create a panel (to allow for tooltips on the buttons). self.panel = wx.Panel(self.parent) box.Add(self.panel, self.proportion, wx.ALL|wx.EXPAND, 0) @@ -217,7 +212,7 @@ wx.PostEvent(self.parent.GetEventHandler(), event) # Set the minimum height. - if not self.stretch: + if not self.proportion: # The number of rows. n = self.element.GetItemCount() Modified: branches/uf_redesign/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/components/spectrum.py?rev=16759&r1=16758&r2=16759&view=diff ============================================================================== --- branches/uf_redesign/gui/components/spectrum.py (original) +++ branches/uf_redesign/gui/components/spectrum.py Fri Jun 8 12:47:04 2012 @@ -46,7 +46,7 @@ class Spectra_list(Base_list): """The GUI element for listing loaded spectral data.""" - def __init__(self, gui=None, parent=None, box=None, id=None, fn_add=None, stretch=False, button_placement='default'): + def __init__(self, gui=None, parent=None, box=None, id=None, fn_add=None, proportion=0, button_placement='default'): """Build the spectral list GUI element. @keyword gui: The main GUI object. @@ -61,8 +61,8 @@ @type id: str @keyword fn_add: The function to execute when clicking on the 'Add' button. @type fn_add: func - @keyword stretch: A flag which if True will allow the static box to stretch with the window. - @type stretch: bool + @keyword proportion: The window proportion parameter. + @type proportion: bool @keyword button_placement: Override the button visibility and placement. The value of 'default' will leave the buttons at the default setting. The value of 'top' will place the buttons at the top, 'bottom' will place them at the bottom, and None will turn off the buttons. @type button_placement: str or None """ @@ -71,7 +71,7 @@ self.fn_add = fn_add # Initialise the base class. - super(Spectra_list, self).__init__(gui=gui, parent=parent, box=box, id=id, stretch=stretch, button_placement=button_placement) + super(Spectra_list, self).__init__(gui=gui, parent=parent, box=box, id=id, proportion=proportion, button_placement=button_placement) def action_relax_fit_relax_time(self, event): Modified: branches/uf_redesign/gui/export_bmrb.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/export_bmrb.py?rev=16759&r1=16758&r2=16759&view=diff ============================================================================== --- branches/uf_redesign/gui/export_bmrb.py (original) +++ branches/uf_redesign/gui/export_bmrb.py Fri Jun 8 12:47:04 2012 @@ -88,13 +88,13 @@ sizer.AddSpacer(self.main_spacing) # Add the relaxation data metadata list GUI element. - self.relax_data = Relax_data_meta_list(parent=self.main_panel, box=sizer, id='BMRB export', stretch=True) + self.relax_data = Relax_data_meta_list(parent=self.main_panel, box=sizer, id='BMRB export', proportion=2) # Spacing. sizer.AddSpacer(self.main_spacing) # Add the molecule GUI element. - self.molecule = Molecule(parent=self.main_panel, box=sizer, id='BMRB export', stretch=True) + self.molecule = Molecule(parent=self.main_panel, box=sizer, id='BMRB export', proportion=1) # Spacing. sizer.AddSpacer(self.main_spacing) @@ -103,22 +103,22 @@ sub_sizer = wx.BoxSizer(wx.HORIZONTAL) # Add the software GUI element. - self.software = Software(parent=self.main_panel, box=sub_sizer, id='BMRB export', stretch=True) + self.software = Software(parent=self.main_panel, box=sub_sizer, id='BMRB export', proportion=1) # Vertical spacing. sub_sizer.AddSpacer(self.main_spacing) # Add the scripts GUI element. - self.scripts = Scripts(parent=self.main_panel, box=sub_sizer, id='BMRB export', stretch=True) + self.scripts = Scripts(parent=self.main_panel, box=sub_sizer, id='BMRB export', proportion=1) # Vertical spacing. sub_sizer.AddSpacer(self.main_spacing) # Add the citation GUI element. - self.citation = Citations(parent=self.main_panel, box=sub_sizer, id='BMRB export', stretch=True) + self.citation = Citations(parent=self.main_panel, box=sub_sizer, id='BMRB export', proportion=1) # Add the sizer. - sizer.Add(sub_sizer, 1, wx.ALL|wx.EXPAND, 0) + sizer.Add(sub_sizer, 2, wx.ALL|wx.EXPAND, 0) # Bottom spacing. sizer.AddSpacer(5)