Mercurial > libervia-web
diff src/browser/sat_browser/xmlui.py @ 564:fed185c95f1c
browser_side: add XMLUI "int" widget type + historyPrint uses the new param "Chat history limit"
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 03 Oct 2014 12:33:03 +0200 (2014-10-03) |
parents | f030491cff75 |
children | a5019e62c3e9 |
line wrap: on
line diff
--- a/src/browser/sat_browser/xmlui.py Fri Oct 03 19:38:10 2014 +0200 +++ b/src/browser/sat_browser/xmlui.py Fri Oct 03 12:33:03 2014 +0200 @@ -150,6 +150,23 @@ self.addClickListener(callback) +class IntWidget(xmlui.IntWidget, TextBox): + + def __init__(self, _xmlui_parent, value, read_only=False): + TextBox.__init__(self) + self.setText(value) + self.setReadonly(read_only) + + def _xmluiSetValue(self, value): + self.setText(value) + + def _xmluiGetValue(self): + return self.getText() + + def _xmluiOnChange(self, callback): + self.addChangeListener(callback) + + class ButtonWidget(xmlui.ButtonWidget, Button): def __init__(self, _xmlui_parent, value, click_callback):