def GetValue(self): val = wx.TextCtrl.GetValue(self) if wxtbx.is_unicode_build(): return to_str(val) else: assert isinstance(val, str) return val
def GetValue (self) : val = wx.TextCtrl.GetValue(self) if wxtbx.is_unicode_build() : return to_str(val) else : assert isinstance(val, str) return val
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
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)
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)
def FormatValue (self, value) : if wxtbx.is_unicode_build() : return value.encode("utf-8") else : return value
def FormatValue (self, value) : if wxtbx.is_unicode_build() : return to_str(value) else : return value
def FormatValue(self, value): if wxtbx.is_unicode_build(): return to_str(value) else: return value