Ejemplo n.º 1
0
 def _parse_editor(prop, json):
     editor_type = json["type"]
     if editor_type == "spinbox":
         hex = read_key_optional(json, "hex", False)
         prop.editor_factory = lambda: IntegerPropertySpinBox(prop.name, 0, 65535, hex)
     elif editor_type == "combobox":
         data_type = json["data"]
         prop.editor_factory = lambda: DataComboBox(prop.name, data_type, int)
Ejemplo n.º 2
0
 def _parse_editor(prop, json):
     editor_type = json["type"]
     if editor_type == "spinbox":
         hex = read_key_optional(json, "hex", False)
         prop.editor_factory = lambda: IntegerPropertySpinBox(prop.name, 0, 255, hex)
     elif editor_type == "combobox":
         data_type = json["data"]
         prop.editor_factory = lambda: DataComboBox(prop.name, data_type, int)
     elif editor_type == "bitflags":
         flags = json["flags"]
         if not type(flags) is list:
             raise TypeError
         prop.editor_factory = lambda: BitflagsEditor(prop.name, flags)
Ejemplo n.º 3
0
 def __init__(self, name, value=0):
     super().__init__(name)
     self.editor_factory = lambda: IntegerPropertySpinBox(
         self.name, -128, 127)
     self.value = value