public void CreateForms() { foreach (Form form in MyForms) { Parent.RemoveForm(form); } MyForms.Clear(); int ButtonX = 0; int ButtonY = 0; int Margin = -23; int ButtonSize = 16; AddForm(new Button(SetRotate, ObjectControls3D.RotateIcon, new Vector2(ButtonSize), new Vector2(ButtonX, ButtonY))); ButtonX -= Margin; AddForm(new Button(SetScale, ObjectControls3D.ScaleIcon, new Vector2(ButtonSize), new Vector2(ButtonX, ButtonY))); ButtonX -= Margin; AddForm(new Button(SetMove, ObjectControls3D.MoveIcon, new Vector2(ButtonSize), new Vector2(ButtonX, ButtonY))); SetMove((Button)MyForms[2]); ButtonX -= Margin; GridButton = (Button)Parent.AddForm(new Button(ClickGrid, ObjectControls3D.GridIcon, new Vector2(ButtonSize), new Vector2(ButtonX, ButtonY))); }
internal void AddForm(Form form) { if (Parent != null) { Parent.AddForm(form); } if (AddFormEvent != null) { AddFormEvent(form, EventArgs.Empty); } }
new public void AddForm(Form NewForm) { MyForms.Add(NewForm); Parent.AddForm(NewForm); }