private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.but_Start  = new MissionPlanner.Controls.MyButton();
     this.panel1     = new System.Windows.Forms.Panel();
     this.lbl_mode   = new System.Windows.Forms.Label();
     this.timer1     = new System.Windows.Forms.Timer(this.components);
     this.SuspendLayout();
     //
     // but_Start
     //
     this.but_Start.Location = new System.Drawing.Point(12, 12);
     this.but_Start.Name     = "but_Start";
     this.but_Start.Size     = new System.Drawing.Size(75, 23);
     this.but_Start.TabIndex = 0;
     this.but_Start.Text     = "Start";
     this.but_Start.UseVisualStyleBackColor = true;
     this.but_Start.Click += new System.EventHandler(this.myButton1_Click);
     //
     // panel1
     //
     this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.panel1.Location = new System.Drawing.Point(12, 103);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(870, 412);
     this.panel1.TabIndex = 1;
     this.panel1.Paint   += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
     //
     // lbl_mode
     //
     this.lbl_mode.AutoSize = true;
     this.lbl_mode.Location = new System.Drawing.Point(93, 17);
     this.lbl_mode.Name     = "lbl_mode";
     this.lbl_mode.Size     = new System.Drawing.Size(35, 13);
     this.lbl_mode.TabIndex = 2;
     this.lbl_mode.Text     = "label1";
     //
     // timer1
     //
     this.timer1.Enabled = true;
     this.timer1.Tick   += new System.EventHandler(this.timer1_Tick);
     //
     // UI
     //
     this.ClientSize = new System.Drawing.Size(894, 527);
     this.Controls.Add(this.lbl_mode);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.but_Start);
     this.Name = "UI";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
示例#2
0
        private void addRow(DropTarget target, int index)
        {
            // The index above is the index in the array of targets
            // The index will be used as a display index, and row 0 is used by the 'generate' and 'cancel' buttons
            index++;

            this.selected.Add(false);

            var addButton = new Controls.MyButton {
                Location = new Point(12, 12 + 45 * index),
                Name     = $"addButton_{index}",
                Size     = new Size(60, 21),
                TabIndex = index * 2,
                Text     = "Add",
                UseVisualStyleBackColor = true
            };

            // Convert between display index and data index
            addButton.Click += GetAddClickHandler(index - 1);

            this.addButtons.Add(addButton);
            this.Controls.Add(addButton);

            var removeButton = new Controls.MyButton {
                Location = new Point(84, 12 + 45 * index),
                Name     = $"removeButton_{index}",
                Size     = new Size(60, 21),
                TabIndex = index * 2 + 1,
                Text     = "Remove",
                Enabled  = false,
                UseVisualStyleBackColor = true
            };

            // Convert between display index and data index
            removeButton.Click += GetRemoveClickHandler(index - 1);

            this.Controls.Add(removeButton);
            this.removeButtons.Add(removeButton);

            var dropTargetIndexLabel = new Label {
                Location  = new Point(156, 12 + 45 * index),
                Size      = new Size(20, 21),
                Name      = $"indexLabel_{index}",
                Text      = $"{index}",
                TextAlign = ContentAlignment.MiddleLeft
            };

            this.Controls.Add(dropTargetIndexLabel);
        }
示例#3
0
        private static void ApplyTestTheme(Control temp, int level)
        {
            foreach (Control ctl in temp.Controls)
            {
                if (ctl.GetType() == typeof(MyButton))
                {
                    Controls.MyButton but = (MyButton)ctl;
                    but.BGGradTop = SystemColors.ControlLight;
                    but.BGGradBot = SystemColors.ControlDark;
                    but.TextColor = SystemColors.ControlText;
                    but.Outline   = SystemColors.ControlDark;
                }

                if (ctl.Controls.Count > 0)
                {
                    ApplyTestTheme(ctl, 1);
                }
            }
        }
示例#4
0
        private static void ApplyNone(Control temp, int level)
        {
            foreach (Control ctl in temp.Controls)
            {
                if (ctl.GetType() == typeof(MyButton))
                {
                    Controls.MyButton but = (MyButton)ctl;
                    but.BGGradTop = Color.FromArgb(242, 242, 242);
                    but.BGGradBot = Color.FromArgb(207, 207, 207);
                    but.ForeColor = Color.Black;
                    but.TextColor = Color.Black;
                    but.Outline   = Color.FromArgb(112, 112, 112);
                }

                if (ctl.Controls.Count > 0)
                {
                    ApplyNone(ctl, 1);
                }
            }
        }
