Example #1
0
        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawCurve drawcurve = new DrawCurve(Parentpagelist);

            //FillDrawObjectFields(drawcurve);
            return(drawcurve);
        }
Example #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)
                {
                    newCurve        = new DrawCurve(drawArea.ParentTabGraphicPageControl.Pages(), p.X, p.Y, p.X + 1, p.Y + 1);
                    newCurve.oIndex = drawArea.Pages.GetNewobjectoIndex();
                    AddNewObject(drawArea, newCurve);
                    _drawingInProcess = true;
                    newCurve.MoveHandleTo(new Point(e.X, e.Y), newCurve.HandleCount);
                    drawArea.Refresh();
                    secondclick = true;
                }
                else
                {
                    if ((secondclick))
                    {
                        //newCurve.EndPoint = p;
                        newCurve.MoveHandleTo(p, newCurve.HandleCount);
                        drawArea.Refresh();
                        secondclick = false;
                    }
                    else
                    {
                        newCurve.AddPoint(p);
                        //newCurve.EndPoint = p;
                        newCurve.MoveHandleTo(new Point(e.X, e.Y), newCurve.HandleCount);
                        drawArea.Refresh();
                        secondclick = false;
                    }
                }
            }
        }