private void Init_textinput()
        {
            this.tableLayoutPanelText.Controls.Clear();
            for (int i = 0; i <
                 CComLibrary.GlobeVal.filesave.minputtext.Count; i++)
            {
                UserTextInput b = new UserTextInput();
                b.Dock = DockStyle.Fill;

                b.btnproperty.Tag = i;

                b.btnproperty.Click += textinput_Btnproperty_Click;

                b.lbltitle.Text = CComLibrary.GlobeVal.filesave.minputtext[i].name;

                if (CComLibrary.GlobeVal.filesave.minputtext[i].value == null)
                {
                    CComLibrary.GlobeVal.filesave.minputtext[i].value = "";
                }
                b.txtvalue.Text         = CComLibrary.GlobeVal.filesave.minputtext[i].value.ToString();
                b.txtvalue.Tag          = i;
                b.txtvalue.TextChanged += Txtvalue_TextChanged1;


                tableLayoutPanelText.RowStyles[0].Height = 30;
                tableLayoutPanelText.Controls.Add(b);
            }
        }
Пример #2
0
        public void Init(int sel)
        {
            tabControl1.SelectedIndex = sel;

            if (sel == 0)
            {
                int mold = 0;

                mold = CComLibrary.GlobeVal.filesave.currentspenumber;
                CComLibrary.GlobeVal.filesave.currentspenumber = 0;

                lblstartbefore.Text = CComLibrary.GlobeVal.filesave.teststep[0].mtooltip;
                numericEdit1.Value  = CComLibrary.GlobeVal.filesave.mspecount;
                numericEdit2.Value  = mold + 1;

                tlp0.Controls.Clear();

                tlp0.RowStyles.Clear();

                tlp0.RowCount = (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count);


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count; i++)
                {
                    RowStyle r = new RowStyle();


                    r.SizeType = SizeType.Absolute;
                    r.Height   = 40;

                    tlp0.RowStyles.Add(r);
                }
                tlp0.Height = (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count) * 40;



                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem.Count; i++)
                {
                    CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].getvalue();

                    if (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemkind == 0)
                    {
                        UserTextInput u = new UserTextInput();
                        u.lbltitle.Text         = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemname;
                        u.txtvalue.Text         = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemvalue.ToString();
                        u.Dock                  = DockStyle.Fill;
                        u.txtvalue.Tag          = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i];
                        u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged);

                        tlp0.Controls.Add(u);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemkind == 1)
                    {
                        UserSizeInput m = new UserSizeInput();
                        m.lbltitle.Text  = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemname;
                        m.txtvalue.Value = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemvalue);
                        m.txtvalue.Tag   = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i];

                        m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue;
                        m.cbounit.Items.Clear();
                        m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit);
                        m.cbounit.SelectedIndex = 0;
                        m.Dock = DockStyle.Fill;
                        tlp0.Controls.Add(m);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemkind == 2)
                    {
                        UserComboInput n = new UserComboInput();
                        n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemname;

                        n.cbo.Items.Clear();
                        for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].mcboitem.mlist.Count; j++)
                        {
                            n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].mcboitem.mlist[j]);
                        }

                        n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i];
                        n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);

                        n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[0].mstepPromptsItem[i].itemvalue);
                        n.Dock = DockStyle.Fill;
                        tlp0.Controls.Add(n);
                    }
                }

                CComLibrary.GlobeVal.filesave.currentspenumber = 0;

                dataGridView1.DataSource = CComLibrary.GlobeVal.filesave.dt;
            }
            if (sel == 1)
            {
                lblspetestbefore.Text = CComLibrary.GlobeVal.filesave.teststep[1].mtooltip;

                tlp1.Controls.Clear();

                tlp1.RowStyles.Clear();

                tlp1.RowCount = (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count);


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count; i++)
                {
                    RowStyle r = new RowStyle();


                    r.SizeType = SizeType.Absolute;
                    r.Height   = 40;

                    tlp1.RowStyles.Add(r);
                }
                tlp1.Height = (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count) * 40;


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem.Count; i++)
                {
                    CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].getvalue();



                    if (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemkind == 0)
                    {
                        UserTextInput u = new UserTextInput();
                        u.lbltitle.Text         = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemname;
                        u.txtvalue.Text         = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemvalue.ToString();
                        u.Dock                  = DockStyle.Fill;
                        u.txtvalue.Tag          = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i];
                        u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged);

                        tlp1.Controls.Add(u);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemkind == 1)
                    {
                        UserSizeInput m = new UserSizeInput();
                        m.lbltitle.Text              = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemname;
                        m.txtvalue.Value             = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemvalue);
                        m.txtvalue.Tag               = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i];
                        m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue;
                        m.cbounit.Items.Clear();
                        m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit);
                        m.cbounit.SelectedIndex = 0;
                        m.Dock = DockStyle.Fill;
                        tlp1.Controls.Add(m);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemkind == 2)
                    {
                        UserComboInput n = new UserComboInput();
                        n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemname;

                        n.cbo.Items.Clear();
                        for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].mcboitem.mlist.Count; j++)
                        {
                            n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].mcboitem.mlist[j]);
                        }

                        n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i];
                        n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);

                        n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[1].mstepPromptsItem[i].itemvalue);
                        n.Dock = DockStyle.Fill;
                        tlp1.Controls.Add(n);
                    }
                }
            }

            if (sel == 2)
            {
                this.lblbeforetest.Text = CComLibrary.GlobeVal.filesave.teststep[2].mtooltip;
            }

            if (sel == 3)
            {
                lblbeforecalc.Text = CComLibrary.GlobeVal.filesave.teststep[4].mtooltip;


                tlp3.Controls.Clear();

                tlp3.RowStyles.Clear();

                tlp3.RowCount = (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count);


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count; i++)
                {
                    RowStyle r = new RowStyle();


                    r.SizeType = SizeType.Absolute;
                    r.Height   = 40;

                    tlp3.RowStyles.Add(r);
                }
                tlp3.Height = (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count) * 40;


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem.Count; i++)
                {
                    CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].getvalue();



                    if (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemkind == 0)
                    {
                        UserTextInput u = new UserTextInput();
                        u.lbltitle.Text         = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemname;
                        u.txtvalue.Text         = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemvalue.ToString();
                        u.Dock                  = DockStyle.Fill;
                        u.txtvalue.Tag          = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i];
                        u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged);

                        tlp3.Controls.Add(u);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemkind == 1)
                    {
                        UserSizeInput m = new UserSizeInput();
                        m.lbltitle.Text              = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemname;
                        m.txtvalue.Value             = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemvalue);
                        m.txtvalue.Tag               = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i];
                        m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue;
                        m.cbounit.Items.Clear();
                        m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit);
                        m.cbounit.SelectedIndex = 0;
                        m.Dock = DockStyle.Fill;
                        tlp3.Controls.Add(m);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemkind == 2)
                    {
                        UserComboInput n = new UserComboInput();
                        n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemname;

                        n.cbo.Items.Clear();
                        for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].mcboitem.mlist.Count; j++)
                        {
                            n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].mcboitem.mlist[j]);
                        }

                        n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i];
                        n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);

                        n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[4].mstepPromptsItem[i].itemvalue);
                        n.Dock = DockStyle.Fill;
                        tlp3.Controls.Add(n);
                    }
                }
            }

            if (sel == 4)
            {
                this.lblspeaftertest.Text = CComLibrary.GlobeVal.filesave.teststep[6].mtooltip;
                tlp4.Controls.Clear();

                tlp4.RowStyles.Clear();

                tlp4.RowCount = (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count);


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count; i++)
                {
                    RowStyle r = new RowStyle();


                    r.SizeType = SizeType.Absolute;
                    r.Height   = 40;

                    tlp4.RowStyles.Add(r);
                }
                tlp4.Height = (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count) * 40;


                for (int i = 0; i < CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem.Count; i++)
                {
                    CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].getvalue();



                    if (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemkind == 0)
                    {
                        UserTextInput u = new UserTextInput();
                        u.lbltitle.Text         = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemname;
                        u.txtvalue.Text         = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemvalue.ToString();
                        u.Dock                  = DockStyle.Fill;
                        u.txtvalue.Tag          = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i];
                        u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged);

                        tlp4.Controls.Add(u);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemkind == 1)
                    {
                        UserSizeInput m = new UserSizeInput();
                        m.lbltitle.Text              = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemname;
                        m.txtvalue.Value             = Convert.ToDouble(CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemvalue);
                        m.txtvalue.Tag               = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i];
                        m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue;

                        m.Dock = DockStyle.Fill;
                        tlp4.Controls.Add(m);
                    }

                    if (CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemkind == 2)
                    {
                        UserComboInput n = new UserComboInput();
                        n.lbltitle.Text = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemname;

                        n.cbo.Items.Clear();
                        for (int j = 0; j < CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].mcboitem.mlist.Count; j++)
                        {
                            n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].mcboitem.mlist[j]);
                        }

                        n.cbo.Tag = CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i];
                        n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);

                        n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.teststep[6].mstepPromptsItem[i].itemvalue);
                        n.Dock = DockStyle.Fill;
                        tlp4.Controls.Add(n);
                    }
                }
            }

            if (sel == 5)
            {
                this.lblbeforefinish.Text = CComLibrary.GlobeVal.filesave.teststep[7].mtooltip;
            }
        }
