Author: bugman Date: Fri Jun 10 09:42:25 2011 New Revision: 12949 URL: http://svn.gna.org/viewcvs/relax?rev=12949&view=rev Log: Created the setup_analysis_element() base method for laying out the main analysis GUI element. This currently adds a border of 10 px around each analysis. Modified: 1.3/gui/analyses/base.py Modified: 1.3/gui/analyses/base.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/analyses/base.py?rev=12949&r1=12948&r2=12949&view=diff ============================================================================== --- 1.3/gui/analyses/base.py (original) +++ 1.3/gui/analyses/base.py Fri Jun 10 09:42:25 2011 @@ -32,10 +32,11 @@ """The base class for all frames.""" # Hard coded variables. + border = 10 size_graphic_panel = 200 + spacer_horizontal = 5 width_text = 240 width_button = 100 - spacer_horizontal = 5 def add_button_open(self, box, parent, fn=None, width=-1, height=-1): """Add a button for opening and changing files and directories. @@ -248,3 +249,34 @@ box.AddSpacer(10) box.Add(label) box.AddSpacer(5) + + + def setup_analysis_element(self, parent): + """Set up the specific analysis GUI element. + + @param parent: The parent GUI element. + @type parent: wx object + @return: The sizer object. + @rtype: wx.Sizer instance + """ + + # Some sizers. + sizer_hori = wx.BoxSizer(wx.HORIZONTAL) + sizer_vert = wx.BoxSizer(wx.VERTICAL) + sizer_cent = wx.BoxSizer(wx.HORIZONTAL) + + # Pack the sizer into the frame. + parent.SetSizer(sizer_hori) + + # Left and right borders. + sizer_hori.AddSpacer(self.border) + sizer_hori.Add(sizer_vert, 1, wx.EXPAND|wx.ALL) + sizer_hori.AddSpacer(self.border) + + # Top and bottom borders. + sizer_vert.AddSpacer(self.border) + sizer_vert.Add(sizer_cent, 1, wx.EXPAND|wx.ALL) + sizer_vert.AddSpacer(self.border) + + # Return the central sizer. + return sizer_cent