示例#5
0
        private static void ApplyBurntKermitTheme(Control temp, int level)
        {
            Color BGColor        = Color.FromArgb(0x26, 0x27, 0x28); // background
            Color ControlBGColor = Color.FromArgb(0x43, 0x44, 0x45); // editable bg color
            Color TextColor      = Color.White;

            if (level == 0)
            {
                temp.BackColor = BGColor;
                temp.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
            }

            //temp.Font = new Font("Lucida Console", 8.25f);

            foreach (Control ctl in temp.Controls)
            {
                if (ctl.GetType() == typeof(Button))
                {
                    ctl.ForeColor = Color.Black;
                }
                else if (ctl.GetType() == typeof(MyButton))
                {
                    Color PrimeColor = Color.FromArgb(0x94, 0xc1, 0x1f);

                    Controls.MyButton but = (MyButton)ctl;
                    //but.BGGradTop = Color.FromArgb(PrimeColor.R, PrimeColor.G, PrimeColor.B);
                    //but.BGGradBot = Color.FromArgb(255 - (int)(PrimeColor.R * 0.27), 255 - (int)(PrimeColor.G * 0.14), 255 - (int)(PrimeColor.B * 0.79));
                    //but.ForeColor = Color.FromArgb(0x40, 0x57, 0x04); //Color.FromArgb(255 - (int)(PrimeColor.R * 0.7), 255 - (int)(PrimeColor.G * 0.8), 255 - (int)(PrimeColor.B * 0.1));
                    //but.Outline = ControlBGColor;
                }
                else if (ctl.GetType() == typeof(TextBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
                    TextBox txt = (TextBox)ctl;
                    txt.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(DomainUpDown))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
                    DomainUpDown txt = (DomainUpDown)ctl;
                    txt.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(GroupBox))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
                }

                else if (ctl.GetType() == typeof(Form))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
                }
                else if (ctl.GetType() == typeof(RichTextBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    RichTextBox txtr = (RichTextBox)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(CheckedListBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    CheckedListBox txtr = (CheckedListBox)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(TabPage))
                {
                    ctl.BackColor = BGColor;  //ControlBGColor
                    ctl.ForeColor = TextColor;
                    TabPage txtr = (TabPage)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(TabControl))
                {
                    ctl.BackColor = BGColor;  //ControlBGColor
                    ctl.ForeColor = TextColor;
                    TabControl txtr = (TabControl)ctl;
                }
                else if (ctl.GetType() == typeof(DataGridView))
                {
                    ctl.ForeColor = TextColor;
                    DataGridView dgv = (DataGridView)ctl;
                    dgv.EnableHeadersVisualStyles = false;
                    dgv.BorderStyle     = BorderStyle.None;
                    dgv.BackgroundColor = BGColor;
                    DataGridViewCellStyle rs = new DataGridViewCellStyle();
                    rs.BackColor             = ControlBGColor;
                    rs.ForeColor             = TextColor;
                    dgv.RowsDefaultCellStyle = rs;

                    DataGridViewCellStyle hs = new DataGridViewCellStyle(dgv.ColumnHeadersDefaultCellStyle);
                    hs.BackColor = BGColor;
                    hs.ForeColor = TextColor;

                    dgv.ColumnHeadersDefaultCellStyle = hs;
                    dgv.RowHeadersDefaultCellStyle    = hs;
                }
                else if (ctl.GetType() == typeof(ComboBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    ComboBox CMB = (ComboBox)ctl;
                    CMB.FlatStyle = FlatStyle.Flat;
                }
                else if (ctl.GetType() == typeof(NumericUpDown))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(TrackBar))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(LinkLabel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    LinkLabel LNK = (LinkLabel)ctl;
                    LNK.ActiveLinkColor  = TextColor;
                    LNK.LinkColor        = TextColor;
                    LNK.VisitedLinkColor = TextColor;
                }
                else if (ctl.GetType() == typeof(BackstageView))
                {
                    var bsv = ctl as BackstageView;

                    bsv.BackColor              = BGColor;
                    bsv.ButtonsAreaBgColor     = ControlBGColor;
                    bsv.HighlightColor2        = Color.FromArgb(0x94, 0xc1, 0x1f);
                    bsv.HighlightColor1        = Color.FromArgb(0x40, 0x57, 0x04);
                    bsv.SelectedTextColor      = Color.White;
                    bsv.UnSelectedTextColor    = Color.Gray;
                    bsv.ButtonsAreaPencilColor = Color.DarkGray;
                }

                if (ctl.Controls.Count > 0)
                {
                    ApplyBurntKermitTheme(ctl, 1);
                }
            }
        }
        void doButtontoUI(string name, int x, int y)
        {
            MyLabel  butlabel      = new MyLabel();
            ComboBox butnumberlist = new ComboBox();

            Controls.MyButton     but_detect = new Controls.MyButton();
            HorizontalProgressBar hbar       = new HorizontalProgressBar();
            ComboBox cmbaction = new ComboBox();

            Controls.MyButton but_settings = new Controls.MyButton();

            if (MainV2.joystick == null)
            {
                butlabel.Dispose();
                butnumberlist.Dispose();
                but_detect.Dispose();
                hbar.Dispose();
                cmbaction.Dispose();
                but_settings.Dispose();
                return;
            }

            var config = MainV2.joystick.getButton(int.Parse(name));

            // do this here so putting in text works
            this.Controls.AddRange(new Control[] { butlabel, butnumberlist, but_detect, hbar, cmbaction, but_settings });

            butlabel.Location = new Point(x, y);
            butlabel.Size     = new Size(47, 13);
            butlabel.Text     = "Button " + (int.Parse(name) + 1);

            butnumberlist.Location      = new Point(72, y);
            butnumberlist.Size          = new Size(70, 21);
            butnumberlist.DataSource    = getButtonNumbers();
            butnumberlist.DropDownStyle = ComboBoxStyle.DropDownList;
            butnumberlist.Name          = "cmbbutton" + name;
            //if (Settings.Instance["butno" + name] != null)
            //  butnumberlist.Text = (Settings.Instance["butno" + name].ToString());
            //if (config.buttonno != -1)
            butnumberlist.Text = config.buttonno.ToString();
            butnumberlist.SelectedIndexChanged += new EventHandler(cmbbutton_SelectedIndexChanged);

            but_detect.Location = new Point(BUT_detch1.Left, y);
            but_detect.Size     = BUT_detch1.Size;
            but_detect.Text     = BUT_detch1.Text;
            but_detect.Name     = "mybut" + name;
            but_detect.Click   += new EventHandler(BUT_detbutton_Click);

            hbar.Location = new Point(progressBarRoll.Left, y);
            hbar.Size     = progressBarRoll.Size;
            hbar.Name     = "hbar" + name;

            cmbaction.Location = new Point(hbar.Right + 5, y);
            cmbaction.Size     = new Size(100, 21);

            cmbaction.DataSource = Enum.GetNames(typeof(Joystick.buttonfunction));
            //Common.getModesList(MainV2.comPort.MAV.cs);
            //cmbaction.ValueMember = "Key";
            //cmbaction.DisplayMember = "Value";
            cmbaction.Tag           = name;
            cmbaction.DropDownStyle = ComboBoxStyle.DropDownList;
            cmbaction.Name          = "cmbaction" + name;
            //if (Settings.Instance["butaction" + name] != null)
            //  cmbaction.Text = Settings.Instance["butaction" + name].ToString();
            //if (config.function != Joystick.buttonfunction.ChangeMode)
            cmbaction.Text = config.function.ToString();
            cmbaction.SelectedIndexChanged += cmbaction_SelectedIndexChanged;

            but_settings.Location = new Point(cmbaction.Right + 5, y);
            but_settings.Size     = BUT_detch1.Size;
            but_settings.Text     = "Settings";
            but_settings.Name     = "butsettings" + name;
            but_settings.Click   += but_settings_Click;
            but_settings.Tag      = cmbaction;

            if ((but_settings.Bottom + 30) > this.Height)
            {
                this.Height += 25;
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components    = new System.ComponentModel.Container();
     this.BUT_detch     = new MissionPlanner.Controls.MyButton();
     this.revCH         = new System.Windows.Forms.CheckBox();
     this.label13       = new System.Windows.Forms.Label();
     this.expo_ch       = new System.Windows.Forms.TextBox();
     this.ProgressBarCH = new MissionPlanner.Controls.HorizontalProgressBar();
     this.CMB_CH        = new System.Windows.Forms.ComboBox();
     this.timer1        = new System.Windows.Forms.Timer(this.components);
     this.SuspendLayout();
     //
     // BUT_detch
     //
     this.BUT_detch.ImeMode  = System.Windows.Forms.ImeMode.NoControl;
     this.BUT_detch.Location = new System.Drawing.Point(141, 3);
     this.BUT_detch.Name     = "BUT_detch";
     this.BUT_detch.Size     = new System.Drawing.Size(45, 23);
     this.BUT_detch.TabIndex = 62;
     this.BUT_detch.Text     = "Auto Detect";
     this.BUT_detch.UseVisualStyleBackColor = true;
     this.BUT_detch.Click += new System.EventHandler(this.BUT_detch_Click);
     //
     // revCH
     //
     this.revCH.AutoSize = true;
     this.revCH.ImeMode  = System.Windows.Forms.ImeMode.NoControl;
     this.revCH.Location = new System.Drawing.Point(406, 6);
     this.revCH.Name     = "revCH";
     this.revCH.Size     = new System.Drawing.Size(15, 14);
     this.revCH.TabIndex = 61;
     this.revCH.UseVisualStyleBackColor = true;
     this.revCH.CheckedChanged         += new System.EventHandler(this.revCH_CheckedChanged);
     //
     // label13
     //
     this.label13.AutoSize = true;
     this.label13.ImeMode  = System.Windows.Forms.ImeMode.NoControl;
     this.label13.Location = new System.Drawing.Point(2, 8);
     this.label13.Name     = "label13";
     this.label13.Size     = new System.Drawing.Size(22, 13);
     this.label13.TabIndex = 60;
     this.label13.Text     = "CH";
     //
     // expo_ch
     //
     this.expo_ch.BorderStyle  = System.Windows.Forms.BorderStyle.None;
     this.expo_ch.Location     = new System.Drawing.Point(300, 7);
     this.expo_ch.Name         = "expo_ch";
     this.expo_ch.Size         = new System.Drawing.Size(100, 13);
     this.expo_ch.TabIndex     = 59;
     this.expo_ch.Text         = "0";
     this.expo_ch.TextChanged += new System.EventHandler(this.expo_ch_TextChanged);
     //
     // ProgressBarCH
     //
     this.ProgressBarCH.DrawLabel = true;
     this.ProgressBarCH.ImeMode   = System.Windows.Forms.ImeMode.NoControl;
     this.ProgressBarCH.Label     = null;
     this.ProgressBarCH.Location  = new System.Drawing.Point(192, 2);
     this.ProgressBarCH.Maximum   = 2200;
     this.ProgressBarCH.maxline   = 0;
     this.ProgressBarCH.Minimum   = 800;
     this.ProgressBarCH.minline   = 0;
     this.ProgressBarCH.Name      = "ProgressBarCH";
     this.ProgressBarCH.Size      = new System.Drawing.Size(100, 23);
     this.ProgressBarCH.TabIndex  = 58;
     this.ProgressBarCH.Value     = 800;
     //
     // CMB_CH
     //
     this.CMB_CH.FormattingEnabled = true;
     this.CMB_CH.Items.AddRange(new object[] {
         "RZ",
         "X",
         "Y",
         "SL1"
     });
     this.CMB_CH.Location              = new System.Drawing.Point(65, 3);
     this.CMB_CH.Name                  = "CMB_CH";
     this.CMB_CH.Size                  = new System.Drawing.Size(70, 21);
     this.CMB_CH.TabIndex              = 57;
     this.CMB_CH.SelectedIndexChanged += new System.EventHandler(this.CMB_CH_SelectedIndexChanged);
     //
     // timer1
     //
     this.timer1.Enabled = true;
     this.timer1.Tick   += new System.EventHandler(this.timer1_Tick);
     //
     // JoystickAxis
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.BUT_detch);
     this.Controls.Add(this.revCH);
     this.Controls.Add(this.label13);
     this.Controls.Add(this.expo_ch);
     this.Controls.Add(this.ProgressBarCH);
     this.Controls.Add(this.CMB_CH);
     this.Name = "JoystickAxis";
     this.Size = new System.Drawing.Size(427, 28);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogBrowse));
     this.dataGridView1 = new System.Windows.Forms.DataGridView();
     this.BUT_Graphit = new MissionPlanner.Controls.MyButton();
     this.BUT_cleargraph = new MissionPlanner.Controls.MyButton();
     this.BUT_loadlog = new MissionPlanner.Controls.MyButton();
     this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     this.zg1 = new ZedGraph.ZedGraphControl();
     this.myGMAP1 = new MissionPlanner.Controls.myGMAP();
     this.treeView1 = new System.Windows.Forms.TreeView();
     this.CMB_preselect = new System.Windows.Forms.ComboBox();
     this.BUT_removeitem = new MissionPlanner.Controls.MyButton();
     this.CHK_map = new System.Windows.Forms.CheckBox();
     this.BUT_Graphit_R = new MissionPlanner.Controls.MyButton();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
     this.splitContainer1.Panel1.SuspendLayout();
     this.splitContainer1.Panel2.SuspendLayout();
     this.splitContainer1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
     this.splitContainer2.Panel1.SuspendLayout();
     this.splitContainer2.Panel2.SuspendLayout();
     this.splitContainer2.SuspendLayout();
     this.SuspendLayout();
     //
     // dataGridView1
     //
     this.dataGridView1.AllowUserToAddRows = false;
     this.dataGridView1.AllowUserToDeleteRows = false;
     resources.ApplyResources(this.dataGridView1, "dataGridView1");
     this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGridView1.MultiSelect = false;
     this.dataGridView1.Name = "dataGridView1";
     this.dataGridView1.ReadOnly = true;
     this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
     this.dataGridView1.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView1_CellValueNeeded);
     this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
     this.dataGridView1.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_ColumnHeaderMouseClick);
     this.dataGridView1.RowEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_RowEnter);
     this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
     //
     // BUT_Graphit
     //
     resources.ApplyResources(this.BUT_Graphit, "BUT_Graphit");
     this.BUT_Graphit.Name = "BUT_Graphit";
     this.BUT_Graphit.UseVisualStyleBackColor = true;
     this.BUT_Graphit.Click += new System.EventHandler(this.Graphit_Click);
     //
     // BUT_cleargraph
     //
     resources.ApplyResources(this.BUT_cleargraph, "BUT_cleargraph");
     this.BUT_cleargraph.Name = "BUT_cleargraph";
     this.BUT_cleargraph.UseVisualStyleBackColor = true;
     this.BUT_cleargraph.Click += new System.EventHandler(this.BUT_cleargraph_Click);
     //
     // BUT_loadlog
     //
     resources.ApplyResources(this.BUT_loadlog, "BUT_loadlog");
     this.BUT_loadlog.Name = "BUT_loadlog";
     this.BUT_loadlog.UseVisualStyleBackColor = true;
     this.BUT_loadlog.Click += new System.EventHandler(this.BUT_loadlog_Click);
     //
     // splitContainer1
     //
     resources.ApplyResources(this.splitContainer1, "splitContainer1");
     this.splitContainer1.Name = "splitContainer1";
     //
     // splitContainer1.Panel1
     //
     this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
     //
     // splitContainer1.Panel2
     //
     this.splitContainer1.Panel2.Controls.Add(this.treeView1);
     this.splitContainer1.Panel2.Controls.Add(this.CMB_preselect);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_removeitem);
     this.splitContainer1.Panel2.Controls.Add(this.CHK_map);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_Graphit_R);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_Graphit);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_loadlog);
     this.splitContainer1.Panel2.Controls.Add(this.dataGridView1);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_cleargraph);
     //
     // splitContainer2
     //
     resources.ApplyResources(this.splitContainer2, "splitContainer2");
     this.splitContainer2.Name = "splitContainer2";
     //
     // splitContainer2.Panel1
     //
     this.splitContainer2.Panel1.Controls.Add(this.zg1);
     //
     // splitContainer2.Panel2
     //
     this.splitContainer2.Panel2.Controls.Add(this.myGMAP1);
     this.splitContainer2.Panel2Collapsed = true;
     //
     // zg1
     //
     resources.ApplyResources(this.zg1, "zg1");
     this.zg1.Name = "zg1";
     this.zg1.ScrollGrace = 0D;
     this.zg1.ScrollMaxX = 0D;
     this.zg1.ScrollMaxY = 0D;
     this.zg1.ScrollMaxY2 = 0D;
     this.zg1.ScrollMinX = 0D;
     this.zg1.ScrollMinY = 0D;
     this.zg1.ScrollMinY2 = 0D;
     this.zg1.ZoomEvent += new ZedGraph.ZedGraphControl.ZoomEventHandler(this.zg1_ZoomEvent);
     this.zg1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.zg1_MouseDoubleClick);
     //
     // myGMAP1
     //
     this.myGMAP1.Bearing = 0F;
     this.myGMAP1.CanDragMap = true;
     resources.ApplyResources(this.myGMAP1, "myGMAP1");
     this.myGMAP1.EmptyTileColor = System.Drawing.Color.Navy;
     this.myGMAP1.GrayScaleMode = false;
     this.myGMAP1.HelperLineOption = GMap.NET.WindowsForms.HelperLineOptions.DontShow;
     this.myGMAP1.LevelsKeepInMemmory = 5;
     this.myGMAP1.MarkersEnabled = true;
     this.myGMAP1.MaxZoom = 19;
     this.myGMAP1.MinZoom = 2;
     this.myGMAP1.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter;
     this.myGMAP1.Name = "myGMAP1";
     this.myGMAP1.NegativeMode = false;
     this.myGMAP1.PolygonsEnabled = true;
     this.myGMAP1.RetryLoadTile = 0;
     this.myGMAP1.RoutesEnabled = true;
     this.myGMAP1.ScaleMode = GMap.NET.WindowsForms.ScaleModes.Integer;
     this.myGMAP1.SelectedAreaFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(65)))), ((int)(((byte)(105)))), ((int)(((byte)(225)))));
     this.myGMAP1.ShowTileGridLines = false;
     this.myGMAP1.Zoom = 0D;
     this.myGMAP1.OnRouteClick += new GMap.NET.WindowsForms.RouteClick(this.myGMAP1_OnRouteClick);
     //
     // treeView1
     //
     resources.ApplyResources(this.treeView1, "treeView1");
     this.treeView1.CheckBoxes = true;
     this.treeView1.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
     this.treeView1.Name = "treeView1";
     this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
     ((System.Windows.Forms.TreeNode)(resources.GetObject("treeView1.Nodes"))),
     ((System.Windows.Forms.TreeNode)(resources.GetObject("treeView1.Nodes1")))});
     this.treeView1.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.treeView1_DrawNode);
     this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick);
     this.treeView1.DoubleClick += new System.EventHandler(this.treeView1_DoubleClick);
     //
     // CMB_preselect
     //
     this.CMB_preselect.FormattingEnabled = true;
     resources.ApplyResources(this.CMB_preselect, "CMB_preselect");
     this.CMB_preselect.Name = "CMB_preselect";
     this.CMB_preselect.SelectedIndexChanged += new System.EventHandler(this.CMB_preselect_SelectedIndexChanged);
     //
     // BUT_removeitem
     //
     resources.ApplyResources(this.BUT_removeitem, "BUT_removeitem");
     this.BUT_removeitem.Name = "BUT_removeitem";
     this.BUT_removeitem.UseVisualStyleBackColor = true;
     this.BUT_removeitem.Click += new System.EventHandler(this.BUT_removeitem_Click);
     //
     // CHK_map
     //
     resources.ApplyResources(this.CHK_map, "CHK_map");
     this.CHK_map.Name = "CHK_map";
     this.CHK_map.UseVisualStyleBackColor = true;
     this.CHK_map.CheckedChanged += new System.EventHandler(this.CHK_map_CheckedChanged);
     //
     // BUT_Graphit_R
     //
     resources.ApplyResources(this.BUT_Graphit_R, "BUT_Graphit_R");
     this.BUT_Graphit_R.Name = "BUT_Graphit_R";
     this.BUT_Graphit_R.UseVisualStyleBackColor = true;
     this.BUT_Graphit_R.Click += new System.EventHandler(this.BUT_Graphit_R_Click);
     //
     // LogBrowse
     //
     resources.ApplyResources(this, "$this");
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.splitContainer1);
     this.Name = "LogBrowse";
     this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.LogBrowse_FormClosed);
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
     this.splitContainer1.Panel1.ResumeLayout(false);
     this.splitContainer1.Panel2.ResumeLayout(false);
     this.splitContainer1.Panel2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
     this.splitContainer1.ResumeLayout(false);
     this.splitContainer2.Panel1.ResumeLayout(false);
     this.splitContainer2.Panel2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
     this.splitContainer2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
示例#9
0
        private static void ApplyCustomTheme(Control temp, int level)
        {
            if (level == 0)
            {
                temp.BackColor = BGColor;
                temp.ForeColor = TextColor;
            }

            foreach (Control ctl in temp.Controls)
            {
                if (ctl.GetType() == typeof(Panel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(GroupBox))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(TreeView))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    TreeView txtr = (TreeView)ctl;
                    txtr.LineColor = TextColor;
                }
                else if (ctl.GetType() == typeof(MyLabel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(Button))
                {
                    ctl.ForeColor = TextColor;
                    ctl.BackColor = ButBG;
                }
                else if (ctl.GetType() == typeof(MyButton))
                {
                    Controls.MyButton but = (MyButton)ctl;
                    but.BGGradTop = Color.FromArgb(72, 95, 154);
                    but.BGGradBot = Color.FromArgb(72, 95, 154);
                    but.TextColor = Color.White;
                    but.Outline   = Color.FromArgb(35, 31, 32);
                }
                else if (ctl.GetType() == typeof(TextBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    TextBox txt = (TextBox)ctl;
                    txt.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(DomainUpDown))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    DomainUpDown txt = (DomainUpDown)ctl;
                    txt.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(GroupBox) || ctl.GetType() == typeof(UserControl))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(ZedGraph.ZedGraphControl))
                {
                    var zg1 = (ZedGraph.ZedGraphControl)ctl;
                    zg1.GraphPane.Chart.Fill = new ZedGraph.Fill(ControlBGColor);
                    zg1.GraphPane.Fill       = new ZedGraph.Fill(BGColor);

                    foreach (ZedGraph.LineItem li in zg1.GraphPane.CurveList)
                    {
                        li.Line.Width = 2;
                    }

                    zg1.GraphPane.Title.FontSpec.FontColor = TextColor;

                    zg1.GraphPane.XAxis.MajorTic.Color  = TextColor;
                    zg1.GraphPane.XAxis.MinorTic.Color  = TextColor;
                    zg1.GraphPane.YAxis.MajorTic.Color  = TextColor;
                    zg1.GraphPane.YAxis.MinorTic.Color  = TextColor;
                    zg1.GraphPane.Y2Axis.MajorTic.Color = TextColor;
                    zg1.GraphPane.Y2Axis.MinorTic.Color = TextColor;

                    zg1.GraphPane.XAxis.MajorGrid.Color  = TextColor;
                    zg1.GraphPane.YAxis.MajorGrid.Color  = TextColor;
                    zg1.GraphPane.Y2Axis.MajorGrid.Color = TextColor;

                    zg1.GraphPane.YAxis.Scale.FontSpec.FontColor  = TextColor;
                    zg1.GraphPane.YAxis.Title.FontSpec.FontColor  = TextColor;
                    zg1.GraphPane.Y2Axis.Title.FontSpec.FontColor = TextColor;
                    zg1.GraphPane.Y2Axis.Scale.FontSpec.FontColor = TextColor;

                    zg1.GraphPane.XAxis.Scale.FontSpec.FontColor = TextColor;
                    zg1.GraphPane.XAxis.Title.FontSpec.FontColor = TextColor;

                    zg1.GraphPane.Legend.Fill = new ZedGraph.Fill(ControlBGColor);
                    zg1.GraphPane.Legend.FontSpec.FontColor = TextColor;
                }
                else if (ctl.GetType() == typeof(BSE.Windows.Forms.Panel) || ctl.GetType() == typeof(SplitterPanel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor; // Color.FromArgb(0xe6, 0xe8, 0xea);
                }
                else if (ctl.GetType() == typeof(RadialGradientBG))
                {
                    var rbg = ctl as RadialGradientBG;
                    rbg.CenterColor  = ControlBGColor;
                    rbg.OutsideColor = ButBG;
                }
                else if (ctl.GetType() == typeof(GradientBG))
                {
                    var rbg = ctl as GradientBG;
                    rbg.CenterColor  = ControlBGColor;
                    rbg.OutsideColor = ButBG;
                }
                else if (ctl.GetType() == typeof(Form))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    if (Program.IconFile != null)
                    {
                        ((Form)ctl).Icon = Icon.FromHandle(((Bitmap)Program.IconFile).GetHicon());
                    }
                }
                else if (ctl.GetType() == typeof(RichTextBox))
                {
                    if ((ctl.Name == "TXT_terminal") && !MainV2.TerminalTheming)
                    {
                        RichTextBox txtr = (RichTextBox)ctl;
                        txtr.BorderStyle = BorderStyle.None;
                        txtr.ForeColor   = Color.White;
                        txtr.BackColor   = Color.Black;
                    }
                    else
                    {
                        ctl.BackColor = ControlBGColor;
                        ctl.ForeColor = TextColor;
                        RichTextBox txtr = (RichTextBox)ctl;
                        txtr.BorderStyle = BorderStyle.None;
                    }
                }
                else if (ctl.GetType() == typeof(CheckedListBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    CheckedListBox txtr = (CheckedListBox)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(TabPage))
                {
                    ctl.BackColor = BGColor; //ControlBGColor
                    ctl.ForeColor = TextColor;
                    TabPage txtr = (TabPage)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(TabControl))
                {
                    ctl.BackColor = BGColor; //ControlBGColor
                    ctl.ForeColor = TextColor;
                    TabControl txtr = (TabControl)ctl;
                }
                else if (ctl.GetType() == typeof(DataGridView) || ctl.GetType() == typeof(MyDataGridView))
                {
                    ctl.ForeColor = TextColor;
                    DataGridView dgv = (DataGridView)ctl;
                    dgv.EnableHeadersVisualStyles = false;
                    dgv.BorderStyle     = BorderStyle.None;
                    dgv.BackgroundColor = BGColor;
                    DataGridViewCellStyle rs = new DataGridViewCellStyle();
                    rs.BackColor             = ControlBGColor;
                    rs.ForeColor             = TextColor;
                    dgv.RowsDefaultCellStyle = rs;

                    DataGridViewCellStyle hs = new DataGridViewCellStyle(dgv.ColumnHeadersDefaultCellStyle);
                    hs.BackColor = BGColor;
                    hs.ForeColor = TextColor;

                    dgv.ColumnHeadersDefaultCellStyle = hs;
                    dgv.RowHeadersDefaultCellStyle    = hs;
                }
                else if (ctl.GetType() == typeof(CheckBox) || ctl.GetType() == typeof(MavlinkCheckBox))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    CheckBox CHK = (CheckBox)ctl;
                    // CHK.FlatStyle = FlatStyle.Flat;
                }
                else if (ctl.GetType() == typeof(ComboBox) || ctl.GetType() == typeof(MavlinkComboBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    ComboBox CMB = (ComboBox)ctl;
                    CMB.FlatStyle = FlatStyle.Flat;
                }
                else if (ctl.GetType() == typeof(NumericUpDown) || ctl.GetType() == typeof(MavlinkNumericUpDown))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(TrackBar))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(LinkLabel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    LinkLabel LNK = (LinkLabel)ctl;
                    LNK.ActiveLinkColor  = TextColor;
                    LNK.LinkColor        = TextColor;
                    LNK.VisitedLinkColor = TextColor;
                }
                else if (ctl.GetType() == typeof(BackstageView))
                {
                    var bsv = ctl as BackstageView;

                    bsv.BackColor              = BGColor;
                    bsv.ButtonsAreaBgColor     = ControlBGColor;
                    bsv.HighlightColor2        = Color.FromArgb(0x94, 0xc1, 0x1f);
                    bsv.HighlightColor1        = Color.FromArgb(0x40, 0x57, 0x04);
                    bsv.SelectedTextColor      = Color.White;
                    bsv.UnSelectedTextColor    = Color.Gray;
                    bsv.ButtonsAreaPencilColor = Color.DarkGray;
                }
                else if (ctl.GetType() == typeof(HorizontalProgressBar2) ||
                         ctl.GetType() == typeof(VerticalProgressBar2))
                {
                    ((HorizontalProgressBar2)ctl).BackgroundColor = ControlBGColor;
                    ((HorizontalProgressBar2)ctl).ValueColor      = Color.FromArgb(148, 193, 31);
                }
                else if (ctl.GetType() == typeof(MyProgressBar))
                {
                    ((MyProgressBar)ctl).BGGradBot = Color.FromArgb(72, 95, 154);
                    ((MyProgressBar)ctl).BGGradTop = BGColor;
                }

                if (ctl.Controls.Count > 0)
                {
                    ApplyCustomTheme(ctl, 1);
                }
            }
        }
