def select_box(self, event, r): UndoManager.begin_action(end_timeout=500) modifiers = event.modifiers() if ((modifiers != Qt.ShiftModifier) and (modifiers != Qt.ControlModifier)): Selection.deselect_all() self._select_children_in_box(self, r, modifiers, set())
def on_click(self, event): item = self.scene().itemAt(event.scenePos()) if (item is not self): return if (len(Selection.models) > 0): Selection.deselect_all() else: add_menu = menu.WorkspaceMenu(document=self.document, event=event, parent=event.widget()) add_menu.popup(event.screenPos())
def on_drag_start_y(self, event): UndoManager.begin_action() # select the model if it isn't selected if (not self.model.selected): Selection.deselect_all() self.model.selected = True # record the original pitches of all selected models self._drag_start_pitches = dict() for model in Selection.models: try: self._drag_start_pitches[model] = model.pitch except AttributeError: continue
def on_drag_start_x(self, event): UndoManager.begin_action() # select the model if it isn't selected can_select = hasattr(self.model, 'selected') if ((not can_select) or (not self.model.selected)): Selection.deselect_all() if (can_select): self.model.selected = True # record the original times of all selected models self._drag_start_times = dict() models = set(Selection.models) models.add(self.model) for model in models: try: self._drag_start_times[model] = model.time except AttributeError: continue
def on_click(self, event): UndoManager.begin_action(end_timeout=500) if ((self.allow_multiselect) and (event.modifiers() == Qt.ShiftModifier)): self.model.selected = True elif ((self.allow_multiselect) and (event.modifiers() == Qt.ControlModifier)): self.model.selected = not self.model.selected else: try: if (self.model.selected): event.ignore() return except AttributeError: pass Selection.deselect_all() self.model.selected = True
def on_click(self, event): if (event.modifiers() == 0): Selection.deselect_all()