override public void addChildComponent(MenuComponentComposite c) { // Console.WriteLine("list add child component " + this.children.Count); //var name = c.getName(); //float W = this.font.MeasureString(name).X; Rectangle b = new Rectangle(this.leftMargin, this.firstChildDeltaY + this.bounds.Y + (this.childHeight * this.children.Count), this.bounds.Width - this.leftMargin, this.childHeight); // this.bounds.Width - t, this.childHeight); c.setBounds(b); c.setExpandedBounds(this.expandedBounds); base.addChildComponent(c); }
override public void addChildComponent(MenuComponentComposite c) { // Console.WriteLine("Root addChildComponent "); if (this.children.Count > 0) { return; // max one child } int x = (this.bounds.Width * this.childDeltaX) / 100; int y = (this.bounds.Height * this.childDeltaY) / 100; Rectangle childBounds = new Rectangle(this.bounds.X + x, this.bounds.Y + y, //this.bounds.Width - x *2, this.bounds.Height - y *2); this.bounds.Width, this.bounds.Height - y * 2); c.setBounds(childBounds); c.setExpandedBounds(this.bounds); base.addChildComponent(c); }