Exemple #1
0
        private void canvas1_KeyDown(object sender, KeyEventArgs e)
        {
            // route event to current tool
            TEKeyArgs ee = e.ToTEKeyArgs();

            TheModel.CurrentTool.KeyDown(ee);
            e.Handled = ee.Handled;

            // turn off raster on Alt
            Rasterizer.View.OverrideWithZeroGridWidth = Keyboard.Modifiers.HasFlag(ModifierKeys.Alt) && !Keyboard.Modifiers.HasFlag(ModifierKeys.Shift);
            Rasterizer.View.OverrideWithHalfGridWidth = Keyboard.Modifiers.HasFlag(ModifierKeys.Alt) && Keyboard.Modifiers.HasFlag(ModifierKeys.Shift);

            if (e.Key == Key.LeftAlt || e.Key == Key.RightAlt)
            {
                e.Handled = true;
            }

            if (!e.Handled)
            {
                // escape cancels current operation
                if (e.Key == Key.Escape)
                {
                    TheModel.ActivateDefaultTool();
                }
            }
        }
Exemple #2
0
        public override void KeyUp(TEKeyArgs e)
        {
            base.KeyUp(e);

            // if (PreviewArc.Visibility == Visibility.Visible)
            //     AdjustPreviewPos();
        }
Exemple #3
0
 public override void KeyUp(TEKeyArgs e)
 {
     base.KeyUp(e);
     // refresh preview rect size in case CTRL was pressed
     if (PreviewEllipse.Visible)
     {
         Point p = new Point(overlay.CursorPosition.X, overlay.Height - overlay.CursorPosition.Y);
         OnMouseMove(p, null);
     }
 }
Exemple #4
0
        private void canvas1_KeyUp(object sender, KeyEventArgs e)
        {
            // route event to current tool
            TEKeyArgs ee = e.ToTEKeyArgs();

            TheModel.CurrentTool.KeyUp(ee);
            e.Handled = ee.Handled;

            // turn on raster on Alt released
            Rasterizer.View.OverrideWithZeroGridWidth = Keyboard.Modifiers.HasFlag(ModifierKeys.Alt) && !Keyboard.Modifiers.HasFlag(ModifierKeys.Shift);
            Rasterizer.View.OverrideWithHalfGridWidth = Keyboard.Modifiers.HasFlag(ModifierKeys.Alt) && Keyboard.Modifiers.HasFlag(ModifierKeys.Shift);

            if (e.Key == Key.LeftAlt || e.Key == Key.RightAlt)
            {
                e.Handled = true;
            }
        }
Exemple #5
0
        public override void KeyDown(TEKeyArgs e)
        {
            // move the selected object
            if (SelectedItems.Count > 0)
            {
                double x = 0, y = 0;
                if (e.KeyCode == Keys.Right)
                {
                    x = 1;
                }
                else if (e.KeyCode == Keys.Left)
                {
                    x = -1;
                }
                else if (e.KeyCode == Keys.Down)
                {
                    y = -1;
                }
                else if (e.KeyCode == Keys.Up)
                {
                    y = 1;
                }

                if (x != 0 || y != 0)
                {
                    double step = overlay.Rasterizer.GridWidth * .1;
                    if (step == 0)
                    {
                        step = 1;
                    }
                    overlay.BeginUpdate();
                    ShiftSelItemsInParseTree(new Point(x * step, y * step), overlay.TopLevelItems);
                    overlay.EndUpdate();
                    // update overlay positions
                    foreach (OverlayShape o in overlay.TopLevelItems)
                    {
                        o.AdjustPosition(overlay.Resolution);
                    }

                    e.Handled = true;
                }
            }
            base.KeyDown(e);
        }
Exemple #6
0
 /// <summary>
 /// KeyUp event, forwarded from the overlay control.
 /// </summary>
 /// <param name="e"></param>
 public virtual void KeyUp(TEKeyArgs e)
 {
 }
Exemple #7
0
 /// <summary>
 /// KeyDown event, forwarded from the overlay control.
 /// </summary>
 /// <param name="e"></param>
 public virtual void KeyDown(TEKeyArgs e)
 {
 }
Exemple #8
0
 public override void KeyUp(TEKeyArgs e)
 {
     base.KeyUp(e);
     UpdatePreviewDisplay();
 }
Exemple #9
0
        public override void KeyUp(TEKeyArgs e)
        {
            base.KeyUp(e);

           // if (PreviewArc.Visibility == Visibility.Visible)
           //     AdjustPreviewPos();
        }
Exemple #10
0
 public override void KeyUp(TEKeyArgs e)
 {
     base.KeyUp(e);
     UpdatePreviewDisplay();
 }
 public override void KeyUp(TEKeyArgs e)
 {
     base.KeyUp(e);
     // refresh preview rect size in case CTRL was pressed
     if (PreviewEllipse.Visible)
     {
         Point p = new Point(overlay.CursorPosition.X, overlay.Height - overlay.CursorPosition.Y);
         OnMouseMove(p, null);
     }
 }
Exemple #12
0
        public override void KeyDown(TEKeyArgs e)
        {
            // move the selected object
            if (SelectedItems.Count > 0)
            {
                double x=0, y=0;
                if (e.KeyCode == Keys.Right)
                    x = 1;
                else if (e.KeyCode == Keys.Left)
                    x = -1;
                else if (e.KeyCode == Keys.Down)
                    y = -1;
                else if (e.KeyCode == Keys.Up)
                    y = 1;

                if (x != 0 || y != 0)
                {
                    double step = overlay.Rasterizer.GridWidth * .1;
                    if (step == 0)
                        step = 1;
                    overlay.BeginUpdate();
                    ShiftSelItemsInParseTree(new Vector(x * step, y * step), overlay.DisplayTree.TopLevelItems);
                    overlay.EndUpdate();
                    // update overlay positions
                    overlay.DisplayTree.AdjustPositions();

                    e.Handled = true;
                }
            }
            base.KeyDown(e);
        }
Exemple #13
0
 /// <summary>
 /// KeyUp event, forwarded from the overlay control.
 /// </summary>
 /// <param name="e"></param>
 public virtual void KeyUp(TEKeyArgs e) { }
Exemple #14
0
 /// <summary>
 /// KeyDown event, forwarded from the overlay control.
 /// </summary>
 /// <param name="e"></param>
 public virtual void KeyDown(TEKeyArgs e) { }