//private void textBox1_DoubleClick(object sender, MouseEventArgs e)
        //{
        //    int x, y;
        //    x = e.Location.X;
        //    y = e.Location.Y;
        //    if ((x>=138 && x<=220) && (y>=34 && y<=54) )
        //    {
        //        textBox1.Enabled = true;
        //        MessageBox.Show("Text entro");
        //    }
        //    else if ((x >= 324 && x <= 406) && (y >= 34 && y <= 54))
        //    {
        //        textBox2.Enabled = true;
        //        MessageBox.Show(textBox1.Enabled.ToString());
        //    }

        //}

        private void textBox2_Click(object sender, MouseEventArgs e)
        {
            textBox2.Text = ((textBox2.Text.Equals("Automatic"))?"Manual":"Automatic");
            Boolean flag = ((textBox2.Text.Equals("Automatic")) ? false : true);


            if (Type == 0)
            {
                textBox1.Enabled = flag;
                var form = new ProgramsForm(ref _prg, PrgPath);
                dgv.Rows[Pos].Cells[3].Value = ((AutoManual)dgv.Rows[Pos].Cells[3].Value).NextValue();
                form.ExternalSaveAutomanual(Pos, dgv.Rows[Pos]);
            }
            else if (Type == 2)
            {
                Regex Val = new Regex(@"^[+-]?\d+(\.\d+)?$");
                if (IsNumeric(textBox1.Text) || Val.IsMatch(textBox1.Text))
                {
                    textBox1.Enabled  = flag;
                    textBox1.ReadOnly = false;
                }
                else
                {
                    textBox1.Enabled  = flag;
                    textBox1.ReadOnly = true;
                }
                var form = new VariablesForm(Prg.Variables, Prg.CustomUnits);
                dgv.Rows[Pos].Cells[2].Value = ((AutoManual)dgv.Rows[Pos].Cells[2].Value).NextValue();
                form.ExternalSaveAutomanual(Pos, dgv.Rows[Pos]);
            }
        }
Esempio n. 2
0
        private void ShowScreens(object sender, EventArgs e)
        {
            try
            {
                if (!CheckIsOpened())
                {
                    return;
                }
                var f    = new VariablesForm(PRG.Variables, PRG.CustomUnits);
                var f2   = new ProgramsForm(ref _prg, PrgPath);
                var form = new ScreensForm(PRG.Screens);
                form.Prg     = PRG;
                form.PointsP = PRG.Programs;
                form.CodesP  = PRG.ProgramCodes;
                form.PrgPath = PrgPath;

                form.Vars  = f.Vars;
                form.Progs = f2.Progs;

                form.Show();
            }
            catch (Exception exception)
            {
                MessageBoxUtilities.ShowException(exception);
            }
        }
        private void textBox1_ClickPrg(object sender, MouseEventArgs e)
        {
            textBox1.Text = ((textBox1.Text.Equals("On")) ? "Off" : "On");
            //var form = new ProgramsForm(PointsP, CodesP);
            var form = new ProgramsForm(ref _prg, PrgPath);

            dgv.Rows[Pos].Cells[2].Value = ((OffOn)dgv.Rows[Pos].Cells[2].Value).NextValue();
            form.ExternalSaveValue(Pos, dgv.Rows[Pos]);
        }
Esempio n. 4
0
        private void ShowPrograms()
        {
            try
            {
                if (!CheckIsOpened())
                {
                    return;
                }

                var form = new ProgramsForm(ref _prg, PrgPath);

                form.MdiParent = this;
                form.Show();
            }
            catch (Exception exception)
            {
                MessageBoxUtilities.ShowException(exception);
            }
        }
Esempio n. 5
0
        private void ShowPrograms()
        {
            try
            {
                if (!CheckIsOpened())
                {
                    return;
                }

                var form = new ProgramsForm(ref _prg, PrgPath);

                form.MdiParent = this;
                form.Show();
            }
            catch (Exception ex)
            {
                ExceptionHandler.Show(ex, Resources.ShowProgramException);
            }
        }