memory (params), tools (xml_tools), plugins, frontends: add "int" parameter type with "min" and "max" attributes

This commit is contained in:
souliane 2014-10-03 12:27:43 +02:00
commit ac59d061f4

View file

@ -101,6 +101,10 @@ class BoolWidget(Widget):
"""
class IntWidget(Widget):
"""Input widget with require an integer"""
class ButtonWidget(Widget):
"""A clickable widget"""
@ -388,6 +392,9 @@ class XMLUIPanel(XMLUIBase):
elif type_=="bool":
ctrl = self.widget_factory.createBoolWidget(_xmlui_parent, value==C.BOOL_TRUE, self._isAttrSet("read_only", node))
self.ctrl_list[name] = ({'type':type_, 'control':ctrl})
elif type_ == "int":
ctrl = self.widget_factory.createIntWidget(_xmlui_parent, value, self._isAttrSet("read_only", node))
self.ctrl_list[name] = ({'type':type_, 'control':ctrl})
elif type_ == "list":
style = [] if node.getAttribute("multi") == 'yes' else ['single']
_options = [(option.getAttribute("value"), option.getAttribute("label")) for option in node.getElementsByTagName("option")]