Example #1
0
    def init_stategroups(self):
        sg = stategroup.StateGroup()
        self.layerblink_state = sg.create_state(self.layerblink_state_enter,
                                                self.layerblink_state_leave)
        sg = stategroup.StateGroup()
        self.strokeblink_state = sg.create_state(self.strokeblink_state_enter,
                                                 self.strokeblink_state_leave)
        self.strokeblink_state.autoleave_timeout = 0.3

        # separate stategroup...
        sg2 = stategroup.StateGroup()
        self.layersolo_state = sg2.create_state(self.layersolo_state_enter,
                                                self.layersolo_state_leave)
        self.layersolo_state.autoleave_timeout = None
Example #2
0
    def _init_stategroups(self):
        sg = stategroup.StateGroup()
        p2s = sg.create_popup_state
        changer_crossed_bowl = p2s(
            colorselectionwindow.ColorChangerCrossedBowlPopup(self.app))
        changer_wash = p2s(colorselectionwindow.ColorChangerWashPopup(
            self.app))
        ring = p2s(colorselectionwindow.ColorRingPopup(self.app))
        hist = p2s(historypopup.HistoryPopup(self.app, self.app.doc.model))

        self.popup_states = {
            'ColorChangerCrossedBowlPopup': changer_crossed_bowl,
            'ColorChangerWashPopup': changer_wash,
            'ColorRingPopup': ring,
            'ColorHistoryPopup': hist,
        }

        # not sure how useful this is; we can't cycle at the moment
        changer_crossed_bowl.next_state = ring
        ring.next_state = changer_wash
        changer_wash.next_state = ring

        changer_wash.autoleave_timeout = None
        changer_crossed_bowl.autoleave_timeout = None
        ring.autoleave_timeout = None

        hist.autoleave_timeout = 0.600
        self.history_popup_state = hist

        for action_name, popup_state in self.popup_states.iteritems():
            label = self.app.find_action(action_name).get_label()
            popup_state.label = label
Example #3
0
    def _init_stategroups(self):
        sg = stategroup.StateGroup()
        p2s = sg.create_popup_state
        hist = p2s(historypopup.HistoryPopup(self.app, self.app.doc.model))

        self.popup_states = {
            'ColorHistoryPopup': hist,
        }

        hist.autoleave_timeout = 0.600
        self.history_popup_state = hist

        for action_name, popup_state in self.popup_states.iteritems():
            label = self.app.find_action(action_name).get_label()
            popup_state.label = label