mailr13484 - /branches/gui_testing/gui/wizard.py


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

Header


Content

Posted by edward on July 07, 2011 - 12:18:
Author: bugman
Date: Thu Jul  7 12:18:02 2011
New Revision: 13484

URL: http://svn.gna.org/viewcvs/relax?rev=13484&view=rev
Log:
The wizard page file_selection() method now accepts the tooltip arg.


Modified:
    branches/gui_testing/gui/wizard.py

Modified: branches/gui_testing/gui/wizard.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13484&r1=13483&r2=13484&view=diff
==============================================================================
--- branches/gui_testing/gui/wizard.py (original)
+++ branches/gui_testing/gui/wizard.py Thu Jul  7 12:18:02 2011
@@ -487,7 +487,7 @@
         return combo
 
 
-    def file_selection(self, sizer, desc, title='File selection', 
default="all files (*.*)|*"):
+    def file_selection(self, sizer, desc, title='File selection', 
default="all files (*.*)|*", tooltip=None):
         """Build the file selection element.
 
         @param sizer:       The sizer to put the input field into.
@@ -498,6 +498,8 @@
         @type title:        str
         @keyword default:   The default file type.
         @type default:      str
+        @keyword tooltip:   The tooltip which appears on hovering over all 
the GUI elements.
+        @type tooltip:      str
         @return:            The file selection GUI element.
         @rtype:             wx.TextCtrl
         """
@@ -523,7 +525,6 @@
 
         # The file selection button.
         button = wx.BitmapButton(self, -1, wx.Bitmap(paths.icon_16x16.open, 
wx.BITMAP_TYPE_ANY))
-        button.SetToolTipString("Select the file")
         button.SetMinSize((27, 27))
         sub_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0)
         self.Bind(wx.EVT_BUTTON, obj.select, button)
@@ -531,6 +532,14 @@
         # Add to the main sizer (followed by stretchable spacing).
         sizer.Add(sub_sizer)
         sizer.AddStretchSpacer()
+
+        # Tooltip.
+        if tooltip:
+            text.SetToolTipString(tooltip)
+            field.SetToolTipString(tooltip)
+            button.SetToolTipString(tooltip)
+        else:
+            button.SetToolTipString("Select the file.")
 
         # Return the field element.
         return field




Related Messages


Powered by MHonArc, Updated Thu Jul 07 12:40:01 2011