Ejemplo n.º 1
0
        public override void OnMouseUp(DrawArea drawArea, MouseEventArgs e)
        {
            _newPolygon = null;
            IsComplete  = true;

            base.OnMouseUp(drawArea, e);
        }
Ejemplo n.º 2
0
 public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
 {
     _newPolygon = new DrawPolygon(e.X, e.Y, e.X + 1, e.Y + 1);
     AddNewObject(drawArea, _newPolygon);
     _lastX = e.X;
     _lastY = e.Y;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Left mouse button is pressed
 /// </summary>
 /// <param name="drawArea"></param>
 /// <param name="e"></param>
 public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
 {
     // Create new polygon, add it to the list
     // and keep reference to it
     newPolygon = new DrawPolygon(e.X, e.Y, e.X + 1, e.Y + 1);
     AddNewObject(drawArea, newPolygon);
     lastX = e.X;
     lastY = e.Y;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Left mouse button is pressed
 /// </summary>
 /// <param name="drawArea"></param>
 /// <param name="e"></param>
 public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
 {
     // Create new polygon, add it to the list
     // and keep reference to it
     newPolygon = new DrawPolygon(e.X, e.Y, e.X + 1, e.Y + 1);
     AddNewObject(drawArea, newPolygon);
     lastX = e.X;
     lastY = e.Y;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Left nouse button is pressed
        /// </summary>
        /// <param name="drawArea"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(ImageDrawBox drawArea, MouseEventArgs e)
        {
            Point p = GetEventPointInArea(drawArea, e);

            // Create new polygon, add it to the list
            // and keep reference to it
            newPolygon = new DrawPolygon(p.X, p.Y, p.X + 1, p.Y + 1);
            AddNewObject(drawArea, newPolygon);
            lastX = p.X;
            lastY = p.Y;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawPolygon drawPolygon = new DrawPolygon();

            foreach (Point p in pointArray)
            {
                drawPolygon.pointArray.Add(p);
            }

            FillDrawObjectFields(drawPolygon);
            return(drawPolygon);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawPolygon drawPolygon = new DrawPolygon();

            foreach(Point p in this.pointArray)
            {
                drawPolygon.pointArray.Add(p);
            }

            FillDrawObjectFields(drawPolygon);
            return drawPolygon;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawPolygon drawPolyLine = new DrawPolygon();

            drawPolyLine.startPoint       = startPoint;
            drawPolyLine.endPoint         = endPoint;
            drawPolyLine.pointArray       = pointArray;
            drawPolyLine._drawedInProcess = _drawedInProcess;

            FillDrawObjectFields(drawPolyLine);
            return(drawPolyLine);
        }
Ejemplo n.º 9
0
        private bool _drawingInProcess = false; // Set to true when drawing

        /// <summary>
        /// Left nouse button is pressed
        /// </summary>
        /// <param name="drawArea"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
        {
            if (e.Button ==
                MouseButtons.Right)
            {
                _drawingInProcess = false;
                newPolyLine.DrawFinish();
                newPolyLine = null;
            }
            else
            {
                Point p = drawArea.BackTrackMouse(new Point(e.X, e.Y));
                if (drawArea.PenType ==
                    DrawingPens.PenType.Generic)
                {
                    if (_drawingInProcess == false)
                    {
                        newPolyLine          = new DrawPolygon(p.X, p.Y, p.X + 1, p.Y + 1, drawArea.LineColor, drawArea.LineWidth);
                        newPolyLine.EndPoint = new Point(p.X + 1, p.Y + 1);
                        AddNewObject(drawArea, newPolyLine);
                        _drawingInProcess = true;
                    }
                    else
                    {
                        // Drawing is in process, so simply add a new point
                        newPolyLine.AddPoint(p);
                        newPolyLine.EndPoint = p;
                    }
                }
                else
                {
                    if (_drawingInProcess == false)
                    {
                        newPolyLine          = new DrawPolygon(p.X, p.Y, p.X + 1, p.Y + 1, drawArea.PenType);
                        newPolyLine.EndPoint = new Point(p.X + 1, p.Y + 1);
                        AddNewObject(drawArea, newPolyLine);
                        _drawingInProcess = true;
                    }
                    else
                    {
                        // Drawing is in process, so simply add a new point
                        newPolyLine.AddPoint(p);
                        newPolyLine.EndPoint = p;
                    }
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Left nouse button is pressed
        /// </summary>
        /// <param name="drawArea"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
        {
            // Create new polygon, add it to the list
            // and keep reference to it
            Point p = drawArea.BackTrackMouse(new Point(e.X, e.Y));

            if (drawArea.PenType ==
                DrawingPens.PenType.Generic)
            {
                newPolygon = new DrawPolygon(p.X, p.Y, p.X + 1, p.Y + 1, drawArea.LineColor, drawArea.LineWidth);
            }
            else
            {
                newPolygon = new DrawPolygon(p.X, p.Y, p.X + 1, p.Y + 1, drawArea.PenType);
            }
            // Set the minimum distance variable according to current zoom level.
            minDistance = Convert.ToInt32((15 * drawArea.Zoom) * (15 * drawArea.Zoom));

            AddNewObject(drawArea, newPolygon);
            lastX = e.X;
            lastY = e.Y;
        }
Ejemplo n.º 11
0
        public override void OnMouseUp(DrawArea drawArea, MouseEventArgs e)
        {
            newPolygon = null;

            base.OnMouseUp(drawArea, e);
        }
Ejemplo n.º 12
0
        public override void OnMouseUp(DrawArea drawArea, MouseEventArgs e)
        {
            newPolygon = null;

            base.OnMouseUp (drawArea, e);
        }