예제 #1
0
        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawPolygon drawpolygon = new DrawPolygon(Parentpagelist);

            //drawPolyLine.pointArray = pointArray;
            //FillDrawObjectFields(drawPolyLine);
            return(drawpolygon);
        }
예제 #2
0
        public 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 = null;
            }
            else
            {
                Point p = drawArea.BackTrackMouse(new Point(e.X, e.Y));
                if (_drawingInProcess == false)
                {
                    newPolygon = new DrawPolygon(drawArea.ParentTabGraphicPageControl.Pages(), p.X, p.Y, p.X + 1, p.Y + 1);
                    //newPolygon.EndPoint = new Point(p.X + 1, p.Y + 1);
                    newPolygon.oIndex = drawArea.Pages.GetNewobjectoIndex();
                    AddNewObject(drawArea, newPolygon);
                    _drawingInProcess = true;
                    newPolygon.MoveHandleTo(new Point(e.X, e.Y), newPolygon.HandleCount);
                    drawArea.Refresh();
                    secondclick = true;
                }
                else
                {
                    if ((secondclick))
                    {
                        //newPolygon.EndPoint = p;
                        newPolygon.MoveHandleTo(p, newPolygon.HandleCount);
                        drawArea.Refresh();
                        secondclick = false;
                    }
                    else
                    {
                        newPolygon.AddPoint(p);
                        //newPolygon.EndPoint = p;
                        newPolygon.MoveHandleTo(new Point(e.X, e.Y), newPolygon.HandleCount);
                        drawArea.Refresh();
                        secondclick = false;
                    }
                }
            }
        }