Пример #1
0
class ShortcutsEditorDialog(ShortcutsGuiCreator):

    def __init__(self, parent, shortcut_config):
        ShortcutsGuiCreator.__init__(self, parent)
        self.controller = ShortcutsEditor(self, shortcut_config) 

    #
    # Controller API
    #
    def set_functions(self, choices):
        self.cb_functions.AppendItems(choices)
        self.cb_functions.SetValue(choices[0])
        
    def set_shortcut_keys(self, choices, value):
        self.cb_shortcut_keys.AppendItems(choices)
        self.set_shortcut_key(value)
        
    def set_shortcut_key(self, value):
        self.cb_shortcut_keys.SetValue(value)

    def set_modifiers(self, choices, value):
        self.cb_modifiers.AppendItems(choices)
        self.set_modifier(value)
        
    def set_modifier(self, value):
        self.cb_modifiers.SetValue(value)
        
    def get_function(self):
        return self.cb_functions.GetValue()

    def get_shortcut_key(self):
        return self.cb_shortcut_keys.GetValue()

    def get_modifier(self):
        return self.cb_modifiers.GetValue()

    #
    # Event Handlers
    #
    def _on_select(self, evt):
        self.controller.on_function_selected()
        
    def _btn_close_on_click(self, evt):
        self.EndModal(wx.ID_OK)
        
    def _btn_apply_on_click(self, e):
        self.controller.apply()
        
Пример #2
0
class ShortcutsEditorDialog(ShortcutsGuiCreator):
    def __init__(self, parent, shortcut_config):
        ShortcutsGuiCreator.__init__(self, parent)
        self.controller = ShortcutsEditor(self, shortcut_config)

    #
    # Controller API
    #
    def set_functions(self, choices):
        self.cb_functions.AppendItems(choices)
        self.cb_functions.SetValue(choices[0])

    def set_shortcut_keys(self, choices, value):
        self.cb_shortcut_keys.AppendItems(choices)
        self.set_shortcut_key(value)

    def set_shortcut_key(self, value):
        self.cb_shortcut_keys.SetValue(value)

    def set_modifiers(self, choices, value):
        self.cb_modifiers.AppendItems(choices)
        self.set_modifier(value)

    def set_modifier(self, value):
        self.cb_modifiers.SetValue(value)

    def get_function(self):
        return self.cb_functions.GetValue()

    def get_shortcut_key(self):
        return self.cb_shortcut_keys.GetValue()

    def get_modifier(self):
        return self.cb_modifiers.GetValue()

    #
    # Event Handlers
    #
    def _on_select(self, evt):
        self.controller.on_function_selected()

    def _btn_close_on_click(self, evt):
        self.EndModal(wx.ID_OK)

    def _btn_apply_on_click(self, e):
        self.controller.apply()
Пример #3
0
 def __init__(self, parent, shortcut_config):
     ShortcutsGuiCreator.__init__(self, parent)
     self.controller = ShortcutsEditor(self, shortcut_config)
Пример #4
0
 def __init__(self, parent, shortcut_config):
     ShortcutsGuiCreator.__init__(self, parent)
     self.controller = ShortcutsEditor(self, shortcut_config)