def __init__(self, app, callback): self.app = app self.id = None self.components = [] # List of available components self.c_buttons = {} # Component-to-button dict self.sens_widgets = [] # Sensitivity sliders, labels and 'clear' buttons self.feedback_widgets = [] # Feedback settings sliders, labels and 'clear' buttons, plus default value as last item self.deadzone_widgets = [] # Deadzone settings sliders and 'clear' buttons, plus default value as last item self.sens = [1.0] * 3 # Sensitivity slider values self.feedback = [0.0] * 3 # Feedback slider values, set later self.deadzone = [0] * 2 # Deadzone slider values, set later self.deadzone_enabled = False self.feedback_position = None # None for 'disabled' self.click = False # Click modifier value. None for disabled self.osd = False # 'OSD enabled' value. self.setup_widgets() self.load_components() self.ac_callback = callback # This is different callback than ButtonChooser uses Editor.install_error_css() self._action = NoAction() self._selected_component = None self._modifiers_enabled = True self._multiparams = [ None ] * 8 self._mode = None self._recursing = False
def setup_widgets(self): Editor.setup_widgets(self) headerbar(self.builder.get_object("header")) for i in (0, 1, 2): self.sens_widgets.append(( self.builder.get_object("sclSens%s" % (XYZ[i],)), self.builder.get_object("lblSens%s" % (XYZ[i],)), self.builder.get_object("btClearSens%s" % (XYZ[i],)), )) for key in AFP: i = AFP.index(key) self.feedback[i] = self.builder.get_object("sclF%s" % (key,)).get_value() self.feedback_widgets.append(( self.builder.get_object("sclF%s" % (key,)), self.builder.get_object("lblF%s" % (key,)), self.builder.get_object("btClearF%s" % (key,)), self.feedback[i] # default value )) for key in SMT: i = SMT.index(key) self.smoothing_widgets.append(( self.builder.get_object("lblSmooth%s" % (key,)), self.builder.get_object("sclSmooth%s" % (key,)), self.builder.get_object("btClearSmooth%s" % (key,)), self.builder.get_object("sclSmooth%s" % (key,)).get_value() )) for key in DZN: i = DZN.index(key) self.deadzone[i] = self.builder.get_object("sclDZ%s" % (key,)).get_value() self.deadzone_widgets.append(( self.builder.get_object("lblDZ%s" % (key,)), self.builder.get_object("sclDZ%s" % (key,)), self.builder.get_object("btClearDZ%s" % (key,)), self.deadzone[i] # default value ))
def setup_widgets(self): Editor.setup_widgets(self) headerbar(self.builder.get_object("header")) for i in (0, 1, 2): self.sens_widgets.append(( self.builder.get_object("sclSens%s" % (XYZ[i],)), self.builder.get_object("lblSens%s" % (XYZ[i],)), self.builder.get_object("btClearSens%s" % (XYZ[i],)), )) for key in AFP: i = AFP.index(key) self.feedback[i] = self.builder.get_object("sclF%s" % (key,)).get_value() self.feedback_widgets.append(( self.builder.get_object("sclF%s" % (key,)), self.builder.get_object("lblF%s" % (key,)), self.builder.get_object("btClearF%s" % (key,)), self.feedback[i] # default value )) for key in DZN: i = DZN.index(key) self.deadzone[i] = self.builder.get_object("sclDZ%s" % (key,)).get_value() self.deadzone_widgets.append(( self.builder.get_object("sclDZ%s" % (key,)), self.builder.get_object("btClearDZ%s" % (key,)), self.deadzone[i] # default value ))
def __init__(self, app, callback): Editor.__init__(self) self.app = app self.id = None self.components = [] # List of available components self.loaded_components = {} # by class name self.c_buttons = {} # Component-to-button dict self.sens_widgets = [] # Sensitivity sliders, labels and 'clear' buttons self.feedback_widgets = [] # Feedback settings sliders, labels and 'clear' buttons, plus default value as last item self.smoothing_widgets = [] # Smoothing settings sliders, labels and 'clear' buttons, plus default value as last item self.deadzone_widgets = [] # Deadzone settings sliders, labels and 'clear' buttons, plus default value as last item self.sens = [1.0] * 3 # Sensitivity slider values self.sens_defaults = [1.0] * 3 # Clear button clears to this self.feedback = [0.0] * 3 # Feedback slider values, set later self.deadzone = [0] * 2 # Deadzone slider values, set later self.deadzone_mode = None # None for 'disabled' self.feedback_position = None # None for 'disabled' self.smoothing = None # None for 'disabled' self.click = False # Click modifier value. None for disabled self.rotation_angle = 0 # RotateInputModifier angle self.osd = False # 'OSD enabled' value. self.setup_widgets() self.load_components() self.ac_callback = callback # This is different callback than ButtonChooser uses Editor.install_error_css() self._action = NoAction() self._replaced_action = None self._selected_component = None self._modifiers_enabled = True self._multiparams = [ None ] * 8 self._mode = None self._recursing = False
def __init__(self, app, callback): self.app = app self.next_auto_id = 1 self.callback = callback self.original_id = None self.original_type = MenuEditor.TYPE_INTERNAL Editor.install_error_css() self.setup_widgets()
def setup_widgets(self): Editor.setup_widgets(self) b = lambda a: self.builder.get_object(a) self.action_widgets = ( # Order goes: Action Button, Clear Button (b('btInner'), b('btClearInner')), (b('btOuter'), b('btClearOuter'))) headerbar(self.builder.get_object("header"))
def __init__(self, app, callback): Editor.__init__(self) self.app = app self.id = None self.mode = Action.AC_BUTTON self.ac_callback = callback self.radius = 0.5 self.actions = [NoAction(), NoAction()] self.setup_widgets()
def __init__(self, app, callback): Editor.__init__(self) self.app = app self.id = None self.mode = Action.AC_BUTTON self.ac_callback = callback self.added_widget = None self.setup_widgets() self.actions = []
def setup_widgets(self): Editor.setup_widgets(self) b = lambda a : self.builder.get_object(a) self.action_widgets = ( # Order goes: Action Button, Clear Button ( b('btInner'), b('btClearInner') ), ( b('btOuter'), b('btClearOuter') ) ) headerbar(self.builder.get_object("header"))
def __init__(self, app, callback): Editor.__init__(self) self.app = app self.id = None self.mode = Action.AC_BUTTON self.ac_callback = callback self.radius = 0.5 self.actions = [ NoAction(), NoAction() ] self.setup_widgets()
def __init__(self, app, callback): Editor.__init__(self) self.app = app self.id = None self.mode = Action.AC_BUTTON self.ac_callback = callback self.current_page = 0 self.actions = ([], [], []) self.nomods = [NoAction(), NoAction(), NoAction()] self.setup_widgets()
def setup_widgets(self): Editor.setup_widgets(self) # Get app version app_ver = "(unknown version)" try: import pkg_resources, scc if scc.__file__.startswith(pkg_resources.require("sccontroller")[0].location): app_ver = "v" + pkg_resources.require("sccontroller")[0].version except: # pkg_resources is not available or __version__ file missing # There is no reason to crash on this. pass # Display version in UI self.builder.get_object("lblVersion").set_label(app_ver)
def setup_widgets(self): Editor.setup_widgets(self) clIcon = self.builder.get_object("clIcon") crIconName = self.builder.get_object("crIconName") btUserFolder = self.builder.get_object("btUserFolder") cr = CellRendererMenuIcon(32) clIcon.clear() clIcon.pack_start(cr, False) clIcon.pack_start(crIconName, True) clIcon.set_attributes(cr, icon=1, has_colors=2) clIcon.set_attributes(crIconName, text=0) btUserFolder.set_label("Add icons...") btUserFolder.set_uri("file://%s" % (get_menuicons_path(),)) headerbar(self.builder.get_object("header")) self.load_menu_icons()
def setup_widgets(self): Editor.setup_widgets(self) clIcon = self.builder.get_object("clIcon") crIconName = self.builder.get_object("crIconName") btUserFolder = self.builder.get_object("btUserFolder") cr = CellRendererMenuIcon(32) clIcon.clear() clIcon.pack_start(cr, False) clIcon.pack_start(crIconName, True) clIcon.set_attributes(cr, icon=1, has_colors=2) clIcon.set_attributes(crIconName, text=0) btUserFolder.set_label("Add icons...") btUserFolder.set_uri("file://%s" % (get_menuicons_path(), )) headerbar(self.builder.get_object("header")) self.load_menu_icons()
def setup_widgets(self): Editor.setup_widgets(self) # Get app version app_ver = "(unknown version)" try: import pkg_resources, scc if scc.__file__.startswith( pkg_resources.require("sccontroller")[0].location): app_ver = "v" + pkg_resources.require( "sccontroller")[0].version except: # pkg_resources is not available or __version__ file missing # There is no reason to crash on this. pass # Display version in UI self.builder.get_object("lblVersion").set_label(app_ver)
def setup_widgets(self): Editor.setup_widgets(self) cbButtonChooser = self.builder.get_object("cbButtonChooser") cbButtonChooser.set_row_separator_func( lambda model, iter : model.get_value(iter, 0) is None ) b = lambda a : self.builder.get_object(a) self.action_widgets = ( # Order goes: Grid, 1st Action Button, Clear Button # 1st group, 'pressed' ( b('grActions'), b('btDefault'), b('btClearDefault') ), # 2nd group, 'hold' ( b('grHold'), b('btHold'), b('btClearHold') ), # 2nd group, 'double-click' ( b('grDoubleClick'), b('btDoubleClick'), b('btClearDoubleClick') ), ) headerbar(self.builder.get_object("header"))
def setup_widgets(self): Editor.setup_widgets(self) cbButtonChooser = self.builder.get_object("cbButtonChooser") cbButtonChooser.set_row_separator_func( lambda model, iter : model.get_value(iter, 0) is None ) b = lambda a : self.builder.get_object(a) self.action_widgets = ( # Order goes: Grid, 1st Action Button, Clear Button # 1st group, 'pressed' ( b('grActions'), b('btDefault'), b('btClearDefault') ), # 2nd group, 'hold' ( b('grHold'), b('btHold'), b('btClearHold') ), # 2nd group, 'double-click' ( b('grDoubleClick'), b('btDoubleClick'), b('btClearDoubleClick') ), ) self._fill_button_chooser() headerbar(self.builder.get_object("header"))
def setup_widgets(self): Editor.setup_widgets(self) self.create_binding_buttons(use_icons=False, enable_press=False)
def close(self, *a): self.on_Dialog_delete_event() Editor.close(self)
def close(self): self.on_Dialog_destroy() Editor.close(self)
def show(self, transient_for): Editor.show(self, transient_for)
def setup_widgets(self): Editor.setup_widgets(self) headerbar(self.builder.get_object("header"))