public void Init(Game_Interface Interface, Actor CurrentActor, DockPanel Dock, List <ToolForm> OpenForms) { InitializeComponent(); this._Interface = Interface; this._CurrentActor = CurrentActor; this._Dock = Dock; this._OpenForms = OpenForms; PropertiesHolder Geometries = new PropertiesHolder(); Geometries.SetTitleColor(Color.FromArgb(80, 80, 80)); Geometries.Title = "Geometries"; Geometries.Toggled = false; for (int i = 0; i < CurrentActor.Geometries.Count; i++) { Properties_Geometry NewGeometry = new Properties_Geometry(Interface, CurrentActor, i); Geometries.AddControl(NewGeometry); } this.AddControl(Geometries); _Materials = new PropertiesHolder(); _Materials.SetTitleColor(Color.FromArgb(80, 80, 80)); _Materials.Title = "Materials"; _Materials.Toggled = false; for (int i = 0; i < CurrentActor.Materials.Count; i++) { Properties_Material NewMaterial = new Properties_Material(Interface, CurrentActor, Dock, OpenForms, i); _Materials.AddControl(NewMaterial); } _AddMaterial = new PropertiesInput_Button("", "Add Material", new EventHandler(AddMaterial)); _Materials.AddControl(_AddMaterial); this.AddControl(_Materials); }
public void AddControl(Control NewControl) { NewControl.Dock = DockStyle.Top; this.Controls.Add(NewControl); NewControl.BringToFront(); object Test = NewControl.GetType(); if (NewControl.GetType().IsSubclassOf(typeof(PropertiesHolder)) || NewControl.GetType() == typeof(PropertiesHolder)) { PropertiesHolder ChildHolder = NewControl as PropertiesHolder; ChildHolder.ToggleChanged += new EventHandler(ChildToggleChanged); } TitleLabel.SendToBack(); ChangeToggle(_Toggled); }