Пример #1
0
 def GetValue(self):
     val = wx.TextCtrl.GetValue(self)
     if wxtbx.is_unicode_build():
         return to_str(val)
     else:
         assert isinstance(val, str)
         return val
Пример #2
0
 def GetValue (self) :
   val = wx.TextCtrl.GetValue(self)
   if wxtbx.is_unicode_build() :
     return to_str(val)
   else :
     assert isinstance(val, str)
     return val
Пример #3
0
 def GetValue (self) :
   val = wx.TextCtrl.GetValue(self)
   if (isinstance(val, unicode)) and wxtbx.is_unicode_build() :
     return val.encode('utf8')
   else :
     assert isinstance(val, str)
     return val
Пример #4
0
 def SetValue (self, value) :
   if (value in [None, Auto]) :
     ValidatedTextCtrl.SetValue(self, "")
   else :
     if isinstance(value, str) :
       if wxtbx.is_unicode_build() :
         ValidatedTextCtrl.SetValue(self, value.decode("utf-8"))
       else :
         ValidatedTextCtrl.SetValue(self, value)
     else :
       if (not isinstance(value, unicode)) :
         raise RuntimeError("Improper value (type: %s) for control %s" %
           (type(value).__name__, self.GetName()))
       ValidatedTextCtrl.SetValue(self, value)
Пример #5
0
 def SetValue(self, value):
   if (value in [None, Auto]):
     ValidatedTextCtrl.SetValue(self, "")
   else :
     if isinstance(value, str):
       if wxtbx.is_unicode_build():
         ValidatedTextCtrl.SetValue(self, to_unicode(value))
       else :
         ValidatedTextCtrl.SetValue(self, value)
     else :
       if (not isinstance(value, unicode)):
         raise RuntimeError("Improper value (type: %s) for control %s" %
           (type(value).__name__, self.GetName()))
       ValidatedTextCtrl.SetValue(self, value)
Пример #6
0
 def FormatValue (self, value) :
   if wxtbx.is_unicode_build() :
     return value.encode("utf-8")
   else :
     return value
Пример #7
0
 def FormatValue (self, value) :
   if wxtbx.is_unicode_build() :
     return to_str(value)
   else :
     return value
Пример #8
0
 def FormatValue(self, value):
     if wxtbx.is_unicode_build():
         return to_str(value)
     else:
         return value