Exemplo n.º 1
0
        void ClearWorkSpace()
        {
            f_Operation = 0;
            TAltSelectorItem Item;

            f_AlternateController.ClearAll();
            f_AltSelector.ClearAll();
            f_AltStackController.ClearAll();
            MainList.ClearAll();
            LevelController.ClearAll();
            LevelController.Push(0);
            Grid.ClearAll();
            //      f_StackHistory.Clear();
            //      f_StackHistory.InitStack();

            f_IdAlternative = 0;
            f_CurrIDBlock   = 1;
            f_CurrIDShape   = 0;
            f_CurrIDLine    = 0;
            //      sbY.Max = 0;
            //       sbX.Max = 0;
            X_Base      = Y_Base = X_Ofs = Y_Ofs = 0;
            f_Operation = 0;

            Item                   = f_AltSelector.CreateNewAlternateID(LevelController.ParentShapeID);
            f_IdAlternative        = Item.ID;
            f_NumAlternative       = f_AltSelector.AddAltItem(f_IdAlternative);
            f_IdAlternativeParent  = f_IdAlternative;
            f_NumAlternativeParent = f_NumAlternative;
            MainList.CreateAlternate(null, null, f_IdAlternative, f_NumAlternative);
            f_AltStackController.Push(f_IdAlternative, f_NumAlternative,
                                      f_IdAlternativeParent, f_NumAlternativeParent);

            //     PrepareTabs(f_NumAlternative);
            //      PrepareScroll();
            ListChange();
            AlternateListChange();
            Grid.PrepareLevel();
            Grid.PreparePaint();
            SetNewPolygon();
            pbMain.Invalidate();
        }
Exemplo n.º 2
0
        public FrmMain()
        {
            InitializeComponent();
            CreateSectionBar();
            /*-----------------------*/
            TAltSelectorItem Item;

            f_IsDebug       = false; //HasParam("debug");
            f_StepPixel     = 8;
            f_PaintPixels   = true;
            f_DrawFrameLine = false;
            f_FonColor      = Color.White;
            f_PixelColor    = Color.Black;
            pbMainBitMap    = new Bitmap(pbMain.Width, pbMain.Height);
            pbMainGrph      = Graphics.FromImage(pbMainBitMap);
            /*-----------------------------*/
            bmp = new Bitmap(pbMain.Width, pbMain.Height);
            pbMain.BackgroundImage = bmp;
            g        = Graphics.FromImage(bmp);
            redBrush = new SolidBrush(Color.Red);
            /*----------------------------*/
            Grid              = new TPaintGrid(this);
            Grid.LEControl    = true;
            Grid.WndHandler   = this.Handle;
            Grid.UnderControl = pbMain;
            CreateSectionBar();
            MainList = new TListNode();
            MainList.OnListChange = ListChange;
            LevelController       = new TLevelController();
            LevelController.Push(0);
            f_IdAlternative  = 0;
            f_CurrIDBlock    = 1;
            f_CurrIDShape    = 0;
            f_CurrIDLine     = 0;
            f_WSPenWidth     = 1;
            f_FrameLineColor = Color.Black;
            sbY.Maximum      = 0;
            sbX.Maximum      = 0;
            X_Base           = Y_Base = X_Ofs = Y_Ofs = 0;
            f_LineColor      = Color.Black;
            f_BrushTFE       = false;
            f_BrushColor     = Color.White;
            //     f_FontTFE = new Graphics::TFont;
            f_FlagType                         = 1;
            f_ColorLeave                       = Color.Red;
            f_ColorEnter                       = Color.Yellow;
            __idls                             = 0;
            f_FrameColorTFE                    = Color.Red;
            f_FrameColorTFS                    = Color.Red;
            f_HaveChildColor                   = Color.Green;
            f_AltFlagColor                     = Color.Blue;
            f_AltEnterFlagColor                = Color.Aqua;
            f_AltArrowColor                    = Color.Blue;
            f_AltEnterArrowColor               = Color.Aqua;
            f_AltLineColor                     = Color.Blue;
            f_AltEnabledFlagColor              = Color.Silver;
            f_Operation                        = 0;
            f_TypeParam                        = SharedConst.PROP;
            f_CanModifyPenWidth                = false;
            f_AltParamLineColor                = Color.Fuchsia;
            f_AltParamShapeColor               = Color.Yellow;
            f_AltParamShapeColorEnable         = false;
            f_CheckNud                         = false;
            f_AlternateController              = new TAlternateController(Handle);
            f_AlternateController.OnListChange = AlternateListChange;
            f_AlternateController.LEControl    = true;
            f_AlternateController.WndHandler   = this.Handle;
            f_AlternateController.UnderControl = pbMain;
            f_AltSelector                      = new TAltSelector();
            f_AltStackController               = new TAltStackController();
            //   f_MenuController = new TMenuController;
            //   f_ContextMenuController = new TMenuController;
            Item                   = f_AltSelector.CreateNewAlternateID(LevelController.ParentShapeID);
            f_IdAlternative        = Item.ID;
            f_NumAlternative       = f_AltSelector.AddAltItem(f_IdAlternative);
            f_IdAlternativeParent  = f_IdAlternative;
            f_NumAlternativeParent = f_NumAlternative;
            MainList.CreateAlternate(null, null, f_IdAlternative, f_NumAlternative);
            f_AltStackController.Push(f_IdAlternative, f_NumAlternative,
                                      f_IdAlternativeParent, f_NumAlternativeParent);
            f_ColorSetup = new TColorSetup();

            /*      f_RSettings = new TGlsRegistry();
             *    GMess = new TMessangers();
             *    f_AV = new TAlternateView;
             *    f_StackHistory = new TDynamicArray();
             *    f_ActList = new TGlsActionList;
             *    InitActionList();
             *    f_RSettings.Path = "\\Software\\TFEGraph\\GLS";
             *    RestoreSettings();
             *    GMess.RegistrMessage(1, ContainsChildShape);
             *    GMess.RegistrMessage(2, SaveHideBar);
             *    GMess.RegistrMessage(3, CompareWS);
             *    GMess.RegistrMessage(4, GLBCheckUsedPath);
             *    GMess.RegistrMessage(5, GLBShowPredicateModel);
             *    GMess.RegistrMessage(6, GLBFindTFS);
             *    GMess.RegistrMessage(7, GLBApplySettingsForOutherGrid);*/
            InitHelp();
            InitPieModule();
            f_Zadacha = new TZadacha();
            /* f_ClipCopyTFS = new TClipCopyTFS(Handle, 0x8000000); */
            f_PredicatePath    = new TPredicatePath();
            f_PredicateDopPrav = "";

            /*        ApplySettings();
             *      randomize();*/

            //      pbGraph = pbMain.CreateGraphics();

            /*       rectMainShow = new Rectangle(0, 0, pbMain.Width, pbMain.Height);
             *     pntMainShow = new PaintEventArgs(pbGraph, rectMainShow);*/
            SharedConst.opt_sadacha = new FmOptSadacha();
        }