Author: bugman Date: Thu Jun 9 13:58:24 2011 New Revision: 12924 URL: http://svn.gna.org/viewcvs/relax?rev=12924&view=rev Log: Created the add_static_text() base class method for all the GUI frames to use. 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=12924&r1=12923&r2=12924&view=diff ============================================================================== --- 1.3/gui/analyses/base.py (original) +++ 1.3/gui/analyses/base.py Thu Jun 9 13:58:24 2011 @@ -30,6 +30,32 @@ class Base_frame: """The base class for all frames.""" + + def add_static_text(self, box, parent, text='', width=-1, height=-1): + """Add a text control field to the box. + + @param box: The box element to pack the control into. + @type box: wx.BoxSizer instance + @param parent: The parent GUI element. + @type parent: wx object + @keyword text: The default text of the control. + @type text: str + @keyword width: The minimum width of the control. + @type width: int + @keyword height: The minimum height of the control. + @type height: int + """ + + # The label. + label = wx.StaticText(parent, -1, text) + + # The font and label properties. + label.SetMinSize((width, height)) + label.SetFont(self.gui.font_normal) + + # Add the label to the box. + box.Add(label, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0) + def add_subtitle(self, box, text): """Create and add the subtitle.