comparison frontends/src/primitivus/xmlui.py @ 1220:f91e7028e2c3

memory (params), tools (xml_tools), plugins, frontends: add "int" parameter type with "min" and "max" attributes
author souliane <souliane@mailoo.org>
date Fri, 03 Oct 2014 12:27:43 +0200
parents 6184779544c7
children e3a9ea76de35
comparison
equal deleted inserted replaced
1219:16484ebb695b 1220:f91e7028e2c3
151 def _xmluiSetValue(self, value): 151 def _xmluiSetValue(self, value):
152 self.set_state(value == "true") 152 self.set_state(value == "true")
153 153
154 def _xmluiGetValue(self): 154 def _xmluiGetValue(self):
155 return "true" if self.get_state() else "false" 155 return "true" if self.get_state() else "false"
156
157
158 class PrimitivusIntWidget(xmlui.IntWidget, sat_widgets.AdvancedEdit, PrimitivusEvents):
159
160 def __init__(self, _xmlui_parent, value, read_only=False):
161 sat_widgets.AdvancedEdit.__init__(self, edit_text=value)
162 self.read_only = read_only
163
164 def selectable(self):
165 if self.read_only:
166 return False
167 return super(PrimitivusIntWidget, self).selectable()
168
169 def _xmluiSetValue(self, value):
170 self.set_edit_text(value)
171
172 def _xmluiGetValue(self):
173 return self.get_edit_text()
156 174
157 175
158 class PrimitivusButtonWidget(xmlui.ButtonWidget, sat_widgets.CustomButton, PrimitivusEvents): 176 class PrimitivusButtonWidget(xmlui.ButtonWidget, sat_widgets.CustomButton, PrimitivusEvents):
159 177
160 def __init__(self, _xmlui_parent, value, click_callback): 178 def __init__(self, _xmlui_parent, value, click_callback):