コード例 #1
0
        public ChoiceMenuPanel(Main mainForm) :
            base((int)(mainForm.ClientSize.Width * 0.174), (int)(mainForm.ClientSize.Height * 0.34), "Civilization II Multiplayer Gold", 38, 46)
        {
            _mainForm = mainForm;

            // Radio buttons
            _radioBtn = new Civ2radioBtn[8];
            string[] txt = { "Start a New Game", "Start on Premade World", "Customize World", "Begin Scenario", "Load a Game", "Multiplayer Game", "View Hall of Fame", "View Credits" };
            for (int i = 0; i < 7; i++)
            {
                _radioBtn[i] = new Civ2radioBtn
                {
                    Text     = txt[i],
                    Location = new Point(10, (int)(DrawPanel.Height / 7) * i),
                };
                DrawPanel.Controls.Add(_radioBtn[i]);
            }
            _radioBtn[0].Checked = true;

            // OK button
            var _OKbutton = new Civ2button
            {
                Location = new Point(9, Height - 42),
                Size     = new Size(156, 36),
                Text     = "OK"
            };

            Controls.Add(_OKbutton);
            _OKbutton.Click += OKButton_Click;

            // Cancel button
            var _cancelButton = new Civ2button
            {
                Location = new Point(168, Height - 42),
                Size     = new Size(157, 36),
                Text     = "Cancel"
            };

            Controls.Add(_cancelButton);
            _cancelButton.Click += CancelButton_Click;
        }
コード例 #2
0
        public CityBuyPanel(CityPanel parent, City city) : base(814, 212, "", 38, 46)
        {
            _parent = parent;
            _city   = city;

            this.Paint += CityBuyPanel_Paint;

            // Add DrawPanel from base control
            Controls.Add(DrawPanel);
            DrawPanel.Paint += DrawPanel_Paint;

            // OK button
            var _OKButton = new Civ2button
            {
                Location = new Point(9, 170),
                Size     = new Size(796, 36),
                Text     = "OK"
            };

            Controls.Add(_OKButton);
            _OKButton.Click += OKButton_Click;

            // Radio button 1
            _completeitButton = new Civ2radioBtn
            {
                Text     = "Complete it.",
                Location = new Point(140, 69),
            };
            DrawPanel.Controls.Add(_completeitButton);

            // Radio button 2
            _nevermindButton = new Civ2radioBtn
            {
                Text     = "Never mind.",
                Location = new Point(140, 98),
            };
            DrawPanel.Controls.Add(_nevermindButton);
            _nevermindButton.Checked = true;
        }