Esempio n. 1
0
        public void FillTreeFromList(ref TListNode AListNode)
        {
            TTreeStackItem     Item;
            TAltInfoItem       AltInfoItem;
            TAlternateTreeList AT;
            TNodeMain          Node;
            TTreeListTFS       Tfs;
            TMainTreeList      AMT;
            TMainTreeList      MNew;
            TTreeListItem      LI;

            Init(0);
            Item = f_Stack.GetLevel();
            while (Item != null)
            {
                AMT = FindByLevel(f_TreeList, Item.Level);
                if (AMT != null)
                {
                    AListNode.LoadInfoForAlternate(ref f_AltInfo, Item.Level);
                    for (int i = 0; i <= f_AltInfo.ItemCount - 1; i++)
                    {
                        AltInfoItem        = f_AltInfo.GetItem(i);
                        AT                 = new TAlternateTreeList();
                        AT.MainAlternative = AltInfoItem.Main;
                        AT.NodeStart       = AltInfoItem.NodeStart;
                        AT.NodeEnd         = AltInfoItem.NodeEnd;
                        AT.ID              = AltInfoItem.ID;
                        AT.Num             = AltInfoItem.Num;
                        Node               = AListNode.SearchFirstNodeToAlternate(AltInfoItem.ID, AltInfoItem.Num, Item.Level);
                        while (Node != null)
                        {
                            Tfs = new TTreeListTFS(Node.WorkShape);
                            AT.AddToAlternate(Tfs);
                            for (int j = 0; j <= Tfs.ItemCount - 1; j++)
                            {
                                LI = Tfs.GetTreeTFEItem(j);
                                f_Stack.AddToStack(LI.BaseShape.ID);
                                if (AListNode.IsContainsChildShape(LI.BaseShape.ID))
                                {
                                    if (LI.MainNode == null)
                                    {
                                        MNew        = new TMainTreeList();
                                        MNew.Level  = LI.BaseShape.ID;
                                        LI.MainNode = MNew;
                                    }
                                }
                            }
                            Node = AListNode.SearchNextNodeToAlternate(AltInfoItem.ID, AltInfoItem.Num, Node);
                        }
                        AMT.AddToTree(AT);
                    }
                }
                Item.Fixed = true;
                Item       = f_Stack.GetLevel();
            }
        }
Esempio 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();
        }
Esempio n. 3
0
 public void SetMainList(TListNode AList)
 {
     MainList = AList;
 }
Esempio n. 4
0
 public TNodeSearchController()
 {
     List     = new List <object>();
     MainList = null;
 }