示例#1
0
        public MissionInfoPanel()
        {
            Point checkBoxStartingLocation = new Point(3, 50);
            Point textBoxStartingLocation = new Point(checkBoxStartingLocation.X + 200, checkBoxStartingLocation.Y -3);
            Size textBoxSize = new Size(30, 20);
            int checkBoxIncrement = 23;

            Point checkBoxCurrentLocation = checkBoxStartingLocation;
            Point textBoxCurrentLocation = textBoxStartingLocation;

            this.Location = new Point(553, 6);
            this.Size = new Size(310, 652);                                                 //To change this, also change Maximum size property
            this.MaximumSize = new Size(310, 652);
            this.BackgroundImage = GV.backPanelImage;
            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.BackColor = Color.Transparent;
            this.AutoScroll = true;

            Label missionNameLabel = new Label();
            missionNameLabel.Name = "missionNameLabel";
            missionNameLabel.Text = "Mission name";
            missionNameLabel.AutoSize = true;
            missionNameLabel.Font = GV.generalFont;
            missionNameLabel.Location = new Point(13, 7);
            this.Controls.Add(missionNameLabel);

            ComboBox missionNameComboBox = new ComboBox();
            missionNameComboBox.Name = "missionNameComboBox";
            missionNameComboBox.Size = new Size(150, 21);
            missionNameComboBox.Location = new Point(113, 3);
            missionNameComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            missionNameComboBox.SelectedIndexChanged += new EventHandler(missionNameCB_SelectionChanged);
            this.Controls.Add(missionNameComboBox);

            Label missionDescriptionLabel = new Label();
            missionDescriptionLabel.Name = "missionDescriptionLabel";
            missionDescriptionLabel.Text = "Mission description";
            missionDescriptionLabel.AutoSize = true;
            missionDescriptionLabel.Font = GV.generalFont;
            missionDescriptionLabel.Location = new Point(160, 30);  //5,30
            this.Controls.Add(missionDescriptionLabel);

            TextBox missionDescriptionTextBox = new TextBox();
            missionDescriptionTextBox.Name = "description";
            missionDescriptionTextBox.Location = new Point(5, 27);    //140,20
            missionDescriptionTextBox.Size = new Size(145, 20);
            missionDescriptionTextBox.Multiline = true;
            missionDescriptionTextBox.WordWrap = true;
            missionDescriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            missionDescriptionTextBox.MouseHover += new EventHandler(missionDescriptionTextBox_MouseHover);
            missionDescriptionTextBox.MouseLeave += new EventHandler(missionDescriptionTextBox_MouseLeave);
            missionDescriptionTextBox.TextChanged += new EventHandler(missionDescriptionTextBox_TextChanged);
            this.Controls.Add(missionDescriptionTextBox);
            missionDescriptionTextBox.BringToFront();

            int length = GV.missionFieldArray.GetLength(1);

            for (int i = 0; i < length; i++)    //creates each of the buttons for the control
            {
                InputTypes newGroup = new InputTypes(this, GV.missionFieldArray, i, ref checkBoxCurrentLocation, ref textBoxCurrentLocation, textBoxSize, checkBoxIncrement);
            }
            panelStartingLocation.X = checkBoxCurrentLocation.X +10;
            panelStartingLocation.Y = checkBoxCurrentLocation.Y;
        }
