Exemplo n.º 1
0
 def CleanImportantMarkup(self, textString):
     if self.UseImportantTooltip():
         textString = StripTags(textString, stripOnly=['localized'])
     if self.HighlightImportant(
     ) and len(textString) > 1 and textString[-1] == '*':
         textString = textString.replace(
             locconst.HIGHLIGHT_IMPORTANT_MARKER, '')
     return textString
Exemplo n.º 2
0
 def SetText(self, text, format = 0):
     if not isinstance(text, basestring):
         if self.integermode:
             text = repr(int(text))
         elif self.floatmode:
             text = '%.*f' % (self.floatmode[2], float(text))
         else:
             text = str(text)
     text = StripTags(text, stripOnly=['localized'])
     if self.passwordchar is not None:
         displayText = self.passwordchar * len(text.replace('<br>', ''))
     elif format:
         displayText = self.EncodeOutput(text) + self.suffix
     elif self.floatmode:
         displayText = text.replace(self.DECIMAL, self.GetLocalizedDecimal())
     else:
         displayText = text
     displayText = StripTags(displayText, stripOnly=['localized'])
     self.sr.text.text = displayText.replace('<', '&lt;').replace('>', '&gt;')
     self.text = text
Exemplo n.º 3
0
 def SetText(self, text, format = 0):
     if not isinstance(text, basestring):
         if self.integermode:
             text = repr(int(text))
         elif self.floatmode:
             text = '%.*f' % (self.floatmode[2], float(text))
         else:
             text = str(text)
     text = StripTags(text, stripOnly=['localized'])
     if self.passwordchar is not None:
         displayText = self.passwordchar * len(text.replace('<br>', ''))
     elif format:
         displayText = self.EncodeOutput(text) + self.suffix
     elif self.floatmode:
         displayText = text.replace(self.DECIMAL, self.GetLocalizedDecimal())
     else:
         displayText = text
     displayText = StripTags(displayText, stripOnly=['localized'])
     self.sr.text.text = displayText.replace('<', '&lt;').replace('>', '&gt;')
     self.text = text
Exemplo n.º 4
0
 def SetValue(self, text, add = 0, keepSelection = 0, updateIndex = 1, docallback = 1):
     text = text or ''
     isString = isinstance(text, basestring)
     if isString:
         text = StripTags(text, stripOnly=['localized'])
     if self.floatmode:
         if isString:
             text = self.PrepareFloatString(text)
         text = self.CheckBounds(text, 0, bool(self.hinttext))
     elif self.integermode:
         text = self.CheckBounds(text, 0, bool(self.hinttext))
     else:
         text = text.replace('&lt;', '<').replace('&gt;', '>')
         if self.maxletters:
             text = text[:self.maxletters]
     if updateIndex:
         self.SetText(text, 0)
         self.caretIndex = self.GetCursorFromIndex(-1)
     self.SetText(text, 1)
     self.selFrom = self.selTo = None
     self.RefreshSelectionDisplay()
     self.OnTextChange(docallback)
Exemplo n.º 5
0
 def SetValue(self, text, add = 0, keepSelection = 0, updateIndex = 1, docallback = 1):
     self.draggedValue = None
     text = text or ''
     isString = isinstance(text, basestring)
     if isString:
         text = StripTags(text, stripOnly=['localized'])
     if self.floatmode:
         if isString:
             text = self.PrepareFloatString(text)
         text = self.CheckBounds(text, 0, bool(self.hinttext))
     elif self.integermode:
         text = self.CheckBounds(text, 0, bool(self.hinttext))
     else:
         text = text.replace('&lt;', '<').replace('&gt;', '>')
         if self.maxletters:
             text = text[:self.maxletters]
     if updateIndex:
         self.SetText(text, 0)
         self.caretIndex = self.GetCursorFromIndex(-1)
     self.SetText(text, 1)
     self.selFrom = self.selTo = None
     self.RefreshSelectionDisplay()
     self.OnTextChange(docallback)