예제 #1
0
파일: TreeList.cs 프로젝트: atomaszz/gelios
        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();
            }
        }
예제 #2
0
 void ShapeCopy(TBaseShape Shape, int Num_Shape)
 {
     if (MainList.IsContainsChildShape(Shape.ID))
     {
         Shape.PenColor = f_HaveChildColor;
     }
     if (Shape.ParamAlt != null)
     {
         if (f_AltParamShapeColorEnable)
         {
             Shape.BrushStyle = new SolidBrush(Color.Black);
             Shape.BrushColor = f_AltParamShapeColor;
         }
         else
         {
             Shape.BrushStyle = null;
         }
         Shape.PenColor = f_AltParamLineColor;
     }
 }