def add_setting_entry(self, name, va, hw_comp, conf=None): """ Add a name/value pair to the settings panel. :param name: (string): name of the value :param va: (VigilantAttribute) :param hw_comp: (Component): the component that contains this VigilantAttribute :param conf: ({}): Configuration items that may override default settings :return SettingEntry or None: the entry created, or None, if no entry was created (eg, because the conf indicates CONTROL_NONE). """ assert isinstance(va, VigilantAttributeBase) # Remove any 'empty panel' warning self.panel.clear_default_message() ne = create_setting_entry(self.panel, name, va, hw_comp, conf, self.on_setting_changed) if ne is None: return None self.entries.append(ne) if self.highlight_change: bind_setting_context_menu(ne) self.panel.Parent.Parent.Layout() return ne
def add_axis(self, name, comp, conf=None): """ Add a widget to the setting panel to control an axis :param name: (string): name of the axis :param comp: (Component): the component that contains this axis :param conf: ({}): Configuration items that may override default settings """ ne = create_axis_entry(self.panel, name, comp, conf) self.entries.append(ne) if self.highlight_change: bind_setting_context_menu(ne) self.panel.Parent.Parent.Layout()
def add_setting_entry(self, name, va, hw_comp, conf=None): """ Add a name/value pair to the settings panel. :param name: (string): name of the value :param va: (VigilantAttribute) :param hw_comp: (Component): the component that contains this VigilantAttribute :param conf: ({}): Configuration items that may override default settings """ assert isinstance(va, VigilantAttributeBase) # Remove any 'empty panel' warning self.panel.clear_default_message() ne = create_setting_entry(self.panel, name, va, hw_comp, conf, self.on_setting_changed) self.entries.append(ne) if self.highlight_change: bind_setting_context_menu(ne) self.panel.Parent.Parent.Layout() return ne