コード例 #1
0
        void CreateLines()
        {
            TArrowLine    Line, Lnb;
            Point         P = new Point(), P2 = new Point();
            int           tmp_x;
            TTfeRectShape Shape1, Shape2;

            FreeWorkLines();
            F_LastLineId = F_NumberLineId;

            Shape1 = (TTfeRectShape)(GetWorkShape(0));
            Shape2 = (TTfeRectShape)(GetWorkShape(1));
            Shape1.GetTailPoint(0, ref P);


            F_LastLineId++;
            //1
            Line        = new TArrowLine(F_Step, F_LastLineId);
            Line.xStart = StartPoint.X;
            Line.yStart = StartPoint.Y;
            Line.xEnd   = P.X - 3 * F_Step;
            Line.yEnd   = P.Y + 4 * F_Step;
            Line.Bend   = CalcBend(Line.xStart, Line.xEnd);
            AddLine(Line);
            Lnb = Line;
            Shape1.AddWorkLine(Line);



            F_LastLineId++;
            //2
            Line        = new TArrowLine(F_Step, F_LastLineId);
            Line.xStart = Lnb.xEnd;
            Line.yStart = Lnb.yEnd;
            Line.xEnd   = P.X;
            Line.yEnd   = P.Y;
            Line.Bend   = CalcBend(Line.xStart, Line.xEnd);
            //stas   Line.Prepare();
            AddLine(Line);
            Shape1.AddWorkLine(Line);



            Shape1.GetTailPoint(1, ref P);
            Shape2.GetTailPoint(1, ref P2);

            tmp_x = P.X;
            if (tmp_x < P2.X)
            {
                tmp_x = P2.X;
            }
            tmp_x = tmp_x + 3 * F_Step;


            F_LastLineId++;
            //3
            Line        = new TArrowLine(F_Step, F_LastLineId);
            Line.xStart = P.X;
            Line.yStart = P.Y;

            Line.xEnd = tmp_x;
            Line.yEnd = Lnb.yEnd;
            Line.Bend = CalcBend(Line.xStart, Line.xEnd);
            AddLine(Line);
            Shape1.AddWorkLine(Line);


            F_LastLineId++;
            //4
            Line        = new TArrowLine(F_Step, F_LastLineId);
            Line.xStart = P2.X;
            Line.yStart = P2.Y;

            Line.xEnd = tmp_x;
            Line.yEnd = Lnb.yEnd;
            Line.Bend = CalcBend(Line.xStart, Line.xEnd);
            AddLine(Line);
            Shape2.AddWorkLine(Line);


            Shape2.GetTailPoint(0, ref P2);
            F_LastLineId++;
            //5
            Line        = new TArrowLine(F_Step, F_LastLineId);
            Line.xStart = Lnb.xEnd;
            Line.yStart = Lnb.yEnd;

            Line.xEnd = P2.X;
            Line.yEnd = P2.Y;
            Line.Bend = CalcBend(Line.xStart, Line.xEnd);
            AddLine(Line);
            Shape2.AddWorkLine(Line);


            F_LastLineId++;
            //6
            Lnb = (TArrowLine)(GetWorkLine(2));

            Line            = new TArrowLine(F_Step, F_LastLineId);
            Line.PointStart = Lnb.PointEnd;
            Line.xEnd       = Lnb.PointEnd.X + 2 * F_Step;
            Line.yEnd       = Lnb.PointEnd.Y;
            AddLine(Line);
            Shape2.AddWorkLine(Line);
        }