示例#10
0
        // posible child
        //private CustomWarning item;
        //private CurrentState currentState;

        private void InitializeComponent()
        {
            this.CMB_Source = new System.Windows.Forms.ComboBox();
            this.CMB_condition = new System.Windows.Forms.ComboBox();
            this.NUM_warning = new System.Windows.Forms.NumericUpDown();
            this.NUM_repeattime = new System.Windows.Forms.NumericUpDown();
            this.TXT_warningtext = new System.Windows.Forms.TextBox();
            this.but_addchild = new MissionPlanner.Controls.MyButton();
            this.but_remove = new MissionPlanner.Controls.MyButton();
            ((System.ComponentModel.ISupportInitialize) (this.NUM_warning)).BeginInit();
            ((System.ComponentModel.ISupportInitialize) (this.NUM_repeattime)).BeginInit();
            this.SuspendLayout();
            // 
            // CMB_Source
            // 
            this.CMB_Source.FormattingEnabled = true;
            this.CMB_Source.Location = new System.Drawing.Point(3, 2);
            this.CMB_Source.Name = "CMB_Source";
            this.CMB_Source.Size = new System.Drawing.Size(121, 21);
            this.CMB_Source.TabIndex = 0;
            this.CMB_Source.Text = "hdop";
            this.CMB_Source.SelectedIndexChanged += new System.EventHandler(this.CMB_Source_SelectedIndexChanged);
            // 
            // CMB_condition
            // 
            this.CMB_condition.FormattingEnabled = true;
            this.CMB_condition.Location = new System.Drawing.Point(130, 2);
            this.CMB_condition.Name = "CMB_condition";
            this.CMB_condition.Size = new System.Drawing.Size(54, 21);
            this.CMB_condition.TabIndex = 1;
            this.CMB_condition.Text = "EQ";
            this.CMB_condition.SelectedIndexChanged += new System.EventHandler(this.CMB_condition_SelectedIndexChanged);
            // 
            // NUM_warning
            // 
            this.NUM_warning.DecimalPlaces = 2;
            this.NUM_warning.Location = new System.Drawing.Point(190, 3);
            this.NUM_warning.Maximum = new decimal(new int[]
            {
                99999,
                0,
                0,
                0
            });
            this.NUM_warning.Minimum = new decimal(new int[]
            {
                99999,
                0,
                0,
                -2147483648
            });
            this.NUM_warning.Name = "NUM_warning";
            this.NUM_warning.Size = new System.Drawing.Size(65, 20);
            this.NUM_warning.TabIndex = 2;
            this.NUM_warning.ValueChanged += new System.EventHandler(this.NUM_warning_ValueChanged);
            // 
            // NUM_repeattime
            // 
            this.NUM_repeattime.Location = new System.Drawing.Point(503, 3);
            this.NUM_repeattime.Name = "NUM_repeattime";
            this.NUM_repeattime.Size = new System.Drawing.Size(39, 20);
            this.NUM_repeattime.TabIndex = 3;
            this.NUM_repeattime.Value = new decimal(new int[]
            {
                10,
                0,
                0,
                0
            });
            this.NUM_repeattime.ValueChanged += new System.EventHandler(this.NUM_repeattime_ValueChanged);
            // 
            // TXT_warningtext
            // 
            this.TXT_warningtext.Location = new System.Drawing.Point(261, 2);
            this.TXT_warningtext.Name = "TXT_warningtext";
            this.TXT_warningtext.Size = new System.Drawing.Size(236, 20);
            this.TXT_warningtext.TabIndex = 4;
            this.TXT_warningtext.Text = "WARNING: {name} is {value}";
            this.TXT_warningtext.TextChanged += new System.EventHandler(this.TXT_warningtext_TextChanged);
            // 
            // but_addchild
            // 
            this.but_addchild.Location = new System.Drawing.Point(549, 3);
            this.but_addchild.Name = "but_addchild";
            this.but_addchild.Size = new System.Drawing.Size(25, 20);
            this.but_addchild.TabIndex = 5;
            this.but_addchild.Text = "+";
            this.but_addchild.UseVisualStyleBackColor = true;
            this.but_addchild.Click += new System.EventHandler(this.but_addchild_Click);
            // 
            // but_remove
            // 
            this.but_remove.Location = new System.Drawing.Point(580, 3);
            this.but_remove.Name = "but_remove";
            this.but_remove.Size = new System.Drawing.Size(25, 20);
            this.but_remove.TabIndex = 6;
            this.but_remove.Text = "-";
            this.but_remove.UseVisualStyleBackColor = true;
            this.but_remove.Click += new System.EventHandler(this.but_remove_Click);
            // 
            // WarningControl
            // 
            this.Controls.Add(this.but_remove);
            this.Controls.Add(this.but_addchild);
            this.Controls.Add(this.TXT_warningtext);
            this.Controls.Add(this.NUM_repeattime);
            this.Controls.Add(this.NUM_warning);
            this.Controls.Add(this.CMB_condition);
            this.Controls.Add(this.CMB_Source);
            this.Name = "WarningControl";
            this.Size = new System.Drawing.Size(619, 27);
            ((System.ComponentModel.ISupportInitialize) (this.NUM_warning)).EndInit();
            ((System.ComponentModel.ISupportInitialize) (this.NUM_repeattime)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
示例#11
0
        private static void ApplyBurntKermitTheme(Control temp, int level)
        {
            BGColor        = Color.FromArgb(0x26, 0x27, 0x28); // background
            ControlBGColor = Color.FromArgb(0x43, 0x44, 0x45); // editable bg color
            TextColor      = Color.White;

            if (level == 0)
            {
                temp.BackColor = BGColor;
                temp.ForeColor = TextColor;
            }

            foreach (Control ctl in temp.Controls)
            {
                if (ctl.GetType() == typeof(TreeView))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    TreeView txtr = (TreeView)ctl;
                    txtr.LineColor = TextColor;
                }
                else if (ctl.GetType() == typeof(Panel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(GroupBox))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(MyLabel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(Button))
                {
                    ctl.ForeColor = Color.Black;
                }
                else if (ctl.GetType() == typeof(MyButton))
                {
                    Controls.MyButton but = (MyButton)ctl;
                }
                else if (ctl.GetType() == typeof(TextBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    TextBox txt = (TextBox)ctl;
                    txt.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(DomainUpDown))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    DomainUpDown txt = (DomainUpDown)ctl;
                    txt.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(GroupBox) || ctl.GetType() == typeof(UserControl))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(ZedGraph.ZedGraphControl))
                {
                    var zg1 = (ZedGraph.ZedGraphControl)ctl;
                    zg1.GraphPane.Chart.Fill = new ZedGraph.Fill(Color.FromArgb(0x1f, 0x1f, 0x20));
                    zg1.GraphPane.Fill       = new ZedGraph.Fill(Color.FromArgb(0x37, 0x37, 0x38));

                    try
                    {
                        foreach (ZedGraph.LineItem li in zg1.GraphPane.CurveList)
                        {
                            li.Line.Width = 2;
                        }
                    }
                    catch { }

                    zg1.GraphPane.Title.FontSpec.FontColor = TextColor;

                    zg1.GraphPane.XAxis.MajorTic.Color  = Color.White;
                    zg1.GraphPane.XAxis.MinorTic.Color  = Color.White;
                    zg1.GraphPane.YAxis.MajorTic.Color  = Color.White;
                    zg1.GraphPane.YAxis.MinorTic.Color  = Color.White;
                    zg1.GraphPane.Y2Axis.MajorTic.Color = Color.White;
                    zg1.GraphPane.Y2Axis.MinorTic.Color = Color.White;

                    zg1.GraphPane.XAxis.MajorGrid.Color  = Color.White;
                    zg1.GraphPane.YAxis.MajorGrid.Color  = Color.White;
                    zg1.GraphPane.Y2Axis.MajorGrid.Color = Color.White;

                    zg1.GraphPane.YAxis.Scale.FontSpec.FontColor  = Color.White;
                    zg1.GraphPane.YAxis.Title.FontSpec.FontColor  = Color.White;
                    zg1.GraphPane.Y2Axis.Title.FontSpec.FontColor = Color.White;
                    zg1.GraphPane.Y2Axis.Scale.FontSpec.FontColor = Color.White;

                    zg1.GraphPane.XAxis.Scale.FontSpec.FontColor = Color.White;
                    zg1.GraphPane.XAxis.Title.FontSpec.FontColor = Color.White;

                    zg1.GraphPane.Legend.Fill = new ZedGraph.Fill(Color.FromArgb(0x85, 0x84, 0x83));
                    zg1.GraphPane.Legend.FontSpec.FontColor = TextColor;
                }
                else if (ctl.GetType() == typeof(BSE.Windows.Forms.Panel) || ctl.GetType() == typeof(SplitterPanel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
                }
                else if (ctl.GetType() == typeof(Form))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
                }
                else if (ctl.GetType() == typeof(RichTextBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    RichTextBox txtr = (RichTextBox)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(CheckedListBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    CheckedListBox txtr = (CheckedListBox)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(TabPage))
                {
                    ctl.BackColor = BGColor;  //ControlBGColor
                    ctl.ForeColor = TextColor;
                    TabPage txtr = (TabPage)ctl;
                    txtr.BorderStyle = BorderStyle.None;
                }
                else if (ctl.GetType() == typeof(TabControl))
                {
                    ctl.BackColor = BGColor;  //ControlBGColor
                    ctl.ForeColor = TextColor;
                    TabControl txtr = (TabControl)ctl;
                }
                else if (ctl.GetType() == typeof(DataGridView))
                {
                    ctl.ForeColor = TextColor;
                    DataGridView dgv = (DataGridView)ctl;
                    dgv.EnableHeadersVisualStyles = false;
                    dgv.BorderStyle     = BorderStyle.None;
                    dgv.BackgroundColor = BGColor;
                    DataGridViewCellStyle rs = new DataGridViewCellStyle();
                    rs.BackColor             = ControlBGColor;
                    rs.ForeColor             = TextColor;
                    dgv.RowsDefaultCellStyle = rs;

                    dgv.AlternatingRowsDefaultCellStyle.BackColor = BGColor;

                    DataGridViewCellStyle hs = new DataGridViewCellStyle(dgv.ColumnHeadersDefaultCellStyle);
                    hs.BackColor = BGColor;
                    hs.ForeColor = TextColor;

                    dgv.ColumnHeadersDefaultCellStyle = hs;
                    dgv.RowHeadersDefaultCellStyle    = hs;
                }
                else if (ctl.GetType() == typeof(CheckBox) || ctl.GetType() == typeof(MavlinkCheckBox))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    CheckBox CHK = (CheckBox)ctl;
                    // CHK.FlatStyle = FlatStyle.Flat;
                }
                else if (ctl.GetType() == typeof(ComboBox) || ctl.GetType() == typeof(MavlinkComboBox))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                    ComboBox CMB = (ComboBox)ctl;
                    CMB.FlatStyle = FlatStyle.Flat;
                }
                else if (ctl.GetType() == typeof(NumericUpDown) || ctl.GetType() == typeof(MavlinkNumericUpDown))
                {
                    ctl.BackColor = ControlBGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(TrackBar))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                }
                else if (ctl.GetType() == typeof(LinkLabel))
                {
                    ctl.BackColor = BGColor;
                    ctl.ForeColor = TextColor;
                    LinkLabel LNK = (LinkLabel)ctl;
                    LNK.ActiveLinkColor  = TextColor;
                    LNK.LinkColor        = TextColor;
                    LNK.VisitedLinkColor = TextColor;
                }
                else if (ctl.GetType() == typeof(BackstageView))
                {
                    var bsv = ctl as BackstageView;

                    bsv.BackColor              = BGColor;
                    bsv.ButtonsAreaBgColor     = Color.Black;// ControlBGColor;
                    bsv.HighlightColor2        = Color.FromArgb(0x94, 0xc1, 0x1f);
                    bsv.HighlightColor1        = Color.FromArgb(0x40, 0x57, 0x04);
                    bsv.SelectedTextColor      = Color.White;
                    bsv.UnSelectedTextColor    = Color.WhiteSmoke;
                    bsv.ButtonsAreaPencilColor = Color.DarkGray;
                }
                else if (ctl.GetType() == typeof(HorizontalProgressBar2) || ctl.GetType() == typeof(VerticalProgressBar2))
                {
                    ((HorizontalProgressBar2)ctl).BackgroundColor = ControlBGColor;
                    ((HorizontalProgressBar2)ctl).ValueColor      = Color.FromArgb(148, 193, 31);
                }

                if (ctl.Controls.Count > 0)
                {
                    ApplyBurntKermitTheme(ctl, 1);
                }
            }
        }
        private void InitializeComponent()
        {
            this.CMB_Source = new System.Windows.Forms.ComboBox();
            this.CMB_condition = new System.Windows.Forms.ComboBox();
            this.NUM_trigger = new System.Windows.Forms.NumericUpDown();
            this.TXT_text = new System.Windows.Forms.TextBox();
            this.but_addchild = new MissionPlanner.Controls.MyButton();
            this.but_remove = new MissionPlanner.Controls.MyButton();
            this.CMB_colour1 = new System.Windows.Forms.ComboBox();
            this.CMB_colour2 = new System.Windows.Forms.ComboBox();
            this.TXT_desc = new System.Windows.Forms.TextBox();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_trigger)).BeginInit();
            this.SuspendLayout();
            // 
            // CMB_Source
            // 
            this.CMB_Source.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.CMB_Source.FormattingEnabled = true;
            this.CMB_Source.Location = new System.Drawing.Point(3, 2);
            this.CMB_Source.Name = "CMB_Source";
            this.CMB_Source.Size = new System.Drawing.Size(121, 21);
            this.CMB_Source.TabIndex = 0;
            this.CMB_Source.SelectedIndexChanged += new System.EventHandler(this.CMB_Source_SelectedIndexChanged);
            // 
            // CMB_condition
            // 
            this.CMB_condition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.CMB_condition.FormattingEnabled = true;
            this.CMB_condition.Location = new System.Drawing.Point(130, 2);
            this.CMB_condition.Name = "CMB_condition";
            this.CMB_condition.Size = new System.Drawing.Size(54, 21);
            this.CMB_condition.TabIndex = 1;
            this.CMB_condition.SelectedIndexChanged += new System.EventHandler(this.CMB_condition_SelectedIndexChanged);
            // 
            // NUM_trigger
            // 
            this.NUM_trigger.DecimalPlaces = 2;
            this.NUM_trigger.Location = new System.Drawing.Point(190, 3);
            this.NUM_trigger.Maximum = new decimal(new int[] {
            99999,
            0,
            0,
            0});
            this.NUM_trigger.Minimum = new decimal(new int[] {
            99999,
            0,
            0,
            -2147483648});
            this.NUM_trigger.Name = "NUM_trigger";
            this.NUM_trigger.Size = new System.Drawing.Size(65, 20);
            this.NUM_trigger.TabIndex = 2;
            this.NUM_trigger.ValueChanged += new System.EventHandler(this.NUM_warning_ValueChanged);
            // 
            // TXT_text
            // 
            this.TXT_text.Location = new System.Drawing.Point(261, 29);
            this.TXT_text.Name = "TXT_text";
            this.TXT_text.Size = new System.Drawing.Size(236, 20);
            this.TXT_text.TabIndex = 4;
            this.TXT_text.Text = "{name} is {value}";
            this.TXT_text.TextChanged += new System.EventHandler(this.TXT_warningtext_TextChanged);
            // 
            // but_addchild
            // 
            this.but_addchild.Location = new System.Drawing.Point(631, 1);
            this.but_addchild.Name = "but_addchild";
            this.but_addchild.Size = new System.Drawing.Size(25, 20);
            this.but_addchild.TabIndex = 5;
            this.but_addchild.Text = "+";
            this.but_addchild.UseVisualStyleBackColor = true;
            this.but_addchild.Click += new System.EventHandler(this.but_addchild_Click);
            // 
            // but_remove
            // 
            this.but_remove.Location = new System.Drawing.Point(662, 1);
            this.but_remove.Name = "but_remove";
            this.but_remove.Size = new System.Drawing.Size(25, 20);
            this.but_remove.TabIndex = 6;
            this.but_remove.Text = "-";
            this.but_remove.UseVisualStyleBackColor = true;
            this.but_remove.Click += new System.EventHandler(this.but_remove_Click);
            // 
            // CMB_colour1
            // 
            this.CMB_colour1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.CMB_colour1.DropDownWidth = 100;
            this.CMB_colour1.FormattingEnabled = true;
            this.CMB_colour1.Location = new System.Drawing.Point(503, 1);
            this.CMB_colour1.Name = "CMB_colour1";
            this.CMB_colour1.Size = new System.Drawing.Size(50, 21);
            this.CMB_colour1.TabIndex = 7;
            this.CMB_colour1.SelectedIndexChanged += new System.EventHandler(this.CMB_colour1_SelectedIndexChanged);
            // 
            // CMB_colour2
            // 
            this.CMB_colour2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.CMB_colour2.DropDownWidth = 100;
            this.CMB_colour2.FormattingEnabled = true;
            this.CMB_colour2.Location = new System.Drawing.Point(559, 1);
            this.CMB_colour2.Name = "CMB_colour2";
            this.CMB_colour2.Size = new System.Drawing.Size(50, 21);
            this.CMB_colour2.TabIndex = 8;
            this.CMB_colour2.SelectedIndexChanged += new System.EventHandler(this.CMB_colour2_SelectedIndexChanged);
            // 
            // TXT_desc
            // 
            this.TXT_desc.Location = new System.Drawing.Point(261, 3);
            this.TXT_desc.Name = "TXT_desc";
            this.TXT_desc.Size = new System.Drawing.Size(236, 20);
            this.TXT_desc.TabIndex = 9;
            this.TXT_desc.Text = "GPS Hdop";
            this.TXT_desc.TextChanged += new System.EventHandler(this.TXT_desc_TextChanged);
            // 
            // CheckListInput
            // 
            this.Controls.Add(this.TXT_desc);
            this.Controls.Add(this.CMB_colour2);
            this.Controls.Add(this.CMB_colour1);
            this.Controls.Add(this.but_remove);
            this.Controls.Add(this.but_addchild);
            this.Controls.Add(this.TXT_text);
            this.Controls.Add(this.NUM_trigger);
            this.Controls.Add(this.CMB_condition);
            this.Controls.Add(this.CMB_Source);
            this.Name = "CheckListInput";
            this.Size = new System.Drawing.Size(695, 51);
            ((System.ComponentModel.ISupportInitialize)(this.NUM_trigger)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
示例#13
0
        static DialogResult ShowUI(string title, string promptText, string value, bool password = false)
        {
            Form form = new Form();

            System.Windows.Forms.Label label = new System.Windows.Forms.Label();
            TextBox textBox = new TextBox();

            if (password)
            {
                textBox.UseSystemPasswordChar = true;
            }
            Controls.MyButton buttonOk     = new Controls.MyButton();
            Controls.MyButton buttonCancel = new Controls.MyButton();
            //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainV2));
            //form.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

            form.TopMost  = true;
            form.TopLevel = true;

            form.Text    = title;
            label.Text   = promptText;
            textBox.Text = value;

            buttonOk.Text             = "OK";
            buttonCancel.Text         = "Cancel";
            buttonOk.DialogResult     = DialogResult.OK;
            buttonCancel.DialogResult = DialogResult.Cancel;

            label.SetBounds(9, 20, 372, 13);
            textBox.SetBounds(12, 36, 372, 20);
            buttonOk.SetBounds(228, 72, 75, 23);
            buttonCancel.SetBounds(309, 72, 75, 23);

            label.AutoSize      = true;
            textBox.Anchor      = textBox.Anchor | AnchorStyles.Right;
            buttonOk.Anchor     = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

            form.ClientSize = new Size(396, 107);
            form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
            form.ClientSize      = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
            form.FormBorderStyle = FormBorderStyle.FixedSingle;
            form.StartPosition   = FormStartPosition.CenterScreen;
            form.MinimizeBox     = false;
            form.MaximizeBox     = false;
            form.AcceptButton    = buttonOk;
            form.CancelButton    = buttonCancel;

            if (ApplyTheme != null)
            {
                ApplyTheme(form);
            }

            DialogResult dialogResult = DialogResult.Cancel;

            Console.WriteLine("Input Box");

            form.ShowDialog();


            Console.WriteLine("Input Box 2");

            dialogResult = form.DialogResult;

            if (dialogResult == DialogResult.OK)
            {
                value          = textBox.Text;
                InputBox.value = value;
            }

            form.Dispose();

            form = null;

            return(dialogResult);
        }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogBrowse));
            this.dataGridView1 = new System.Windows.Forms.DataGridView();
            this.BUT_Graphit = new MissionPlanner.Controls.MyButton();
            this.BUT_cleargraph = new MissionPlanner.Controls.MyButton();
            this.BUT_loadlog = new MissionPlanner.Controls.MyButton();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.splitContainer2 = new System.Windows.Forms.SplitContainer();
            this.zg1 = new ZedGraph.ZedGraphControl();
            this.myGMAP1 = new MissionPlanner.Controls.myGMAP();
            this.CHK_map = new System.Windows.Forms.CheckBox();
            this.BUT_Graphit_R = new MissionPlanner.Controls.MyButton();
            this.BUT_removeitem = new MissionPlanner.Controls.MyButton();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();

            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();

            this.splitContainer2.Panel1.SuspendLayout();
            this.splitContainer2.Panel2.SuspendLayout();
            this.splitContainer2.SuspendLayout();
            this.SuspendLayout();
            //
            // dataGridView1
            //
            this.dataGridView1.AllowUserToAddRows = false;
            this.dataGridView1.AllowUserToDeleteRows = false;
            resources.ApplyResources(this.dataGridView1, "dataGridView1");
            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView1.MultiSelect = false;
            this.dataGridView1.Name = "dataGridView1";
            this.dataGridView1.ReadOnly = true;
            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
            this.dataGridView1.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_ColumnHeaderMouseClick);
            this.dataGridView1.RowEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_RowEnter);
            this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
            //
            // BUT_Graphit
            //
            resources.ApplyResources(this.BUT_Graphit, "BUT_Graphit");
            this.BUT_Graphit.Name = "BUT_Graphit";
            this.BUT_Graphit.UseVisualStyleBackColor = true;
            this.BUT_Graphit.Click += new System.EventHandler(this.Graphit_Click);
            //
            // BUT_cleargraph
            //
            resources.ApplyResources(this.BUT_cleargraph, "BUT_cleargraph");
            this.BUT_cleargraph.Name = "BUT_cleargraph";
            this.BUT_cleargraph.UseVisualStyleBackColor = true;
            this.BUT_cleargraph.Click += new System.EventHandler(this.BUT_cleargraph_Click);
            //
            // BUT_loadlog
            //
            resources.ApplyResources(this.BUT_loadlog, "BUT_loadlog");
            this.BUT_loadlog.Name = "BUT_loadlog";
            this.BUT_loadlog.UseVisualStyleBackColor = true;
            this.BUT_loadlog.Click += new System.EventHandler(this.BUT_loadlog_Click);
            //
            // splitContainer1
            //
            resources.ApplyResources(this.splitContainer1, "splitContainer1");
            this.splitContainer1.Name = "splitContainer1";
            //
            // splitContainer1.Panel1
            //
            this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
            //
            // splitContainer1.Panel2
            //
            this.splitContainer1.Panel2.Controls.Add(this.BUT_removeitem);
            this.splitContainer1.Panel2.Controls.Add(this.CHK_map);
            this.splitContainer1.Panel2.Controls.Add(this.BUT_Graphit_R);
            this.splitContainer1.Panel2.Controls.Add(this.BUT_Graphit);
            this.splitContainer1.Panel2.Controls.Add(this.BUT_loadlog);
            this.splitContainer1.Panel2.Controls.Add(this.dataGridView1);
            this.splitContainer1.Panel2.Controls.Add(this.BUT_cleargraph);
            //
            // splitContainer2
            //
            resources.ApplyResources(this.splitContainer2, "splitContainer2");
            this.splitContainer2.Name = "splitContainer2";
            //
            // splitContainer2.Panel1
            //
            this.splitContainer2.Panel1.Controls.Add(this.zg1);
            //
            // splitContainer2.Panel2
            //
            this.splitContainer2.Panel2.Controls.Add(this.myGMAP1);
            this.splitContainer2.Panel2Collapsed = true;
            //
            // zg1
            //
            resources.ApplyResources(this.zg1, "zg1");
            this.zg1.Name = "zg1";
            this.zg1.ScrollGrace = 0D;
            this.zg1.ScrollMaxX = 0D;
            this.zg1.ScrollMaxY = 0D;
            this.zg1.ScrollMaxY2 = 0D;
            this.zg1.ScrollMinX = 0D;
            this.zg1.ScrollMinY = 0D;
            this.zg1.ScrollMinY2 = 0D;
            this.zg1.ZoomEvent += new ZedGraph.ZedGraphControl.ZoomEventHandler(this.zg1_ZoomEvent);
            this.zg1.Paint += new System.Windows.Forms.PaintEventHandler(this.zg1_Paint);
            //
            // myGMAP1
            //
            this.myGMAP1.Bearing = 0F;
            this.myGMAP1.CanDragMap = true;
            resources.ApplyResources(this.myGMAP1, "myGMAP1");
            this.myGMAP1.GrayScaleMode = false;
            this.myGMAP1.LevelsKeepInMemmory = 5;
            this.myGMAP1.MarkersEnabled = true;
            this.myGMAP1.MaxZoom = 19;
            this.myGMAP1.MinZoom = 2;
            this.myGMAP1.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter;
            this.myGMAP1.Name = "myGMAP1";
            this.myGMAP1.NegativeMode = false;
            this.myGMAP1.PolygonsEnabled = true;
            this.myGMAP1.RetryLoadTile = 0;
            this.myGMAP1.RoutesEnabled = true;
            this.myGMAP1.ShowTileGridLines = false;
            this.myGMAP1.streamjpg = ((System.IO.MemoryStream)(resources.GetObject("myGMAP1.streamjpg")));
            this.myGMAP1.Zoom = 0D;
            //
            // CHK_map
            //
            resources.ApplyResources(this.CHK_map, "CHK_map");
            this.CHK_map.Name = "CHK_map";
            this.CHK_map.UseVisualStyleBackColor = true;
            this.CHK_map.CheckedChanged += new System.EventHandler(this.CHK_map_CheckedChanged);
            //
            // BUT_Graphit_R
            //
            resources.ApplyResources(this.BUT_Graphit_R, "BUT_Graphit_R");
            this.BUT_Graphit_R.Name = "BUT_Graphit_R";
            this.BUT_Graphit_R.UseVisualStyleBackColor = true;
            this.BUT_Graphit_R.Click += new System.EventHandler(this.BUT_Graphit_R_Click);
            //
            // BUT_removeitem
            //
            resources.ApplyResources(this.BUT_removeitem, "BUT_removeitem");
            this.BUT_removeitem.Name = "BUT_removeitem";
            this.BUT_removeitem.UseVisualStyleBackColor = true;
            this.BUT_removeitem.Click += new System.EventHandler(this.BUT_removeitem_Click);
            //
            // LogBrowse
            //
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.splitContainer1);
            this.Name = "LogBrowse";
            this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            this.splitContainer1.Panel2.PerformLayout();

            this.splitContainer1.ResumeLayout(false);
            this.splitContainer2.Panel1.ResumeLayout(false);
            this.splitContainer2.Panel2.ResumeLayout(false);

            this.splitContainer2.ResumeLayout(false);
            this.ResumeLayout(false);
        }
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigFirmware));
     this.pictureBoxAPM             = new MissionPlanner.Controls.ImageLabel();
     this.pictureBoxQuad            = new MissionPlanner.Controls.ImageLabel();
     this.pictureBoxHexa            = new MissionPlanner.Controls.ImageLabel();
     this.pictureBoxTri             = new MissionPlanner.Controls.ImageLabel();
     this.pictureBoxY6              = new MissionPlanner.Controls.ImageLabel();
     this.lbl_status                = new System.Windows.Forms.Label();
     this.progress                  = new System.Windows.Forms.ProgressBar();
     this.label2                    = new System.Windows.Forms.Label();
     this.pictureBoxHeli            = new MissionPlanner.Controls.ImageLabel();
     this.BUT_setup                 = new MissionPlanner.Controls.MyButton();
     this.pictureBoxHilimage        = new System.Windows.Forms.PictureBox();
     this.pictureBoxAPHil           = new System.Windows.Forms.PictureBox();
     this.pictureBoxACHil           = new System.Windows.Forms.PictureBox();
     this.pictureBoxACHHil          = new System.Windows.Forms.PictureBox();
     this.pictureBoxOcta            = new MissionPlanner.Controls.ImageLabel();
     this.pictureBoxOctaQuad        = new MissionPlanner.Controls.ImageLabel();
     this.pictureBoxRover           = new MissionPlanner.Controls.ImageLabel();
     this.label1                    = new System.Windows.Forms.Label();
     this.CMB_history               = new System.Windows.Forms.ComboBox();
     this.CMB_history_label         = new System.Windows.Forms.Label();
     this.lbl_Custom_firmware_label = new System.Windows.Forms.Label();
     this.lbl_devfw                 = new System.Windows.Forms.Label();
     this.lbl_px4io                 = new System.Windows.Forms.Label();
     this.lbl_dlfw                  = new System.Windows.Forms.Label();
     this.lbl_px4bl                 = new System.Windows.Forms.Label();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxHilimage)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAPHil)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHil)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHHil)).BeginInit();
     this.SuspendLayout();
     //
     // pictureBoxAPM
     //
     this.pictureBoxAPM.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxAPM.Image  = global::MissionPlanner.Properties.Resources.APM_airframes_001;
     resources.ApplyResources(this.pictureBoxAPM, "pictureBoxAPM");
     this.pictureBoxAPM.Name    = "pictureBoxAPM";
     this.pictureBoxAPM.TabStop = false;
     this.pictureBoxAPM.Tag     = "";
     this.pictureBoxAPM.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxQuad
     //
     this.pictureBoxQuad.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxQuad.Image  = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_04;
     resources.ApplyResources(this.pictureBoxQuad, "pictureBoxQuad");
     this.pictureBoxQuad.Name    = "pictureBoxQuad";
     this.pictureBoxQuad.TabStop = false;
     this.pictureBoxQuad.Tag     = "";
     this.pictureBoxQuad.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxHexa
     //
     this.pictureBoxHexa.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxHexa.Image  = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_10;
     resources.ApplyResources(this.pictureBoxHexa, "pictureBoxHexa");
     this.pictureBoxHexa.Name    = "pictureBoxHexa";
     this.pictureBoxHexa.TabStop = false;
     this.pictureBoxHexa.Tag     = "";
     this.pictureBoxHexa.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxTri
     //
     this.pictureBoxTri.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxTri.Image  = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_08;
     resources.ApplyResources(this.pictureBoxTri, "pictureBoxTri");
     this.pictureBoxTri.Name    = "pictureBoxTri";
     this.pictureBoxTri.TabStop = false;
     this.pictureBoxTri.Tag     = "";
     this.pictureBoxTri.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxY6
     //
     this.pictureBoxY6.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxY6.Image  = global::MissionPlanner.Properties.Resources.y6;
     resources.ApplyResources(this.pictureBoxY6, "pictureBoxY6");
     this.pictureBoxY6.Name    = "pictureBoxY6";
     this.pictureBoxY6.TabStop = false;
     this.pictureBoxY6.Tag     = "";
     this.pictureBoxY6.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // lbl_status
     //
     resources.ApplyResources(this.lbl_status, "lbl_status");
     this.lbl_status.Name = "lbl_status";
     //
     // progress
     //
     resources.ApplyResources(this.progress, "progress");
     this.progress.Name = "progress";
     this.progress.Step = 1;
     //
     // label2
     //
     resources.ApplyResources(this.label2, "label2");
     this.label2.Name = "label2";
     //
     // pictureBoxHeli
     //
     this.pictureBoxHeli.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxHeli.Image  = global::MissionPlanner.Properties.Resources.APM_airframes_08;
     resources.ApplyResources(this.pictureBoxHeli, "pictureBoxHeli");
     this.pictureBoxHeli.Name    = "pictureBoxHeli";
     this.pictureBoxHeli.TabStop = false;
     this.pictureBoxHeli.Tag     = "";
     this.pictureBoxHeli.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // BUT_setup
     //
     resources.ApplyResources(this.BUT_setup, "BUT_setup");
     this.BUT_setup.Name = "BUT_setup";
     this.BUT_setup.UseVisualStyleBackColor = true;
     //
     // pictureBoxHilimage
     //
     this.pictureBoxHilimage.Image = global::MissionPlanner.Properties.Resources.hil;
     resources.ApplyResources(this.pictureBoxHilimage, "pictureBoxHilimage");
     this.pictureBoxHilimage.Name    = "pictureBoxHilimage";
     this.pictureBoxHilimage.TabStop = false;
     this.pictureBoxHilimage.Tag     = "";
     //
     // pictureBoxAPHil
     //
     this.pictureBoxAPHil.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxAPHil.Image  = global::MissionPlanner.Properties.Resources.hilplane;
     resources.ApplyResources(this.pictureBoxAPHil, "pictureBoxAPHil");
     this.pictureBoxAPHil.Name    = "pictureBoxAPHil";
     this.pictureBoxAPHil.TabStop = false;
     this.pictureBoxAPHil.Tag     = "";
     this.pictureBoxAPHil.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxACHil
     //
     this.pictureBoxACHil.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxACHil.Image  = global::MissionPlanner.Properties.Resources.hilquad;
     resources.ApplyResources(this.pictureBoxACHil, "pictureBoxACHil");
     this.pictureBoxACHil.Name    = "pictureBoxACHil";
     this.pictureBoxACHil.TabStop = false;
     this.pictureBoxACHil.Tag     = "";
     this.pictureBoxACHil.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxACHHil
     //
     this.pictureBoxACHHil.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxACHHil.Image  = global::MissionPlanner.Properties.Resources.hilheli;
     resources.ApplyResources(this.pictureBoxACHHil, "pictureBoxACHHil");
     this.pictureBoxACHHil.Name    = "pictureBoxACHHil";
     this.pictureBoxACHHil.TabStop = false;
     this.pictureBoxACHHil.Tag     = "";
     this.pictureBoxACHHil.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxOcta
     //
     this.pictureBoxOcta.Image = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_12;
     resources.ApplyResources(this.pictureBoxOcta, "pictureBoxOcta");
     this.pictureBoxOcta.Name    = "pictureBoxOcta";
     this.pictureBoxOcta.TabStop = false;
     this.pictureBoxOcta.Tag     = "";
     this.pictureBoxOcta.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxOctaQuad
     //
     this.pictureBoxOctaQuad.Image = global::MissionPlanner.Properties.Resources.x8;
     resources.ApplyResources(this.pictureBoxOctaQuad, "pictureBoxOctaQuad");
     this.pictureBoxOctaQuad.Name    = "pictureBoxOctaQuad";
     this.pictureBoxOctaQuad.TabStop = false;
     this.pictureBoxOctaQuad.Tag     = "";
     this.pictureBoxOctaQuad.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // pictureBoxRover
     //
     this.pictureBoxRover.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pictureBoxRover.Image  = global::MissionPlanner.Properties.Resources.rover_11;
     resources.ApplyResources(this.pictureBoxRover, "pictureBoxRover");
     this.pictureBoxRover.Name    = "pictureBoxRover";
     this.pictureBoxRover.TabStop = false;
     this.pictureBoxRover.Tag     = "";
     this.pictureBoxRover.Click  += new System.EventHandler(this.pictureBoxFW_Click);
     //
     // label1
     //
     resources.ApplyResources(this.label1, "label1");
     this.label1.Name = "label1";
     //
     // CMB_history
     //
     this.CMB_history.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.CMB_history.DropDownWidth     = 160;
     this.CMB_history.FormattingEnabled = true;
     resources.ApplyResources(this.CMB_history, "CMB_history");
     this.CMB_history.Name = "CMB_history";
     this.CMB_history.SelectedIndexChanged += new System.EventHandler(this.CMB_history_SelectedIndexChanged);
     //
     // CMB_history_label
     //
     resources.ApplyResources(this.CMB_history_label, "CMB_history_label");
     this.CMB_history_label.Cursor = System.Windows.Forms.Cursors.Hand;
     this.CMB_history_label.Name   = "CMB_history_label";
     this.CMB_history_label.Click += new System.EventHandler(this.CMB_history_label_Click);
     //
     // lbl_Custom_firmware_label
     //
     resources.ApplyResources(this.lbl_Custom_firmware_label, "lbl_Custom_firmware_label");
     this.lbl_Custom_firmware_label.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lbl_Custom_firmware_label.Name   = "lbl_Custom_firmware_label";
     this.lbl_Custom_firmware_label.Click += new System.EventHandler(this.Custom_firmware_label_Click);
     //
     // lbl_devfw
     //
     resources.ApplyResources(this.lbl_devfw, "lbl_devfw");
     this.lbl_devfw.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lbl_devfw.Name   = "lbl_devfw";
     this.lbl_devfw.Click += new System.EventHandler(this.lbl_devfw_Click);
     //
     // lbl_px4io
     //
     resources.ApplyResources(this.lbl_px4io, "lbl_px4io");
     this.lbl_px4io.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lbl_px4io.Name   = "lbl_px4io";
     this.lbl_px4io.Click += new System.EventHandler(this.lbl_px4io_Click);
     //
     // lbl_dlfw
     //
     resources.ApplyResources(this.lbl_dlfw, "lbl_dlfw");
     this.lbl_dlfw.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lbl_dlfw.Name   = "lbl_dlfw";
     this.lbl_dlfw.Click += new System.EventHandler(this.lbl_dlfw_Click);
     //
     // lbl_px4bl
     //
     resources.ApplyResources(this.lbl_px4bl, "lbl_px4bl");
     this.lbl_px4bl.Cursor = System.Windows.Forms.Cursors.Hand;
     this.lbl_px4bl.Name   = "lbl_px4bl";
     this.lbl_px4bl.Click += new System.EventHandler(this.lbl_px4bl_Click);
     //
     // ConfigFirmware
     //
     resources.ApplyResources(this, "$this");
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.lbl_px4bl);
     this.Controls.Add(this.lbl_dlfw);
     this.Controls.Add(this.lbl_px4io);
     this.Controls.Add(this.lbl_devfw);
     this.Controls.Add(this.lbl_Custom_firmware_label);
     this.Controls.Add(this.CMB_history_label);
     this.Controls.Add(this.pictureBoxRover);
     this.Controls.Add(this.CMB_history);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.BUT_setup);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.lbl_status);
     this.Controls.Add(this.progress);
     this.Controls.Add(this.pictureBoxACHHil);
     this.Controls.Add(this.pictureBoxACHil);
     this.Controls.Add(this.pictureBoxAPHil);
     this.Controls.Add(this.pictureBoxHilimage);
     this.Controls.Add(this.pictureBoxOctaQuad);
     this.Controls.Add(this.pictureBoxOcta);
     this.Controls.Add(this.pictureBoxHeli);
     this.Controls.Add(this.pictureBoxY6);
     this.Controls.Add(this.pictureBoxTri);
     this.Controls.Add(this.pictureBoxHexa);
     this.Controls.Add(this.pictureBoxQuad);
     this.Controls.Add(this.pictureBoxAPM);
     this.Name  = "ConfigFirmware";
     this.Load += new System.EventHandler(this.Firmware_Load);
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxHilimage)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAPHil)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHil)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHHil)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
        // posible child
        //private CustomWarning item;
        //private CurrentState currentState;

        private void InitializeComponent()
        {
            this.CMB_Source      = new System.Windows.Forms.ComboBox();
            this.CMB_condition   = new System.Windows.Forms.ComboBox();
            this.NUM_warning     = new System.Windows.Forms.NumericUpDown();
            this.NUM_repeattime  = new System.Windows.Forms.NumericUpDown();
            this.TXT_warningtext = new System.Windows.Forms.TextBox();
            this.but_addchild    = new MissionPlanner.Controls.MyButton();
            this.but_remove      = new MissionPlanner.Controls.MyButton();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_warning)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_repeattime)).BeginInit();
            this.SuspendLayout();
            //
            // CMB_Source
            //
            this.CMB_Source.FormattingEnabled = true;
            this.CMB_Source.Location          = new System.Drawing.Point(3, 2);
            this.CMB_Source.Name                  = "CMB_Source";
            this.CMB_Source.Size                  = new System.Drawing.Size(121, 21);
            this.CMB_Source.TabIndex              = 0;
            this.CMB_Source.Text                  = "hdop";
            this.CMB_Source.SelectedIndexChanged += new System.EventHandler(this.CMB_Source_SelectedIndexChanged);
            //
            // CMB_condition
            //
            this.CMB_condition.FormattingEnabled = true;
            this.CMB_condition.Location          = new System.Drawing.Point(130, 2);
            this.CMB_condition.Name                  = "CMB_condition";
            this.CMB_condition.Size                  = new System.Drawing.Size(54, 21);
            this.CMB_condition.TabIndex              = 1;
            this.CMB_condition.Text                  = "EQ";
            this.CMB_condition.SelectedIndexChanged += new System.EventHandler(this.CMB_condition_SelectedIndexChanged);
            //
            // NUM_warning
            //
            this.NUM_warning.DecimalPlaces = 2;
            this.NUM_warning.Location      = new System.Drawing.Point(190, 3);
            this.NUM_warning.Maximum       = new decimal(new int[]
            {
                99999,
                0,
                0,
                0
            });
            this.NUM_warning.Minimum = new decimal(new int[]
            {
                99999,
                0,
                0,
                -2147483648
            });
            this.NUM_warning.Name          = "NUM_warning";
            this.NUM_warning.Size          = new System.Drawing.Size(65, 20);
            this.NUM_warning.TabIndex      = 2;
            this.NUM_warning.ValueChanged += new System.EventHandler(this.NUM_warning_ValueChanged);
            //
            // NUM_repeattime
            //
            this.NUM_repeattime.Location = new System.Drawing.Point(503, 3);
            this.NUM_repeattime.Name     = "NUM_repeattime";
            this.NUM_repeattime.Size     = new System.Drawing.Size(39, 20);
            this.NUM_repeattime.TabIndex = 3;
            this.NUM_repeattime.Value    = new decimal(new int[]
            {
                10,
                0,
                0,
                0
            });
            this.NUM_repeattime.ValueChanged += new System.EventHandler(this.NUM_repeattime_ValueChanged);
            //
            // TXT_warningtext
            //
            this.TXT_warningtext.Location     = new System.Drawing.Point(261, 2);
            this.TXT_warningtext.Name         = "TXT_warningtext";
            this.TXT_warningtext.Size         = new System.Drawing.Size(236, 20);
            this.TXT_warningtext.TabIndex     = 4;
            this.TXT_warningtext.Text         = "WARNING: {name} is {value}";
            this.TXT_warningtext.TextChanged += new System.EventHandler(this.TXT_warningtext_TextChanged);
            //
            // but_addchild
            //
            this.but_addchild.Location = new System.Drawing.Point(549, 3);
            this.but_addchild.Name     = "but_addchild";
            this.but_addchild.Size     = new System.Drawing.Size(25, 20);
            this.but_addchild.TabIndex = 5;
            this.but_addchild.Text     = "+";
            this.but_addchild.UseVisualStyleBackColor = true;
            this.but_addchild.Click += new System.EventHandler(this.but_addchild_Click);
            //
            // but_remove
            //
            this.but_remove.Location = new System.Drawing.Point(580, 3);
            this.but_remove.Name     = "but_remove";
            this.but_remove.Size     = new System.Drawing.Size(25, 20);
            this.but_remove.TabIndex = 6;
            this.but_remove.Text     = "-";
            this.but_remove.UseVisualStyleBackColor = true;
            this.but_remove.Click += new System.EventHandler(this.but_remove_Click);
            //
            // WarningControl
            //
            this.Controls.Add(this.but_remove);
            this.Controls.Add(this.but_addchild);
            this.Controls.Add(this.TXT_warningtext);
            this.Controls.Add(this.NUM_repeattime);
            this.Controls.Add(this.NUM_warning);
            this.Controls.Add(this.CMB_condition);
            this.Controls.Add(this.CMB_Source);
            this.Name = "WarningControl";
            this.Size = new System.Drawing.Size(619, 27);
            ((System.ComponentModel.ISupportInitialize)(this.NUM_warning)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_repeattime)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