示例#2
0
        private void createPanel(Panel panel, string[,] fieldArray)
        {
            panel.BackColor = Color.DarkRed;
            panel.Width = 311;
            panel.AutoSize = true;
            panel.MinimumSize = new Size(311, 0);
            panel.MaximumSize = new Size(311, 5000);
            panel.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            panel.VisibleChanged += new EventHandler(Panel_VisibleChanged);

            Point checkBoxCurrentLocation = new Point(4, 30);
            Point textBoxCurrentLocation = new Point(191, 27);
            Size textBoxSize = new Size(74, 20);
            int checkBoxIncrement = 27;
            int textBoxIncrement = checkBoxIncrement;

            int length = fieldArray.GetLength(1);
            if (length == 0)
            {
                Label noParameterLabel = new Label();
                noParameterLabel.Text = "No Additional Parameters";
                noParameterLabel.Font = GV.generalFont;
                noParameterLabel.Location = textBoxCurrentLocation;
                noParameterLabel.AutoSize = true;
                panel.Controls.Add(noParameterLabel);

                int titleLocationX = (GV.goalPanelHeight - TextRenderer.MeasureText(noParameterLabel.Text, noParameterLabel.Font).Width) / 2;
                noParameterLabel.Location = new Point(titleLocationX, 27);

            }
            else
            {
                for (int i = 0; i < fieldArray.GetLength(1); i++)    //creates each of the buttons for the control
                {
                    InputTypes newGroup = new InputTypes(panel, fieldArray, i, ref checkBoxCurrentLocation, ref textBoxCurrentLocation, textBoxSize, checkBoxIncrement);
                }
            }
        }
示例#3
0
        public GoalDetailPanel()
        {
            this.BackgroundImage = GV.backPanelImage;
            this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.BackColor = Color.Transparent;
            this.AutoScroll = true;
            this.Size = new Size(340, 605);
            this.Location = new Point(210, 50);

            Point checkBoxStartingLocation = new Point(5, 53);
            Point textBoxStartingLocation = new Point(240, 50);
            Size textBoxSize = new Size(35, 20);
            int checkBoxIncrement = 27;

            Point checkBoxCurrentLocation = checkBoxStartingLocation;
            Point textBoxCurrentLocation = textBoxStartingLocation;
            int textBoxIncrement = checkBoxIncrement;

            Label goalDescriptionLabel = new Label();
            goalDescriptionLabel.Name = "goalDescriptionLabel";
            goalDescriptionLabel.Text = "Goal description (optional)";
            goalDescriptionLabel.Font = GV.generalFont;
            goalDescriptionLabel.AutoSize = true;
            goalDescriptionLabel.Location = new Point(138, 34);
            this.Controls.Add(goalDescriptionLabel);

            Label goalDetailPanelTitleLabel = new Label();
            goalDetailPanelTitleLabel.Name = "goalDetailPanelTitleLabel";
            goalDetailPanelTitleLabel.Text = "Goal parameter editor";
            goalDetailPanelTitleLabel.Font = GV.titleFont;
            goalDetailPanelTitleLabel.AutoSize = true;
            goalDetailPanelTitleLabel.Location = new Point(70, 6);
            this.Controls.Add(goalDetailPanelTitleLabel);

            TextBox goalDescriptionTextBox = new TextBox();
            goalDescriptionTextBox.Name = "description";
            goalDescriptionTextBox.Size = new Size(127, 20);
            goalDescriptionTextBox.Location = new Point(5, 29);
            goalDescriptionTextBox.Multiline = true;
            goalDescriptionTextBox.WordWrap = true;
            goalDescriptionTextBox.MouseEnter += new EventHandler(goalDescriptionBox_MouseEnter);
            goalDescriptionTextBox.MouseLeave += new EventHandler(goalDescriptionBox_MouseLeave);
            goalDescriptionTextBox.TextChanged += new EventHandler(goalDescriptionTextBox_TextChanged);
            goalDescriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.Controls.Add(goalDescriptionTextBox);

            int length = GV.allGoalsFieldArray.GetLength(1);

            for (int i = 0; i < length; i++)    //creates each of the buttons for the control
            {
                InputTypes newGroup = new InputTypes(this, GV.allGoalsFieldArray, i, ref checkBoxCurrentLocation, ref textBoxCurrentLocation, textBoxSize, checkBoxIncrement);
            }
            goalDescriptionTextBox.BringToFront();   //gets the description TextBox to overlay all other items
        }