コード例 #1
0
ファイル: DrawCurve.cs プロジェクト: ehsanamid/Engineering
        /// <summary>
        /// Clone this instance
        /// </summary>
        public override DrawObject Clone()
        {
            DrawCurve drawcurve = new DrawCurve(Parentpagelist);

            //FillDrawObjectFields(drawcurve);
            return(drawcurve);
        }
コード例 #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;
                    }
                }
            }
        }