Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Selects all shapes in the current group or sketch.
 /// </summary>
 public void SelectAll()
 {
     if (DeeplySelectedGroup == null)
     {
         SelectedSketch?.SelectAll();
     }
     else
     {
         DeeplySelectedGroup?.SelectAll();
     }
 }
Ejemplo n.º 3
0
        /// <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();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Deletes the selected shape.
 /// </summary>
 public void DeleteSelectedShape()
 {
     // Delete the selected shape
     if (DeeplySelectedGroup == null)
     {
         SelectedSketch?.DeleteSelectedShape();
     }
     else
     {
         DeeplySelectedGroup?.DeleteSelectedShape();
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Duplicates the selected shape.
 /// </summary>
 public void DuplicateSelectedShape()
 {
     // Make duplicate of the selected shape
     if (DeeplySelectedGroup == null)
     {
         SelectedSketch?.DuplicateSelectedShape();
     }
     else
     {
         DeeplySelectedGroup?.DuplicateSelectedShape();
     }
 }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Deselects all selected shapes.
        /// </summary>
        public void DeselectAll()
        {
            if (DeeplySelectedGroup == null)
            {
                SelectedSketch?.DeselectAll();
            }
            else
            {
                DeeplySelectedGroup?.DeselectAll();
            }

            // Update UI
            RaiseSelectionChanged(null);
            RefreshView();
        }
Ejemplo n.º 8
0
 /// <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();
 }