Пример #3
0
        public void setinput()
        {
            tlp1.Controls.Clear();

            tlp1.RowStyles.Clear();

            tlp1.RowCount = (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count);


            for (int i = 0; i < CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count; i++)
            {
                RowStyle r = new RowStyle();


                r.SizeType = SizeType.Absolute;
                r.Height   = 40;

                tlp1.RowStyles.Add(r);
            }
            tlp1.Height = (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count) * 40;


            for (int i = 0; i < CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem.Count; i++)
            {
                CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].getvalue();



                if (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemkind == 0)
                {
                    UserTextInput u = new UserTextInput();
                    u.lbltitle.Text         = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemname;
                    u.txtvalue.Text         = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemvalue.ToString();
                    u.Dock                  = DockStyle.Fill;
                    u.btnproperty.Visible   = false;
                    u.txtvalue.Tag          = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i];
                    u.txtvalue.TextChanged += new EventHandler(txtvalue_TextChanged);


                    tlp1.Controls.Add(u);
                }

                if (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemkind == 1)
                {
                    UserSizeInput m = new UserSizeInput();

                    m.lbltitle.Text = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemname;
                    double t = 0;
                    double.TryParse(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemvalue.ToString(), out t);
                    m.txtvalue.Value             = t;
                    m.txtvalue.Tag               = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i];
                    m.txtvalue.AfterChangeValue += Txtvalue_AfterChangeValue;
                    m.cbounit.Items.Clear();
                    m.btnproperty.Visible = false;
                    m.cbounit.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemunit);
                    m.cbounit.SelectedIndex = 0;
                    m.Dock = DockStyle.Fill;
                    tlp1.Controls.Add(m);
                }

                if (CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemkind == 2)
                {
                    UserComboInput n = new UserComboInput();
                    n.lbltitle.Text = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemname;

                    n.cbo.Items.Clear();
                    for (int j = 0; j < CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].mcboitem.mlist.Count; j++)
                    {
                        n.cbo.Items.Add(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].mcboitem.mlist[j]);
                    }

                    n.cbo.Tag = CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i];
                    n.cbo.SelectionChangeCommitted += new EventHandler(cbo_SelectionChangeCommitted);

                    n.cbo.SelectedIndex = Convert.ToInt32(CComLibrary.GlobeVal.filesave.mFreeFormPromptsItem[i].itemvalue);

                    n.Dock = DockStyle.Fill;
                    tlp1.Controls.Add(n);
                }
            }
        }