private void setData() { this.SuspendLayout(); this.gbMotiveGroup.Controls.Clear(); tops = new ArrayList(); int nextTop = this.lbMin.Bottom + 2; int width = this.Width; if (item != null) { if (item.Parent.Type == TtabItemMotiveTableType.Human) { this.gbMotiveGroup.Controls.Add(this.lbMin); this.gbMotiveGroup.Controls.Add(this.lbDelta); this.gbMotiveGroup.Controls.Add(this.lbType); for (int i = 0; i < item.Count; i++) { TtabSingleMotiveUI c = new TtabSingleMotiveUI(); c.Motive = (TtabItemSingleMotiveItem)item[i]; this.gbMotiveGroup.Controls.Add(c); c.Location = new Point(2, nextTop); tops.Add(nextTop); nextTop += c.Height + 2; width = c.Width; } } else { for (int i = 0; i < item.Count; i++) { TtabAnimalMotiveUI c = new TtabAnimalMotiveUI(); c.Motive = (TtabItemAnimalMotiveItem)item[i]; this.gbMotiveGroup.Controls.Add(c); c.Location = new Point(2, nextTop); tops.Add(nextTop); nextTop += c.Height + 2; width = c.Width; } } } this.Width = 2 + width + 2; this.gbMotiveGroup.Controls.Add(this.btnClear); this.btnClear.Location = new Point((this.Width - this.btnClear.Width) / 2, nextTop + 2); this.Height = this.btnClear.Bottom + 4; this.ResumeLayout(); }
public TtabMotiveGroupUI() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call int muiW, muiH; { TtabSingleMotiveUI c = new TtabSingleMotiveUI(); muiW = c.Width; muiH = c.Height; } this.lbMin.Left = muiW / 6 - this.lbMin.Width / 2; this.lbDelta.Left = muiW / 2 - this.lbDelta.Width / 2; this.lbType.Left = (5 * muiW) / 6 - this.lbType.Width / 2; }