mailr20400 - /trunk/gui/analyses/elements/bool_element.py


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

Header


Content

Posted by edward on July 18, 2013 - 20:17:
Author: bugman
Date: Thu Jul 18 20:17:10 2013
New Revision: 20400

URL: http://svn.gna.org/viewcvs/relax?rev=20400&view=rev
Log:
The boolean GUI auto-analysis input element now has a SetValue() method.


Modified:
    trunk/gui/analyses/elements/bool_element.py

Modified: trunk/gui/analyses/elements/bool_element.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/gui/analyses/elements/bool_element.py?rev=20400&r1=20399&r2=20400&view=diff
==============================================================================
--- trunk/gui/analyses/elements/bool_element.py (original)
+++ trunk/gui/analyses/elements/bool_element.py Thu Jul 18 20:17:10 2013
@@ -142,6 +142,26 @@
         return self.state
 
 
+    def SetValue(self, value):
+        """Set the value of the control.
+
+        @param value:   The value to set the boolean control to.
+        @type value:    bool
+        """
+
+        # True.
+        if value == True:
+            self.field.SetValue('True')
+            
self.button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.media-record-relax-green'),
 wx.BITMAP_TYPE_ANY))
+            self.state = True
+
+        # False:
+        else:
+            self.field.SetValue('False')
+            
self.button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.media-record'),
 wx.BITMAP_TYPE_ANY))
+            self.state = False
+
+
     def toggle(self, event=None):
         """Switch the state."""
 




Related Messages


Powered by MHonArc, Updated Thu Jul 18 20:20:10 2013