public void LibFolded(object sender)
        {
            UI_Categorie <UI_Component> curUIlib = sender as UI_Categorie <UI_Component>;
            CompLibrary curlib = CompLibrary.AllUsedLibraries.Find(x => x.name == curUIlib.cat.ID_Name);

            curlib.IsFold = curUIlib.IsFold;
        }
Пример #2
0
        public void RenameLib(object sender)
        {
            UI_StringButton             pressedElement = sender as UI_StringButton;
            UI_Categorie <UI_Component> curUIlib       = Libraries.ui_elements[0].ui_elements.Find(x => x.cat.ID_Name == pressedElement.pos.parent.ID_Name);

            RenameBox1.pos         = new Pos(Libraries.pos.X, (curUIlib.absolutpos.Y - this.pos.Y), ORIGIN.DEFAULT, ORIGIN.DEFAULT, this);
            RenameBox1.size        = curUIlib.cat.size;
            RenameBox1.value       = pressedElement.pos.parent.ID_Name;
            RenameBox1.ID_Name     = pressedElement.pos.parent.ID_Name;
            RenameBox1.GetsUpdated = RenameBox1.GetsDrawn = true;
            RenameBox1.Set2Typing();
        }
        public void Add_Library(CompLibrary libs)
        {
            UI_Categorie <UI_Component> newlib = new UI_Categorie <UI_Component>(libs.name, UI_Handler.cat_conf);

            newlib.cat.ID                 = CompLibrary.AllUsedLibraries.IndexOf(libs);
            newlib.cat.ID_Name            = libs.name;
            newlib.cat.GotActivatedRight += EditProjectLib;
            newlib.GotFolded             += LibFolded;
            newlib.Fold(libs.IsFold);
            for (int i = 0; i < libs.Components.Count; i++)
            {
                int          ID       = i;
                UI_Component cur_comp = new UI_Component(new Pos(0), new Point(20, 20), libs.Components[i].name, ID, 20, UI_Handler.componentconf);
                cur_comp.ID_Name   = libs.name + "|" + libs.Components[i].name;
                cur_comp.Sort_Name = libs.Components[i].catagory + "|" + libs.Components[i].name;

                newlib.AddComponents(cur_comp);
            }
            newlib.SetXSize(size.X - bezelsize * 2);
            Libraries.ui_elements[0].Add_UI_Elements(newlib);
        }