memory (params), tools (xml_tools), plugins, frontends: add "int" parameter type with "min" and "max" attributes
This commit is contained in:
parent
20c94f1fbc
commit
ac59d061f4
1 changed files with 80 additions and 11 deletions
|
|
@ -155,6 +155,24 @@ class PrimitivusBoolWidget(xmlui.BoolWidget, urwid.CheckBox, PrimitivusEvents):
|
|||
return "true" if self.get_state() else "false"
|
||||
|
||||
|
||||
class PrimitivusIntWidget(xmlui.IntWidget, sat_widgets.AdvancedEdit, PrimitivusEvents):
|
||||
|
||||
def __init__(self, _xmlui_parent, value, read_only=False):
|
||||
sat_widgets.AdvancedEdit.__init__(self, edit_text=value)
|
||||
self.read_only = read_only
|
||||
|
||||
def selectable(self):
|
||||
if self.read_only:
|
||||
return False
|
||||
return super(PrimitivusIntWidget, self).selectable()
|
||||
|
||||
def _xmluiSetValue(self, value):
|
||||
self.set_edit_text(value)
|
||||
|
||||
def _xmluiGetValue(self):
|
||||
return self.get_edit_text()
|
||||
|
||||
|
||||
class PrimitivusButtonWidget(xmlui.ButtonWidget, sat_widgets.CustomButton, PrimitivusEvents):
|
||||
|
||||
def __init__(self, _xmlui_parent, value, click_callback):
|
||||
|
|
|
|||
Loading…
Reference in a new issue