Esempio n. 1
0
        public TBaseWorkShape CreateTempWorkShape(int AType, Point AStart, int ANumberShapeId = 0)
        {
            TBaseWorkShape m_CurrWorkShape = null;

            if (AType > 0)
            {
                switch (AType)
                {
                case 1:
                    m_CurrWorkShape = new TWork(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 2:
                    m_CurrWorkShape = new TZWork(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 3:
                    m_CurrWorkShape = new TZWorkOR(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 4:
                    m_CurrWorkShape = new TControlWork(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 5:
                    m_CurrWorkShape = new TControlFunc(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 6:
                    m_CurrWorkShape = new TBifurcation(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 7:
                    m_CurrWorkShape = new TCheckConditionCW(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 8:
                    m_CurrWorkShape = new TCycleWhileDo(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 9:
                    m_CurrWorkShape = new TCycleDoWhileDo(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 10:
                    m_CurrWorkShape = new TCycleDoWhileDoFC(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;

                case 11:
                    m_CurrWorkShape = new TCheckCondition(AStart.X, AStart.Y, f_StepPixels, ANumberShapeId, 0, 0);
                    break;
                }
            }
            return(m_CurrWorkShape);
        }
Esempio n. 2
0
        public TBaseWorkShape AddWorkShape(int AType, int ACurrIDShape, int ACurrIDBlock, int ACurrIDLine)
        {
            TBaseWorkShape m_CurrWorkShape = null;

            if (AType > 0)
            {
                switch (AType)
                {
                case 1:
                    m_CurrWorkShape = new TWork(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 2:
                    m_CurrWorkShape = new TWork(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 3:
                    m_CurrWorkShape = new TZWork(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 4:
                    m_CurrWorkShape = new TZWorkOR(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 5:
                    m_CurrWorkShape = new TControlWork(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 6:
                    m_CurrWorkShape = new TControlFunc(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 7:
                    m_CurrWorkShape = new TBifurcation(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 8:
                    m_CurrWorkShape = new TCheckConditionCW(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 9:
                    m_CurrWorkShape = new TCycleWhileDo(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 10:
                    m_CurrWorkShape = new TCycleDoWhileDo(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 11:
                    m_CurrWorkShape = new TCycleDoWhileDoFC(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;

                case 12:
                    m_CurrWorkShape = new TCheckCondition(f_CurrEndPoint.X, f_CurrEndPoint.Y, f_StepPixels, ACurrIDShape, ACurrIDBlock, ACurrIDLine);
                    break;
                }


                m_CurrWorkShape.LEControl = f_LEControl;
                //      m_CurrWorkShape.WndHandler = f_WndHandler;
                m_CurrWorkShape.UnderControl = f_UnderControl;
                //m_CurrWorkShape.OnWSFlagCreate = WsFlagCreate;
                //      m_CurrWorkShape.OnWSFlagDestroy = WsFlagDestroy;
                m_CurrWorkShape.BaseStartPoint =
                    new Point(m_CurrWorkShape.BaseStartPoint.X - f_X_offsSum, m_CurrWorkShape.BaseStartPoint.Y - f_Y_offsSum);
                m_CurrWorkShape.Init();
                m_CurrWorkShape.Prepare();
                f_CurrEndPoint = m_CurrWorkShape.EndPoint;

                f_CurrentCommand = 1;
            }
            return(m_CurrWorkShape);
        }