mailr13419 - /branches/gui_testing/gui/analyses/base.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 05, 2011 - 17:11:
Author: bugman
Date: Tue Jul  5 17:11:29 2011
New Revision: 13419

URL: http://svn.gna.org/viewcvs/relax?rev=13419&view=rev
Log:
Modified the analysis page base class add_text_sel_element() method to set 
tooltips.

The tooltip arg is now accepted and the tooltip is set for all GUI elements 
that this method builds.


Modified:
    branches/gui_testing/gui/analyses/base.py

Modified: branches/gui_testing/gui/analyses/base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/base.py?rev=13419&r1=13418&r2=13419&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/base.py (original)
+++ branches/gui_testing/gui/analyses/base.py Tue Jul  5 17:11:29 2011
@@ -304,7 +304,7 @@
         return field
 
 
-    def add_text_sel_element(self, box, parent, text="", default="", 
button_text=" Change", control=wx.TextCtrl, icon=paths.icon_16x16.open, 
fn=None, editable=True, button=False):
+    def add_text_sel_element(self, box, parent, text="", default="", 
tooltip=None, button_text=" Change", control=wx.TextCtrl, 
icon=paths.icon_16x16.open, fn=None, editable=True, button=False):
         """Create a text selection element for the frame.
 
         This consists of a horizontal layout with a static text element, a 
text control, and an optional button.
@@ -317,6 +317,8 @@
         @type text:             str
         @keyword default:       The default text of the control.
         @type default:          str
+        @keyword tooltip:      The tooltip which appears on hovering over 
the text or input field.
+        @type tooltip:         str
         @keyword button_text:   The text to display on the button.
         @type button_text:      str
         @keyword control:       The control class to use.
@@ -360,7 +362,7 @@
                 fn = getattr(field, fn)
 
             # Add the button.
-            self.add_button_open(sizer, parent, icon=icon, text=button_text, 
fn=fn, width=self.width_button, height=size_horizontal)
+            button_open = self.add_button_open(sizer, parent, icon=icon, 
text=button_text, fn=fn, width=self.width_button, height=size_horizontal)
 
         # No button, so add a spacer.
         else:
@@ -368,6 +370,13 @@
 
         # Add the element to the box.
         box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0)
+
+        # Tooltip.
+        if tooltip:
+            label.SetToolTipString(tooltip)
+            field.SetToolTipString(tooltip)
+           if button:
+               button_open.SetToolTipString(tooltip)
 
         # Return the text control object.
         return field




Related Messages


Powered by MHonArc, Updated Tue Jul 05 17:20:02 2011