Beispiel #1
0
    def post_init(self):
        self.panel = wx.Panel(self.fpanel)
        box = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(box)

        self.rule_list = RuleList(self, self.filename, self.id_)
        self.rule_editor = RuleEditor(self, self.filename, self.id_)
        self.rule_list.post_init()
        self.rule_editor.post_init()

        box.Add(self.rule_list.panel, flag=wx.EXPAND | wx.BOTTOM, border=4)
        box.Add(self.rule_editor.panel, flag=wx.EXPAND | wx.BOTTOM, border=4)

        config = coreaux_api.get_plugin_configuration('wxscheduler')(
                                                        'ContextualShortcuts')
        accelerators = {
            config["focus"]: lambda event: self.set_focus(),
            config["toggle"]: lambda event: self.toggle_focus(),
        }

        wxgui_api.add_window_to_plugin(self.filename, self.id_, self.fpanel,
                                                    self.panel, accelerators)
        self.resize()

        # Must be done *after* resizing
        if not self.rule_list.rules:
            wxgui_api.collapse_panel(self.filename, self.id_, self.fpanel)
Beispiel #2
0
    def post_init(self):
        self.panel = wx.Panel(self.fpanel)
        box = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(box)

        self.rule_list = RuleList(self, self.filename, self.id_)
        self.rule_editor = RuleEditor(self, self.filename, self.id_)
        self.rule_list.post_init()
        self.rule_editor.post_init()

        box.Add(self.rule_list.panel, flag=wx.EXPAND | wx.BOTTOM, border=4)
        box.Add(self.rule_editor.panel, flag=wx.EXPAND | wx.BOTTOM, border=4)

        config = coreaux_api.get_plugin_configuration('wxscheduler')(
                                                        'ContextualShortcuts')
        accelerators = {
            config["focus"]: lambda event: self.set_focus(),
            config["toggle"]: lambda event: self.toggle_focus(),
        }

        wxgui_api.add_window_to_plugin(self.filename, self.id_, self.fpanel,
                                                    self.panel, accelerators)
        self.resize()

        # Must be done *after* resizing
        if not self.rule_list.rules:
            wxgui_api.collapse_panel(self.filename, self.id_, self.fpanel)
Beispiel #3
0
    def post_init(self):
        self.target = links_api.find_link_target(self.filename, self.id_)

        self._init_buttons()
        self._refresh_mod_state()
        self.lpanel.Fit()
        wxgui_api.expand_panel(self.filename, self.id_, self.fpanel)

        if not self.target:
            wxgui_api.collapse_panel(self.filename, self.id_, self.fpanel)

        wxgui_api.bind_to_apply_editor(self._handle_apply)
        wxgui_api.bind_to_check_editor_modified_state(
                                            self._handle_check_editor_modified)
        wxgui_api.bind_to_close_editor(self._handle_close)
Beispiel #4
0
    def post_init(self):
        self.target = links_api.find_link_target(self.filename, self.id_)

        self._init_buttons()
        self._refresh_mod_state()
        self.lpanel.Fit()
        wxgui_api.expand_panel(self.filename, self.id_, self.fpanel)

        if not self.target:
            wxgui_api.collapse_panel(self.filename, self.id_, self.fpanel)

        wxgui_api.bind_to_apply_editor(self._handle_apply)
        wxgui_api.bind_to_check_editor_modified_state(
            self._handle_check_editor_modified)
        wxgui_api.bind_to_close_editor(self._handle_close)