示例#17
0
        /// <summary>
        /// The template xml for the screen
        /// </summary>
        /// <param name="FileName"></param>
        public void LoadXML(string FileName)
        {
            int x = 20;
            int y = 0;

            int optionx = 300;
            int optiony = 0;

            string        name      = "";
            List <string> paramname = new List <string>();
            double        rangemin  = 0;
            double        rangemax  = 10;
            double        step      = 0.001;

            using (XmlReader reader = XmlReader.Create(FileName))
            {
                while (reader.Read())
                {
                    switch (reader.Name.ToUpper())
                    {
                    case "ITEM":

                        break;

                    case "HEAD":
                        y += 30;
                        string heading = reader.ReadString();

                        Label lbl = new Label();
                        lbl.AutoSize = true;
                        lbl.Text     = heading;
                        lbl.Location = new Point(x, y);
                        lbl.Font     = new Font(FontFamily.GenericSansSerif, 15, FontStyle.Bold);

                        this.Controls.Add(lbl);

                        Controls.MyButton but = new Controls.MyButton();

                        but.Text     = "Save";
                        but.Location = new Point(optionx + 100, y);
                        but.Click   += new EventHandler(but_Click);
                        this.Controls.Add(but);

                        y = lbl.Location.Y + lbl.Height + 10;

                        LineSeparator ls = new LineSeparator();

                        ls.Width    = this.Width - 40;
                        ls.Location = new Point(x, y);

                        ls.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;

                        this.Controls.Add(ls);

                        y = ls.Location.Y + ls.Height;

                        break;

                    case "SUBHEAD":
                        y += 15;

                        optiony = y;
                        optionx = 300;
                        string subhead = reader.ReadString();

                        Label lbl2 = new Label();
                        lbl2.AutoSize = true;
                        lbl2.Text     = subhead;
                        lbl2.Location = new Point(x, y);
                        lbl2.Font     = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold);

                        this.Controls.Add(lbl2);

                        y = lbl2.Location.Y + lbl2.Height;

                        break;

                    case "DESC":
                        y += 2;
                        string desc = reader.ReadString();

                        Label lbl3 = new Label();
                        lbl3.AutoSize = true;
                        lbl3.Text     = AddNewLinesToText(desc);
                        lbl3.Location = new Point(x, y);
                        lbl3.Font     = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold);

                        this.Controls.Add(lbl3);

                        y = lbl3.Location.Y + lbl3.Height;

                        break;

                    case "FIELDS":
                        if (reader.NodeType == XmlNodeType.EndElement)
                        {
                            if (optiony > y)
                            {
                                y = optiony;
                            }
                        }
                        break;

                    case "FIELD":
                        if (reader.NodeType == XmlNodeType.EndElement)
                        {
                            if (name == "" || paramname.Count == 0)
                            {
                                break;
                            }

                            Label lbl5 = new Label();
                            //lbl5.AutoSize = true;
                            lbl5.Text      = name;
                            lbl5.Location  = new Point(optionx, optiony);
                            lbl5.Size      = new System.Drawing.Size(90, 20);
                            lbl5.Font      = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold);
                            lbl5.TextAlign = ContentAlignment.MiddleRight;

                            this.Controls.Add(lbl5);

                            NumericUpDown nud = new NumericUpDown();
                            nud.Location      = new Point(optionx + 100, optiony);
                            nud.Size          = new System.Drawing.Size(78, 20);
                            nud.Maximum       = (decimal)rangemax;
                            nud.Minimum       = (decimal)rangemin;
                            nud.Increment     = (decimal)step;
                            nud.DecimalPlaces = (int)(step.ToString().Length - step.ToString(new System.Globalization.CultureInfo("en-US")).IndexOf('.') - 1);
                            nud.Name          = paramname[0];

                            this.Controls.Add(nud);

                            optiony += nud.Height;

                            _linkedParams[paramname[0]] = paramname;
                        }
                        else
                        {
                            name      = "";
                            paramname = new List <string>();
                            rangemax  = 10;
                            rangemin  = 0;
                            step      = 0.001;
                        }
                        break;

                    case "NAME":
                        name = reader.ReadString();
                        break;

                    case "PARAMNAME":
                        paramname.Add(reader.ReadString());
                        break;

                    case "RANGEMIN":
                        rangemin = double.Parse(reader.ReadString(), new System.Globalization.CultureInfo("en-US"));
                        break;

                    case "RANGEMAX":
                        rangemax = double.Parse(reader.ReadString(), new System.Globalization.CultureInfo("en-US"));
                        break;

                    case "STEP":
                        step = double.Parse(reader.ReadString(), new System.Globalization.CultureInfo("en-US"));
                        break;
                    }
                }
            }

            ThemeManager.ApplyThemeTo(this);

            disableNumericUpDownControls(this);
        }
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigFirmware));
            this.pictureBoxAPM = new MissionPlanner.Controls.ImageLabel();
            this.pictureBoxQuad = new MissionPlanner.Controls.ImageLabel();
            this.pictureBoxHexa = new MissionPlanner.Controls.ImageLabel();
            this.pictureBoxTri = new MissionPlanner.Controls.ImageLabel();
            this.pictureBoxY6 = new MissionPlanner.Controls.ImageLabel();
            this.lbl_status = new System.Windows.Forms.Label();
            this.progress = new System.Windows.Forms.ProgressBar();
            this.label2 = new System.Windows.Forms.Label();
            this.pictureBoxHeli = new MissionPlanner.Controls.ImageLabel();
            this.BUT_setup = new MissionPlanner.Controls.MyButton();
            this.pictureBoxHilimage = new System.Windows.Forms.PictureBox();
            this.pictureBoxAPHil = new System.Windows.Forms.PictureBox();
            this.pictureBoxACHil = new System.Windows.Forms.PictureBox();
            this.pictureBoxACHHil = new System.Windows.Forms.PictureBox();
            this.pictureBoxOcta = new MissionPlanner.Controls.ImageLabel();
            this.pictureBoxOctaQuad = new MissionPlanner.Controls.ImageLabel();
            this.pictureBoxRover = new MissionPlanner.Controls.ImageLabel();
            this.label1 = new System.Windows.Forms.Label();
            this.CMB_history = new System.Windows.Forms.ComboBox();
            this.CMB_history_label = new System.Windows.Forms.Label();
            this.lbl_Custom_firmware_label = new System.Windows.Forms.Label();
            this.lbl_devfw = new System.Windows.Forms.Label();
            this.lbl_px4io = new System.Windows.Forms.Label();
            this.lbl_dlfw = new System.Windows.Forms.Label();
            this.lbl_px4bl = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxHilimage)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAPHil)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHil)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHHil)).BeginInit();
            this.SuspendLayout();
            // 
            // pictureBoxAPM
            // 
            this.pictureBoxAPM.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxAPM.Image = global::MissionPlanner.Properties.Resources.APM_airframes_001;
            resources.ApplyResources(this.pictureBoxAPM, "pictureBoxAPM");
            this.pictureBoxAPM.Name = "pictureBoxAPM";
            this.pictureBoxAPM.TabStop = false;
            this.pictureBoxAPM.Tag = "";
            this.pictureBoxAPM.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxQuad
            // 
            this.pictureBoxQuad.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxQuad.Image = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_04;
            resources.ApplyResources(this.pictureBoxQuad, "pictureBoxQuad");
            this.pictureBoxQuad.Name = "pictureBoxQuad";
            this.pictureBoxQuad.TabStop = false;
            this.pictureBoxQuad.Tag = "";
            this.pictureBoxQuad.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxHexa
            // 
            this.pictureBoxHexa.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxHexa.Image = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_10;
            resources.ApplyResources(this.pictureBoxHexa, "pictureBoxHexa");
            this.pictureBoxHexa.Name = "pictureBoxHexa";
            this.pictureBoxHexa.TabStop = false;
            this.pictureBoxHexa.Tag = "";
            this.pictureBoxHexa.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxTri
            // 
            this.pictureBoxTri.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxTri.Image = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_08;
            resources.ApplyResources(this.pictureBoxTri, "pictureBoxTri");
            this.pictureBoxTri.Name = "pictureBoxTri";
            this.pictureBoxTri.TabStop = false;
            this.pictureBoxTri.Tag = "";
            this.pictureBoxTri.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxY6
            // 
            this.pictureBoxY6.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxY6.Image = global::MissionPlanner.Properties.Resources.y6a;
            resources.ApplyResources(this.pictureBoxY6, "pictureBoxY6");
            this.pictureBoxY6.Name = "pictureBoxY6";
            this.pictureBoxY6.TabStop = false;
            this.pictureBoxY6.Tag = "";
            this.pictureBoxY6.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // lbl_status
            // 
            resources.ApplyResources(this.lbl_status, "lbl_status");
            this.lbl_status.Name = "lbl_status";
            // 
            // progress
            // 
            resources.ApplyResources(this.progress, "progress");
            this.progress.Name = "progress";
            this.progress.Step = 1;
            // 
            // label2
            // 
            resources.ApplyResources(this.label2, "label2");
            this.label2.Name = "label2";
            // 
            // pictureBoxHeli
            // 
            this.pictureBoxHeli.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxHeli.Image = global::MissionPlanner.Properties.Resources.APM_airframes_08;
            resources.ApplyResources(this.pictureBoxHeli, "pictureBoxHeli");
            this.pictureBoxHeli.Name = "pictureBoxHeli";
            this.pictureBoxHeli.TabStop = false;
            this.pictureBoxHeli.Tag = "";
            this.pictureBoxHeli.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // BUT_setup
            // 
            resources.ApplyResources(this.BUT_setup, "BUT_setup");
            this.BUT_setup.Name = "BUT_setup";
            this.BUT_setup.UseVisualStyleBackColor = true;
            // 
            // pictureBoxHilimage
            // 
            this.pictureBoxHilimage.Image = global::MissionPlanner.Properties.Resources.hil;
            resources.ApplyResources(this.pictureBoxHilimage, "pictureBoxHilimage");
            this.pictureBoxHilimage.Name = "pictureBoxHilimage";
            this.pictureBoxHilimage.TabStop = false;
            this.pictureBoxHilimage.Tag = "";
            // 
            // pictureBoxAPHil
            // 
            this.pictureBoxAPHil.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxAPHil.Image = global::MissionPlanner.Properties.Resources.hilplane;
            resources.ApplyResources(this.pictureBoxAPHil, "pictureBoxAPHil");
            this.pictureBoxAPHil.Name = "pictureBoxAPHil";
            this.pictureBoxAPHil.TabStop = false;
            this.pictureBoxAPHil.Tag = "";
            this.pictureBoxAPHil.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxACHil
            // 
            this.pictureBoxACHil.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxACHil.Image = global::MissionPlanner.Properties.Resources.hilquad;
            resources.ApplyResources(this.pictureBoxACHil, "pictureBoxACHil");
            this.pictureBoxACHil.Name = "pictureBoxACHil";
            this.pictureBoxACHil.TabStop = false;
            this.pictureBoxACHil.Tag = "";
            this.pictureBoxACHil.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxACHHil
            // 
            this.pictureBoxACHHil.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxACHHil.Image = global::MissionPlanner.Properties.Resources.hilheli;
            resources.ApplyResources(this.pictureBoxACHHil, "pictureBoxACHHil");
            this.pictureBoxACHHil.Name = "pictureBoxACHHil";
            this.pictureBoxACHHil.TabStop = false;
            this.pictureBoxACHHil.Tag = "";
            this.pictureBoxACHHil.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxOcta
            // 
            this.pictureBoxOcta.Image = global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_12;
            resources.ApplyResources(this.pictureBoxOcta, "pictureBoxOcta");
            this.pictureBoxOcta.Name = "pictureBoxOcta";
            this.pictureBoxOcta.TabStop = false;
            this.pictureBoxOcta.Tag = "";
            this.pictureBoxOcta.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxOctaQuad
            // 
            this.pictureBoxOctaQuad.Image = global::MissionPlanner.Properties.Resources.x8;
            resources.ApplyResources(this.pictureBoxOctaQuad, "pictureBoxOctaQuad");
            this.pictureBoxOctaQuad.Name = "pictureBoxOctaQuad";
            this.pictureBoxOctaQuad.TabStop = false;
            this.pictureBoxOctaQuad.Tag = "";
            this.pictureBoxOctaQuad.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // pictureBoxRover
            // 
            this.pictureBoxRover.Cursor = System.Windows.Forms.Cursors.Hand;
            this.pictureBoxRover.Image = global::MissionPlanner.Properties.Resources.rover_11;
            resources.ApplyResources(this.pictureBoxRover, "pictureBoxRover");
            this.pictureBoxRover.Name = "pictureBoxRover";
            this.pictureBoxRover.TabStop = false;
            this.pictureBoxRover.Tag = "";
            this.pictureBoxRover.Click += new System.EventHandler(this.pictureBoxFW_Click);
            // 
            // label1
            // 
            resources.ApplyResources(this.label1, "label1");
            this.label1.Name = "label1";
            // 
            // CMB_history
            // 
            this.CMB_history.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.CMB_history.DropDownWidth = 160;
            this.CMB_history.FormattingEnabled = true;
            resources.ApplyResources(this.CMB_history, "CMB_history");
            this.CMB_history.Name = "CMB_history";
            this.CMB_history.SelectedIndexChanged += new System.EventHandler(this.CMB_history_SelectedIndexChanged);
            // 
            // CMB_history_label
            // 
            resources.ApplyResources(this.CMB_history_label, "CMB_history_label");
            this.CMB_history_label.Cursor = System.Windows.Forms.Cursors.Hand;
            this.CMB_history_label.Name = "CMB_history_label";
            this.CMB_history_label.Click += new System.EventHandler(this.CMB_history_label_Click);
            // 
            // lbl_Custom_firmware_label
            // 
            resources.ApplyResources(this.lbl_Custom_firmware_label, "lbl_Custom_firmware_label");
            this.lbl_Custom_firmware_label.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lbl_Custom_firmware_label.Name = "lbl_Custom_firmware_label";
            this.lbl_Custom_firmware_label.Click += new System.EventHandler(this.Custom_firmware_label_Click);
            // 
            // lbl_devfw
            // 
            resources.ApplyResources(this.lbl_devfw, "lbl_devfw");
            this.lbl_devfw.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lbl_devfw.Name = "lbl_devfw";
            this.lbl_devfw.Click += new System.EventHandler(this.lbl_devfw_Click);
            // 
            // lbl_px4io
            // 
            resources.ApplyResources(this.lbl_px4io, "lbl_px4io");
            this.lbl_px4io.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lbl_px4io.Name = "lbl_px4io";
            this.lbl_px4io.Click += new System.EventHandler(this.lbl_px4io_Click);
            // 
            // lbl_dlfw
            // 
            resources.ApplyResources(this.lbl_dlfw, "lbl_dlfw");
            this.lbl_dlfw.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lbl_dlfw.Name = "lbl_dlfw";
            this.lbl_dlfw.Click += new System.EventHandler(this.lbl_dlfw_Click);
            // 
            // lbl_px4bl
            // 
            resources.ApplyResources(this.lbl_px4bl, "lbl_px4bl");
            this.lbl_px4bl.Cursor = System.Windows.Forms.Cursors.Hand;
            this.lbl_px4bl.Name = "lbl_px4bl";
            this.lbl_px4bl.Click += new System.EventHandler(this.lbl_px4bl_Click);
            // 
            // ConfigFirmware
            // 
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.lbl_px4bl);
            this.Controls.Add(this.lbl_dlfw);
            this.Controls.Add(this.lbl_px4io);
            this.Controls.Add(this.lbl_devfw);
            this.Controls.Add(this.lbl_Custom_firmware_label);
            this.Controls.Add(this.CMB_history_label);
            this.Controls.Add(this.pictureBoxRover);
            this.Controls.Add(this.CMB_history);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.BUT_setup);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.lbl_status);
            this.Controls.Add(this.progress);
            this.Controls.Add(this.pictureBoxACHHil);
            this.Controls.Add(this.pictureBoxACHil);
            this.Controls.Add(this.pictureBoxAPHil);
            this.Controls.Add(this.pictureBoxHilimage);
            this.Controls.Add(this.pictureBoxOctaQuad);
            this.Controls.Add(this.pictureBoxOcta);
            this.Controls.Add(this.pictureBoxHeli);
            this.Controls.Add(this.pictureBoxY6);
            this.Controls.Add(this.pictureBoxTri);
            this.Controls.Add(this.pictureBoxHexa);
            this.Controls.Add(this.pictureBoxQuad);
            this.Controls.Add(this.pictureBoxAPM);
            this.Name = "ConfigFirmware";
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxHilimage)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAPHil)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHil)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxACHHil)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
        void doButtontoUI(string name, int x, int y)
        {
            MyLabel butlabel = new MyLabel();
            ComboBox butnumberlist = new ComboBox();
            Controls.MyButton but_detect = new Controls.MyButton();
            HorizontalProgressBar hbar = new HorizontalProgressBar();
            ComboBox cmbaction = new ComboBox();
            Controls.MyButton but_settings = new Controls.MyButton();

            var config = Joystick.self.getButton(int.Parse(name));

            // do this here so putting in text works
            this.Controls.AddRange(new Control[] { butlabel, butnumberlist, but_detect, hbar, cmbaction, but_settings });

            butlabel.Location = new Point(x, y);
            butlabel.Size = new Size(47, 13);
            butlabel.Text = "Button " + (int.Parse(name)  +1);

            butnumberlist.Location = new Point(72, y);
            butnumberlist.Size = new Size(70, 21);
            butnumberlist.DataSource = getButtonNumbers();
            butnumberlist.DropDownStyle = ComboBoxStyle.DropDownList;
            butnumberlist.Name = "cmbbutton" + name;
            //if (MainV2.config["butno" + name] != null)
              //  butnumberlist.Text = (MainV2.config["butno" + name].ToString());
            //if (config.buttonno != -1)
                butnumberlist.Text = config.buttonno.ToString();
            butnumberlist.SelectedIndexChanged += new EventHandler(cmbbutton_SelectedIndexChanged);

            but_detect.Location = new Point(BUT_detch1.Left, y);
            but_detect.Size = BUT_detch1.Size;
            but_detect.Text = BUT_detch1.Text;
            but_detect.Name = "mybut" + name;
            but_detect.Click += new EventHandler(BUT_detbutton_Click);

            hbar.Location = new Point(progressBarRoll.Left, y);
            hbar.Size = progressBarRoll.Size;
            hbar.Name = "hbar" + name;

            cmbaction.Location = new Point(hbar.Right + 5, y);
            cmbaction.Size = new Size(100, 21);

            cmbaction.DataSource = Enum.GetNames(typeof(Joystick.buttonfunction)); //Common.getModesList(MainV2.comPort.MAV.cs);
            //cmbaction.ValueMember = "Key";
            //cmbaction.DisplayMember = "Value";
            cmbaction.Tag = name;
            cmbaction.DropDownStyle = ComboBoxStyle.DropDownList;
            cmbaction.Name = "cmbaction" + name;
            //if (MainV2.config["butaction" + name] != null)
              //  cmbaction.Text = MainV2.config["butaction" + name].ToString();
            //if (config.function != Joystick.buttonfunction.ChangeMode)
                cmbaction.Text = config.function.ToString();
            cmbaction.SelectedIndexChanged += cmbaction_SelectedIndexChanged;

            but_settings.Location = new Point(cmbaction.Right + 5, y);
            but_settings.Size = BUT_detch1.Size;
            but_settings.Text = "Settings";
            but_settings.Name = "butsettings" + name;
            but_settings.Click += but_settings_Click;
            but_settings.Tag = cmbaction;

            if ((but_settings.Bottom + 30) > this.Height)
                this.Height += 25;
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogBrowse));
     this.dataGridView1 = new System.Windows.Forms.DataGridView();
     this.zg1 = new ZedGraph.ZedGraphControl();
     this.BUT_Graphit = new ArdupilotMega.Controls.MyButton();
     this.BUT_cleargraph = new ArdupilotMega.Controls.MyButton();
     this.BUT_loadlog = new ArdupilotMega.Controls.MyButton();
     this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     this.BUT_Graphit_R = new ArdupilotMega.Controls.MyButton();
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
     this.splitContainer1.Panel1.SuspendLayout();
     this.splitContainer1.Panel2.SuspendLayout();
     this.splitContainer1.SuspendLayout();
     this.SuspendLayout();
     //
     // dataGridView1
     //
     this.dataGridView1.AllowUserToAddRows = false;
     this.dataGridView1.AllowUserToDeleteRows = false;
     resources.ApplyResources(this.dataGridView1, "dataGridView1");
     this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dataGridView1.MultiSelect = false;
     this.dataGridView1.Name = "dataGridView1";
     this.dataGridView1.ReadOnly = true;
     this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
     this.dataGridView1.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_ColumnHeaderMouseClick);
     this.dataGridView1.RowEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_RowEnter);
     this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
     //
     // zg1
     //
     resources.ApplyResources(this.zg1, "zg1");
     this.zg1.Name = "zg1";
     this.zg1.ScrollGrace = 0D;
     this.zg1.ScrollMaxX = 0D;
     this.zg1.ScrollMaxY = 0D;
     this.zg1.ScrollMaxY2 = 0D;
     this.zg1.ScrollMinX = 0D;
     this.zg1.ScrollMinY = 0D;
     this.zg1.ScrollMinY2 = 0D;
     this.zg1.Paint += new System.Windows.Forms.PaintEventHandler(this.zg1_Paint);
     //
     // BUT_Graphit
     //
     this.BUT_Graphit.BGGradBot = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(226)))), ((int)(((byte)(150)))));
     this.BUT_Graphit.BGGradTop = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(193)))), ((int)(((byte)(31)))));
     resources.ApplyResources(this.BUT_Graphit, "BUT_Graphit");
     this.BUT_Graphit.Name = "BUT_Graphit";
     this.BUT_Graphit.Outline = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(148)))), ((int)(((byte)(41)))));
     this.BUT_Graphit.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4)))));
     this.BUT_Graphit.UseVisualStyleBackColor = true;
     this.BUT_Graphit.Click += new System.EventHandler(this.Graphit_Click);
     //
     // BUT_cleargraph
     //
     this.BUT_cleargraph.BGGradBot = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(226)))), ((int)(((byte)(150)))));
     this.BUT_cleargraph.BGGradTop = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(193)))), ((int)(((byte)(31)))));
     resources.ApplyResources(this.BUT_cleargraph, "BUT_cleargraph");
     this.BUT_cleargraph.Name = "BUT_cleargraph";
     this.BUT_cleargraph.Outline = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(148)))), ((int)(((byte)(41)))));
     this.BUT_cleargraph.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4)))));
     this.BUT_cleargraph.UseVisualStyleBackColor = true;
     this.BUT_cleargraph.Click += new System.EventHandler(this.BUT_cleargraph_Click);
     //
     // BUT_loadlog
     //
     this.BUT_loadlog.BGGradBot = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(226)))), ((int)(((byte)(150)))));
     this.BUT_loadlog.BGGradTop = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(193)))), ((int)(((byte)(31)))));
     resources.ApplyResources(this.BUT_loadlog, "BUT_loadlog");
     this.BUT_loadlog.Name = "BUT_loadlog";
     this.BUT_loadlog.Outline = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(148)))), ((int)(((byte)(41)))));
     this.BUT_loadlog.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4)))));
     this.BUT_loadlog.UseVisualStyleBackColor = true;
     this.BUT_loadlog.Click += new System.EventHandler(this.BUT_loadlog_Click);
     //
     // splitContainer1
     //
     resources.ApplyResources(this.splitContainer1, "splitContainer1");
     this.splitContainer1.Name = "splitContainer1";
     //
     // splitContainer1.Panel1
     //
     this.splitContainer1.Panel1.Controls.Add(this.zg1);
     //
     // splitContainer1.Panel2
     //
     this.splitContainer1.Panel2.Controls.Add(this.BUT_Graphit_R);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_Graphit);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_loadlog);
     this.splitContainer1.Panel2.Controls.Add(this.dataGridView1);
     this.splitContainer1.Panel2.Controls.Add(this.BUT_cleargraph);
     //
     // BUT_Graphit_R
     //
     this.BUT_Graphit_R.BGGradBot = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(226)))), ((int)(((byte)(150)))));
     this.BUT_Graphit_R.BGGradTop = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(193)))), ((int)(((byte)(31)))));
     resources.ApplyResources(this.BUT_Graphit_R, "BUT_Graphit_R");
     this.BUT_Graphit_R.Name = "BUT_Graphit_R";
     this.BUT_Graphit_R.Outline = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(148)))), ((int)(((byte)(41)))));
     this.BUT_Graphit_R.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(87)))), ((int)(((byte)(4)))));
     this.BUT_Graphit_R.UseVisualStyleBackColor = true;
     this.BUT_Graphit_R.Click += new System.EventHandler(this.BUT_Graphit_R_Click);
     //
     // LogBrowse
     //
     resources.ApplyResources(this, "$this");
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.splitContainer1);
     this.Name = "LogBrowse";
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
     this.splitContainer1.Panel1.ResumeLayout(false);
     this.splitContainer1.Panel2.ResumeLayout(false);
     this.splitContainer1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
