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

            //drawPolyLine.pointArray = pointArray;
            //FillDrawObjectFields(drawPolyLine);
            return(drawPolyLine);
        }
コード例 #2
0
ファイル: ToolPolyLine.cs プロジェクト: ehsanamid/Engineering
        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)
                {
                    newPolyLine = new DrawPolyLine(drawArea.ParentTabGraphicPageControl.Pages(), p.X, p.Y, p.X + 1, p.Y + 1);
                    //newPolyLine.EndPoint = new Point(p.X + 1, p.Y + 1);
                    newPolyLine.oIndex = drawArea.Pages.GetNewobjectoIndex();
                    AddNewObject(drawArea, newPolyLine);
                    _drawingInProcess = true;
                    newPolyLine.MoveHandleTo(new Point(e.X, e.Y), newPolyLine.HandleCount);
                    drawArea.Refresh();
                    secondclick = true;
                }
                else
                {
                    if ((secondclick))
                    {
                        //newPolyLine.EndPoint = p;
                        newPolyLine.MoveHandleTo(p, newPolyLine.HandleCount);
                        drawArea.Refresh();
                        secondclick = false;
                    }
                    else
                    {
                        newPolyLine.AddPoint(p);
                        //newPolyLine.EndPoint = p;
                        newPolyLine.MoveHandleTo(new Point(e.X, e.Y), newPolyLine.HandleCount);
                        drawArea.Refresh();
                        secondclick = false;
                    }
                }
            }
        }