public void CreateShipLabels(int i) { var y = ShipListPanel.LineHeight * i + 1; const int height = ShipListPanel.LabelHeight; var labels = new ShipLabels { Fleet = new ShipLabel.Fleet(new Point(1, 2)), Name = new ShipLabel.Name(new Point(10, 2), ShipNameWidth.ShipList), Hp = new ShipLabel.Hp(new Point(126, 0), ShipListPanel.LineHeight), Cond = new ShipLabel.Cond(new Point(127, 0), ShipListPanel.LineHeight), Level = new ShipLabel.Level(new Point(152, 2), height), Exp = new ShipLabel.Exp(new Point(174, 2), height), BackPanel = new Panel { Location = new Point(0, y), Size = new Size(ListForm.PanelWidth, ShipListPanel.LineHeight), Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top } }; SetAnchorRight(labels.Hp, labels.Cond, labels.Level, labels.Exp); _labelList.Add(labels); labels.Arrange(_shipListPanel, CustomColors.ColumnColors.BrightFirst(i)); labels.Scale(); _shipListPanel.SetHpPercent(labels.Hp); }
public void CreateComponents(int i) { var y = ShipListPanel.LineHeight * i + 1; var labels = new ShipLabels { Fleet = new ShipLabel.Fleet(new Point(1, 2)), Name = new ShipLabel.Name(new Point(10, 2), ShipNameWidth.GroupConfig), Level = new ShipLabel.Level(new Point(90, 2), ShipListPanel.LabelHeight), BackPanel = new Panel { Location = new Point(0, y), Size = new Size(ListForm.PanelWidth, ShipListPanel.LineHeight), Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top } }; var cb = new CheckBox[GroupCount]; for (var j = 0; j < cb.Length; j++) { cb[j] = new CheckBox { Location = new Point(125 + j * 24, 2), FlatStyle = FlatStyle.Flat, Size = new Size(12, 11), Tag = i * 10 + j }; cb[j].CheckedChanged += checkboxGroup_CheckedChanged; } SetAnchorRight(cb.Concat(new Control[] { labels.Level }).ToArray()); _labelList.Add(labels); _checkBoxesList.Add(cb); labels.Arrange(_shipListPanel, CustomColors.ColumnColors.BrightFirst(i)); labels.BackPanel.Controls.AddRange(cb); labels.Scale(); }