示例#21
0
 void BUT_go_Click(object sender, EventArgs e)
 {
     Controls.MyButton but = sender as Controls.MyButton;
 }
示例#22
0
 private void InitializeComponent()
 {
     this.CMB_Source    = new System.Windows.Forms.ComboBox();
     this.CMB_condition = new System.Windows.Forms.ComboBox();
     this.NUM_trigger   = new System.Windows.Forms.NumericUpDown();
     this.TXT_text      = new System.Windows.Forms.TextBox();
     this.but_addchild  = new MissionPlanner.Controls.MyButton();
     this.but_remove    = new MissionPlanner.Controls.MyButton();
     this.CMB_colour1   = new System.Windows.Forms.ComboBox();
     this.CMB_colour2   = new System.Windows.Forms.ComboBox();
     this.TXT_desc      = new System.Windows.Forms.TextBox();
     ((System.ComponentModel.ISupportInitialize)(this.NUM_trigger)).BeginInit();
     this.SuspendLayout();
     //
     // CMB_Source
     //
     this.CMB_Source.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.CMB_Source.FormattingEnabled = true;
     this.CMB_Source.Location          = new System.Drawing.Point(3, 2);
     this.CMB_Source.Name                  = "CMB_Source";
     this.CMB_Source.Size                  = new System.Drawing.Size(121, 21);
     this.CMB_Source.TabIndex              = 0;
     this.CMB_Source.SelectedIndexChanged += new System.EventHandler(this.CMB_Source_SelectedIndexChanged);
     //
     // CMB_condition
     //
     this.CMB_condition.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.CMB_condition.FormattingEnabled = true;
     this.CMB_condition.Location          = new System.Drawing.Point(130, 2);
     this.CMB_condition.Name                  = "CMB_condition";
     this.CMB_condition.Size                  = new System.Drawing.Size(54, 21);
     this.CMB_condition.TabIndex              = 1;
     this.CMB_condition.SelectedIndexChanged += new System.EventHandler(this.CMB_condition_SelectedIndexChanged);
     //
     // NUM_trigger
     //
     this.NUM_trigger.DecimalPlaces = 2;
     this.NUM_trigger.Location      = new System.Drawing.Point(190, 3);
     this.NUM_trigger.Maximum       = new decimal(new int[] {
         99999,
         0,
         0,
         0
     });
     this.NUM_trigger.Minimum = new decimal(new int[] {
         99999,
         0,
         0,
         -2147483648
     });
     this.NUM_trigger.Name          = "NUM_trigger";
     this.NUM_trigger.Size          = new System.Drawing.Size(65, 20);
     this.NUM_trigger.TabIndex      = 2;
     this.NUM_trigger.ValueChanged += new System.EventHandler(this.NUM_warning_ValueChanged);
     //
     // TXT_text
     //
     this.TXT_text.Location     = new System.Drawing.Point(261, 29);
     this.TXT_text.Name         = "TXT_text";
     this.TXT_text.Size         = new System.Drawing.Size(236, 20);
     this.TXT_text.TabIndex     = 4;
     this.TXT_text.Text         = "{name} is {value}";
     this.TXT_text.TextChanged += new System.EventHandler(this.TXT_warningtext_TextChanged);
     //
     // but_addchild
     //
     this.but_addchild.Location = new System.Drawing.Point(631, 1);
     this.but_addchild.Name     = "but_addchild";
     this.but_addchild.Size     = new System.Drawing.Size(25, 20);
     this.but_addchild.TabIndex = 7;
     this.but_addchild.Text     = "+";
     this.but_addchild.UseVisualStyleBackColor = true;
     this.but_addchild.Click += new System.EventHandler(this.but_addchild_Click);
     //
     // but_remove
     //
     this.but_remove.Location = new System.Drawing.Point(662, 1);
     this.but_remove.Name     = "but_remove";
     this.but_remove.Size     = new System.Drawing.Size(25, 20);
     this.but_remove.TabIndex = 8;
     this.but_remove.Text     = "-";
     this.but_remove.UseVisualStyleBackColor = true;
     this.but_remove.Click += new System.EventHandler(this.but_remove_Click);
     //
     // CMB_colour1
     //
     this.CMB_colour1.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.CMB_colour1.DropDownWidth     = 100;
     this.CMB_colour1.FormattingEnabled = true;
     this.CMB_colour1.Location          = new System.Drawing.Point(503, 1);
     this.CMB_colour1.Name                  = "CMB_colour1";
     this.CMB_colour1.Size                  = new System.Drawing.Size(50, 21);
     this.CMB_colour1.TabIndex              = 5;
     this.CMB_colour1.SelectedIndexChanged += new System.EventHandler(this.CMB_colour1_SelectedIndexChanged);
     //
     // CMB_colour2
     //
     this.CMB_colour2.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.CMB_colour2.DropDownWidth     = 100;
     this.CMB_colour2.FormattingEnabled = true;
     this.CMB_colour2.Location          = new System.Drawing.Point(559, 1);
     this.CMB_colour2.Name                  = "CMB_colour2";
     this.CMB_colour2.Size                  = new System.Drawing.Size(50, 21);
     this.CMB_colour2.TabIndex              = 6;
     this.CMB_colour2.SelectedIndexChanged += new System.EventHandler(this.CMB_colour2_SelectedIndexChanged);
     //
     // TXT_desc
     //
     this.TXT_desc.Location     = new System.Drawing.Point(261, 3);
     this.TXT_desc.Name         = "TXT_desc";
     this.TXT_desc.Size         = new System.Drawing.Size(236, 20);
     this.TXT_desc.TabIndex     = 3;
     this.TXT_desc.Text         = "GPS Hdop";
     this.TXT_desc.TextChanged += new System.EventHandler(this.TXT_desc_TextChanged);
     //
     // CheckListInput
     //
     this.Controls.Add(this.TXT_desc);
     this.Controls.Add(this.CMB_colour2);
     this.Controls.Add(this.CMB_colour1);
     this.Controls.Add(this.but_remove);
     this.Controls.Add(this.but_addchild);
     this.Controls.Add(this.TXT_text);
     this.Controls.Add(this.NUM_trigger);
     this.Controls.Add(this.CMB_condition);
     this.Controls.Add(this.CMB_Source);
     this.Name = "CheckListInput";
     this.Size = new System.Drawing.Size(695, 51);
     ((System.ComponentModel.ISupportInitialize)(this.NUM_trigger)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
示例#23
0
        static DialogResult ShowUI(string title, string promptText, string value, bool password = false)
        {
            Form form = new Form();
            System.Windows.Forms.Label label = new System.Windows.Forms.Label();
            TextBox textBox = new TextBox();
            if (password)
                textBox.UseSystemPasswordChar = true;
            Controls.MyButton buttonOk = new Controls.MyButton();
            Controls.MyButton buttonCancel = new Controls.MyButton();
            //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainV2));
            //form.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

            form.TopMost = true;
            form.TopLevel = true;

            form.Text = title;
            label.Text = promptText;
            textBox.Text = value;

            textBox.TextChanged +=textBox_TextChanged;

            buttonOk.Text = "OK";
            buttonCancel.Text = "Cancel";
            buttonOk.DialogResult = DialogResult.OK;
            buttonCancel.DialogResult = DialogResult.Cancel;

            label.SetBounds(9, 10, 372, 26);
            textBox.SetBounds(12, 46, 372, 20);
            buttonOk.SetBounds(228, 72, 75, 23);
            buttonCancel.SetBounds(309, 72, 75, 23);

            label.AutoSize = true;
            textBox.Anchor = textBox.Anchor | AnchorStyles.Right;
            buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

            form.ClientSize = new Size(396, 107);
            form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
            form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
            form.FormBorderStyle = FormBorderStyle.FixedSingle;
            form.StartPosition = FormStartPosition.CenterScreen;
            form.MinimizeBox = false;
            form.MaximizeBox = false;
            form.AcceptButton = buttonOk;
            form.CancelButton = buttonCancel;

            if (ApplyTheme != null)
                ApplyTheme(form);

            DialogResult dialogResult = DialogResult.Cancel;

            Console.WriteLine("Input Box " + System.Threading.Thread.CurrentThread.Name);

            Application.DoEvents();

            form.ShowDialog();

            Console.WriteLine("Input Box 2 " + System.Threading.Thread.CurrentThread.Name);

            dialogResult = form.DialogResult;

            if (dialogResult == DialogResult.OK)
            {
                value = textBox.Text;
                InputBox.value = value;
            }

            form.Dispose();

            TextChanged = null;

            form = null;

            return dialogResult;
        }
        // posible child
        //private CustomWarning item;
        //private CurrentState currentState;

        private void InitializeComponent()
        {
            this.CMB_Source      = new System.Windows.Forms.ComboBox();
            this.CMB_condition   = new System.Windows.Forms.ComboBox();
            this.NUM_warning     = new System.Windows.Forms.NumericUpDown();
            this.NUM_repeattime  = new System.Windows.Forms.NumericUpDown();
            this.TXT_warningtext = new System.Windows.Forms.TextBox();
            this.but_addchild    = new MissionPlanner.Controls.MyButton();
            this.but_remove      = new MissionPlanner.Controls.MyButton();
            this.CB_type         = new System.Windows.Forms.CheckBox();
            this.CMB_color       = new System.Windows.Forms.ComboBox();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_warning)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_repeattime)).BeginInit();
            this.SuspendLayout();
            //
            // CMB_Source
            //
            this.CMB_Source.FormattingEnabled = true;
            this.CMB_Source.Location          = new System.Drawing.Point(131, 3);
            this.CMB_Source.Name                  = "CMB_Source";
            this.CMB_Source.Size                  = new System.Drawing.Size(116, 21);
            this.CMB_Source.TabIndex              = 0;
            this.CMB_Source.Text                  = "gpsstat";
            this.CMB_Source.SelectedIndexChanged += new System.EventHandler(this.CMB_Source_SelectedIndexChanged);
            //
            // CMB_condition
            //
            this.CMB_condition.FormattingEnabled = true;
            this.CMB_condition.Location          = new System.Drawing.Point(253, 3);
            this.CMB_condition.Name                  = "CMB_condition";
            this.CMB_condition.Size                  = new System.Drawing.Size(54, 21);
            this.CMB_condition.TabIndex              = 1;
            this.CMB_condition.Text                  = "EQ";
            this.CMB_condition.SelectedIndexChanged += new System.EventHandler(this.CMB_condition_SelectedIndexChanged);
            //
            // NUM_warning
            //
            this.NUM_warning.DecimalPlaces = 2;
            this.NUM_warning.Location      = new System.Drawing.Point(313, 4);
            this.NUM_warning.Maximum       = new decimal(new int[] {
                99999,
                0,
                0,
                0
            });
            this.NUM_warning.Minimum = new decimal(new int[] {
                99999,
                0,
                0,
                -2147483648
            });
            this.NUM_warning.Name          = "NUM_warning";
            this.NUM_warning.Size          = new System.Drawing.Size(65, 20);
            this.NUM_warning.TabIndex      = 2;
            this.NUM_warning.ValueChanged += new System.EventHandler(this.NUM_warning_ValueChanged);
            //
            // NUM_repeattime
            //
            this.NUM_repeattime.Location = new System.Drawing.Point(745, 4);
            this.NUM_repeattime.Name     = "NUM_repeattime";
            this.NUM_repeattime.Size     = new System.Drawing.Size(39, 20);
            this.NUM_repeattime.TabIndex = 3;
            this.NUM_repeattime.Value    = new decimal(new int[] {
                10,
                0,
                0,
                0
            });
            this.NUM_repeattime.ValueChanged += new System.EventHandler(this.NUM_repeattime_ValueChanged);
            //
            // TXT_warningtext
            //
            this.TXT_warningtext.Location     = new System.Drawing.Point(494, 3);
            this.TXT_warningtext.Name         = "TXT_warningtext";
            this.TXT_warningtext.Size         = new System.Drawing.Size(236, 20);
            this.TXT_warningtext.TabIndex     = 4;
            this.TXT_warningtext.Text         = "WARNING: {name} is {value}";
            this.TXT_warningtext.TextChanged += new System.EventHandler(this.TXT_warningtext_TextChanged);
            //
            // but_addchild
            //
            this.but_addchild.Location = new System.Drawing.Point(791, 4);
            this.but_addchild.Name     = "but_addchild";
            this.but_addchild.Size     = new System.Drawing.Size(25, 20);
            this.but_addchild.TabIndex = 5;
            this.but_addchild.Text     = "+";
            this.but_addchild.UseVisualStyleBackColor = true;
            this.but_addchild.Click += new System.EventHandler(this.but_addchild_Click);
            //
            // but_remove
            //
            this.but_remove.Location = new System.Drawing.Point(822, 4);
            this.but_remove.Name     = "but_remove";
            this.but_remove.Size     = new System.Drawing.Size(25, 20);
            this.but_remove.TabIndex = 6;
            this.but_remove.Text     = "-";
            this.but_remove.UseVisualStyleBackColor = true;
            this.but_remove.Click += new System.EventHandler(this.but_remove_Click);
            //
            // cbType
            //
            this.CB_type.AutoSize = true;
            this.CB_type.Location = new System.Drawing.Point(3, 5);
            this.CB_type.Name     = "cbType";
            this.CB_type.Size     = new System.Drawing.Size(122, 17);
            this.CB_type.TabIndex = 7;
            this.CB_type.Text     = "QuickPanel Coloring";
            this.CB_type.UseVisualStyleBackColor = true;
            this.CB_type.CheckedChanged         += new System.EventHandler(this.CB_type_CheckedChanged);
            //
            // cmbColor
            //
            this.CMB_color.FormattingEnabled = true;
            this.CMB_color.Location          = new System.Drawing.Point(384, 3);
            this.CMB_color.Name                  = "cmbColor";
            this.CMB_color.Size                  = new System.Drawing.Size(104, 21);
            this.CMB_color.TabIndex              = 8;
            this.CMB_color.Text                  = "NoColor";
            this.CMB_color.SelectedIndexChanged += new System.EventHandler(this.cmbColor_SelectedIndexChanged);
            //
            // WarningControl
            //
            this.Controls.Add(this.CMB_color);
            this.Controls.Add(this.CB_type);
            this.Controls.Add(this.but_remove);
            this.Controls.Add(this.but_addchild);
            this.Controls.Add(this.TXT_warningtext);
            this.Controls.Add(this.NUM_repeattime);
            this.Controls.Add(this.NUM_warning);
            this.Controls.Add(this.CMB_condition);
            this.Controls.Add(this.CMB_Source);
            this.Name = "WarningControl";
            this.Size = new System.Drawing.Size(850, 27);
            ((System.ComponentModel.ISupportInitialize)(this.NUM_warning)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.NUM_repeattime)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }