# HG changeset patch # User Thinker K.F. Li # Date 1304925629 -28800 # Node ID 7b8e67b2391b43f1600e1a6acafe0f06ed585803 # Parent d5b677831671c92b1abb35f79b22ebc0bc050d42 Hint for user overing a state object diff -r d5b677831671 -r 7b8e67b2391b pyink/FSM_window.py --- a/pyink/FSM_window.py Mon May 09 00:27:10 2011 +0800 +++ b/pyink/FSM_window.py Mon May 09 15:20:29 2011 +0800 @@ -883,9 +883,15 @@ pass def start_hint(self): + circle_node = self._circle_node + circle_node.setAttribute('style', 'stroke: #000000; stroke-width: 3; ' + 'fill: #ffffff') pass def stop_hint(self): + circle_node = self._circle_node + circle_node.setAttribute('style', 'stroke: #000000; stroke-width: 1; ' + 'fill: #ffffff') pass pass @@ -1005,10 +1011,10 @@ def _handle_select_transition_target(self, state, evtype, button, x, y): if self._candidate_target != state and self._menu_state != state: if self._candidate_target: - self._candidate_target.hide_selected() + self._candidate_target.stop_hint() pass self._candidate_target = state - state.show_selected() + state.start_hint() pass if evtype != pybInkscape.PYSPItem.PYB_EVENT_BUTTON_RELEASE: @@ -1038,6 +1044,10 @@ window._install_transition_event_handler(trn) window.pop_grabs() + + target_state.stop_hint() + select = self._select + select.deselect() pass def _handle_add_transition(self, *args): @@ -1161,11 +1171,11 @@ if evtype == pybInkscape.PYSPItem.PYB_EVENT_BUTTON_RELEASE: window.ungrab_mouse() pass - new_state_x = orign_state_x + start_x - x - new_state_y = orign_state_y + start_y - y + new_state_x = orign_state_x + x - start_x + new_state_y = orign_state_y + y - start_y domview = self._domview - domview.set_state_xy(state.state_name, x, y) + domview.set_state_xy(state.state_name, new_state_x, new_state_y) state.update() state.adjust_transitions() state.show_selected() @@ -1350,9 +1360,6 @@ if evtype == pybInkscape.PYSPItem.PYB_EVENT_BUTTON_RELEASE and \ button == 1: self._select_transition(trn) - elif evtype == pybInkscape.PYSPItem.PYB_EVENT_MOUSE_ENTER: - self._hint_transition(trn) - pass else: self._popup._handle_transition_mouse_events(trn, evtype, button, x, y)