Пример #1
0
        private void GroupMouseUpAction(MouseEventArgs e)
        {
            switch (curGroupAction)
            {
            case GroupAction.Drawing:
                groupShapes.SetSelectedShapes(AreaRect);
                if (groupShapes.Count == 0)
                {
                    groupShapes = new GroupShapes();
                }

                curGroupAction = GroupAction.Nothing;
                base.DrawMouseMove(e);
                break;

            case GroupAction.MoveGroupShapes:
                groupShapes.Move();
                groupShapes.MouseUp(this, e);
                curGroupAction = GroupAction.Nothing;
                break;

            case GroupAction.Nothing:
                if (groupShapes.Boundary.Contains(e.Location))
                {
                    Canvas.Cursor = Cursors.Hand;
                }
                else
                {
                    Canvas.Cursor = Cursors.Default;
                }
                break;
            }
        }
Пример #2
0
 private void CheckRightMouseDown(MouseEventArgs e)
 {
     if (groupShapes.Count > 0)
     {
         if (groupShapes.Boundary.Contains(e.Location))
         {
             myMenu.ShowEditShapesMenus(e);
         }
         else
         {
             groupShapes = new GroupShapes();
         }
     }
     else
     {
         if (MouseOnShape(e.Location))
         {
             myMenu.ShowEditShapesMenus(e);
             curMode = EditMode.ShapeMode;
         }
         else
         {
             myMenu.ShowDrawingShapeMenus(e);
         }
     }
 }