private void okButton_Click(object sender, EventArgs e)
        {
            if (FStatic.SelectedItems == 1)
            {
                Function proba = new Function(mainTextBox.Text);
                if (proba.itsOk)
                {
                    fn.Text = mainTextBox.Text;

                    FunctionSettings fs = new FunctionSettings(colorLabel.BackColor, (float)thicknessUpDown.Value, visibleBox.Checked, notesTextBox.Text, fn.fS.Precisity);
                    fs.NameDraw = showNameCheckBox.Checked;

                    fn.fS = fs;

                    this.Close();
                }
            }
            else
            {
                foreach (Function f in FStatic.Functions)
                {
                    if (f.selected)
                    {
                        FunctionSettings fs = new FunctionSettings(colorLabel.BackColor, (float)thicknessUpDown.Value, visibleBox.Checked, notesTextBox.Text, fn.fS.Precisity);
                        fs.NameDraw = showNameCheckBox.Checked;

                        f.fS = fs;
                    }
                }

                this.Close();
            }
        }
Esempio n. 2
0
        public Function(string t)
        {
            //letrehozom rogton az elejen a parametereket mert szukseg lesz ra
            for (int i = 0; i < pArraySize; i++)
            {
                pArray[i] = new Parameter(pChar[i], 1);
            }

            //uj fuggveny ezert legyen kijelolve
            selected = true;

            //inicializalja a fuggveny settingjeit
            fS = new FunctionSettings();

            //get a new random color
            Random random = new Random();

            fS.Color = Color.FromArgb((random.Next(0, 255)),
                                      (random.Next(0, 255)),
                                      (random.Next(0, 255)));

            fS.NameDraw = false;

            //legyen lathato
            fS.Visible = true;

            //es legyen 1 a vastagsaga
            fS.Thickness = 1f;

            //pontossag
            fS.Precisity = 1;

            //notes
            fS.Notes = "";


            // inicializalja a fuggvenyt
            Text = t;
        }