"""
from Constants import SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE
-from Actions import \
- ELEMENT_CREATE, ELEMENT_SELECT, \
- BLOCK_PARAM_MODIFY, BLOCK_MOVE, \
- ELEMENT_DELETE
+import Actions
import Colors
import Utils
from Element import Element
block.set_coordinate(coor)
block.set_rotation(0)
block.get_param('id').set_value(id)
- ELEMENT_CREATE()
+ Actions.ELEMENT_CREATE()
###########################################################################
# Copy Paste
self._old_selected_port is not self._new_selected_port:
try:
self.connect(self._old_selected_port, self._new_selected_port)
- ELEMENT_CREATE()
+ Actions.ELEMENT_CREATE()
except: Messages.send_fail_connection()
self._old_selected_port = None
self._new_selected_port = None
self._selected_elements = list(
set.union(old_elements, new_elements) - set.intersection(old_elements, new_elements)
)
- ELEMENT_SELECT()
+ Actions.ELEMENT_SELECT()
##########################################################################
## Event Handlers
#double click detected, bring up params dialog if possible
if double_click and self.get_selected_block():
self.mouse_pressed = False
- BLOCK_PARAM_MODIFY()
+ Actions.BLOCK_PARAM_MODIFY()
def handle_mouse_button_release(self, left_click, coordinate):
"""
self.time = 0
self.mouse_pressed = False
if self.element_moved:
- BLOCK_MOVE()
+ Actions.BLOCK_MOVE()
self.element_moved = False
self.update_selected_elements()
adj.emit('changed')
#remove the connection if selected in drag event
if len(self.get_selected_elements()) == 1 and self.get_selected_element().is_connection():
- ELEMENT_DELETE()
+ Actions.ELEMENT_DELETE()
#move the selected elements and record the new coordinate
X, Y = self.get_coordinate()
if not self.get_ctrl_mask(): self.move_selected((int(x - X), int(y - Y)))