Beispiel #1
0
            public TablePresetControl(FormFleetPreset parent)
            {
                ImageLabel CreateDefaultLabel()
                {
                    return(new ImageLabel
                    {
                        Text = "",
                        Anchor = AnchorStyles.Left,
                        ForeColor = parent.ForeColor,
                        Tag = null,
                        TextAlign = ContentAlignment.MiddleLeft,
                        Padding = new Padding(0, 1, 0, 1),
                        Margin = new Padding(2, 1, 2, 1),
                        AutoEllipsis = false,
                        AutoSize = true,
                        Visible = true,

                        ImageList = ResourceManager.Instance.Icons,
                        ImageAlign = ContentAlignment.MiddleCenter,
                        ImageIndex = -1
                    });
                }

                Name            = CreateDefaultLabel();
                Name.ImageAlign = ContentAlignment.MiddleRight;

                // TODO: 本体側がもし 7 隻編成に対応したら変更してください
                Ships = new ImageLabel[6];
                for (int i = 0; i < Ships.Length; i++)
                {
                    Ships[i] = CreateDefaultLabel();
                }

                _tooltip = parent.ToolTipInfo;
            }
Beispiel #2
0
            public void ConfigurationChanged(FormFleetPreset parent)
            {
                var config = Utility.Configuration.Config;
                var font   = config.UI.MainFont;

                Name.Font       = font;
                Name.ImageAlign = config.FormFleet.ShowConditionIcon ? ContentAlignment.MiddleRight : ContentAlignment.MiddleCenter;

                foreach (var ship in Ships)
                {
                    ship.Font = font;

                    if (config.FormFleet.FixShipNameWidth)
                    {
                        ship.AutoSize = false;
                        ship.Size     = new Size(config.FormFleet.FixedShipNameWidth, 20);
                    }
                    else
                    {
                        ship.AutoSize = true;
                    }
                }
            }