public void SelectFiguresOnRect (IDrawingView view, bool shift_pressed) { foreach (IFigure figure in view.Drawing.FiguresEnumeratorReverse) { RectangleD rect = figure.DisplayBox; if (_selectionRect.Contains (rect.X, rect.Y) && _selectionRect.Contains (rect.X2, rect.Y2)) { if (shift_pressed) { view.ToggleSelection (figure); } else { view.AddToSelection (figure); } } } }
public void SelectFiguresOnRect(IDrawingView view, bool shift_pressed) { foreach (IFigure figure in view.Drawing.FiguresEnumeratorReverse) { RectangleD rect = figure.DisplayBox; if (_selectionRect.Contains(rect.X, rect.Y) && _selectionRect.Contains(rect.X2, rect.Y2)) { if (shift_pressed) { view.ToggleSelection(figure); } else { view.AddToSelection(figure); } } } }
public override void MouseDown(MouseEvent ev) { base.MouseDown(ev); IDrawingView view = ev.View; SetLastCoords(ev.X, ev.Y); Gdk.ModifierType state = (ev.GdkEvent as EventButton).State; bool shift_pressed = (state & ModifierType.ShiftMask) != 0; if (shift_pressed) { view.ToggleSelection(AnchorFigure); } else if (!view.IsFigureSelected(AnchorFigure)) { view.ClearSelection(); view.AddToSelection(AnchorFigure); } CreateUndoActivity(); }
private void SelectFiguresOnRect(IDrawingView view, bool shift_pressed) { foreach (Figure figure in view.Drawing.Children) { RectangleD rect = figure.DisplayBox; if (selectionRectangle.Contains (rect.X, rect.Y) && selectionRectangle.Contains (rect.X2, rect.Y2)) { if (shift_pressed) view.ToggleSelection (figure); else view.AddToSelection (figure); } } }