예제 #1
0
 def SetFloats(self, value):
     if (value is None):
         NumbersCtrlBase.SetValue(self, "")
     elif (isinstance(value, int) or isinstance(value, float)):
         NumbersCtrlBase.SetValue(self, str(float(value)))
     elif (isinstance(value, list) or isinstance(value, tuple)):
         NumbersCtrlBase.SetValue(self, self.FormatValue(value))
예제 #2
0
 def SetInts(self, value):
     if (value is None):
         NumbersCtrlBase.SetValue(self, "")
     elif (value is Auto):
         NumbersCtrlBase.SetValue(self, "Auto")
     elif (isinstance(value, int) or isinstance(value, float)):
         NumbersCtrlBase.SetValue(self, str(int(value)))
     elif (isinstance(value, list) or isinstance(value, tuple)):
         NumbersCtrlBase.SetValue(self, self.FormatValue(value))
     else:
         raise TypeError("Type '%s' not allowed!" % type(value).__name__)
예제 #3
0
 def GetPhilValue(self):
     self.Validate()
     val_str = str(NumbersCtrlBase.GetValue(self))
     if (val_str == ""):
         return self.ReturnNoneIfOptional()
     elif (val_str == "Auto"):
         return Auto
     return [int(field) for field in val_str.split()]