/// <summary> /// Handles the user releasing a mouse button. /// </summary> /// <param name="theEvent">The <c>NSEvent</c> representing the mouse up.</param> public override void MouseUp(NSEvent theEvent) { base.MouseUp(theEvent); // Get the location var point = ConvertToCanvasPoint(theEvent); // Send mouse up to the Sketch and refresh the view SelectedSketch.ToolUp(point); RefreshView(); }
/// <summary> /// Selects all shapes in the current group or sketch. /// </summary> public void SelectAll() { if (DeeplySelectedGroup == null) { SelectedSketch?.SelectAll(); } else { DeeplySelectedGroup?.SelectAll(); } }
/// <summary> /// Handles the user dragging the mouse. /// </summary> /// <param name="theEvent">The <c>NSEvent</c> representing the mouse drag.</param> public override void MouseDragged(NSEvent theEvent) { base.MouseDragged(theEvent); // Get the location var point = ConvertToCanvasPoint(theEvent); // Send the drag to the Sketch and refresh the view SelectedSketch.ToolDrag(point); RefreshView(); }
/// <summary> /// Deletes the selected shape. /// </summary> public void DeleteSelectedShape() { // Delete the selected shape if (DeeplySelectedGroup == null) { SelectedSketch?.DeleteSelectedShape(); } else { DeeplySelectedGroup?.DeleteSelectedShape(); } }
/// <summary> /// Duplicates the selected shape. /// </summary> public void DuplicateSelectedShape() { // Make duplicate of the selected shape if (DeeplySelectedGroup == null) { SelectedSketch?.DuplicateSelectedShape(); } else { DeeplySelectedGroup?.DuplicateSelectedShape(); } }
/// <summary> /// Handles the user clicking the mouse /// </summary> /// <param name="theEvent">The <c>NSEvent</c> representing the mouse down.</param> public override void MouseDown(NSEvent theEvent) { base.MouseDown(theEvent); // Make the design surface the first responder Window.MakeFirstResponder(this); // Get the location var point = ConvertToCanvasPoint(theEvent); var shiftKeyDown = ((theEvent.ModifierFlags & NSEventModifierMask.ShiftKeyMask) == NSEventModifierMask.ShiftKeyMask); // Send the location to the sketch SelectedSketch.ToolDown(point, (int)theEvent.ClickCount, shiftKeyDown); }
/// <summary> /// Deselects all selected shapes. /// </summary> public void DeselectAll() { if (DeeplySelectedGroup == null) { SelectedSketch?.DeselectAll(); } else { DeeplySelectedGroup?.DeselectAll(); } // Update UI RaiseSelectionChanged(null); RefreshView(); }
/// <summary> /// Refreshs the Design Surface's view by redrawing the currently selected <c>KimonoSketch</c>. /// </summary> public void RefreshView() { // Get image data from sketch and display Image = SelectedSketch.ToImage(); }