int stary_zaklad = 10; //zaklad ciselnej sustavy v ktoerej sa aktualne pracuje #endregion Fields #region Constructors public Form1() { InitializeComponent(); startBC(); graphOpened = false; expressionTextBox.Select(); grafoveOkno = null; InitializeTooltips(); pamet = new string[10]; delButtons=new Button[7]; for (int i = 0; i < 10; i++) pamet[i] = "Memory " + (1 + i).ToString(); memoryComboBox.SelectedIndex = 0; delButtons[0] = Del0; ; delButtons[1] = Del1; ; delButtons[2] = Del2; ; delButtons[3] = Del3; ; delButtons[4] = Del4; ; delButtons[5] = Del5; ; delButtons[6] = Del6; ; Del0.Hide(); Del1.Hide(); Del2.Hide(); Del3.Hide(); Del4.Hide(); Del5.Hide(); Del6.Hide(); favButtons = new List<Button>(); }
public Form1() { InitializeComponent(); startBC(); graphOpened = false; expressionTextBox.Select(); grafoveOkno = null; InitializeTooltips(); pamet = new string[10]; delButtons = new Button[7]; for (int i = 0; i < 10; i++) { pamet[i] = "Memory " + (1 + i).ToString(); } memoryComboBox.SelectedIndex = 0; delButtons[0] = Del0;; delButtons[1] = Del1;; delButtons[2] = Del2;; delButtons[3] = Del3;; delButtons[4] = Del4;; delButtons[5] = Del5;; delButtons[6] = Del6;; Del0.Hide(); Del1.Hide(); Del2.Hide(); Del3.Hide(); Del4.Hide(); Del5.Hide(); Del6.Hide(); favButtons = new List <Button>(); }
private void buttonPlot_Click(object sender, EventArgs e) { String text = ""; Regex regex = new Regex(@"^\w+\((x|x,y)?\)="); for (int i = 0; i < expressionTextBox.Lines.Length; i++) { text += expressionTextBox.Lines[i]; } if (regex.Match(text).Success) { if (grafoveOkno == null || grafoveOkno.IsDisposed) //grafove okno este neni otvorene { grafoveOkno = new GrafForm(text, ref graphOpened, this); grafoveOkno.Visible = true; graphOpened = true; } else //grafove okno uz je otvorene { grafoveOkno.AddFunkcia(text); grafoveOkno.Show(); grafoveOkno.TopMost = true; grafoveOkno.Focus(); grafoveOkno.BringToFront(); grafoveOkno.TopMost = false; } } else { if (grafoveOkno == null || grafoveOkno.IsDisposed) //grafove okno este neni otvorene { if (expressionTextBox.Text.CompareTo("") == 0) { grafoveOkno = new GrafForm(expressionTextBox.Text, ref graphOpened, this, false); } else { grafoveOkno = new GrafForm(expressionTextBox.Text, ref graphOpened, this, true); } grafoveOkno.Visible = true; graphOpened = true; } else //grafove okno uz je otvorene { //grafoveOkno.AddFunkcia(text); grafoveOkno.Show(); grafoveOkno.TopMost = true; grafoveOkno.Focus(); grafoveOkno.BringToFront(); grafoveOkno.TopMost = false; } } }
private void buttonEquals_Click(object sender, EventArgs e) { String text = ""; if (expressionTextBox.Text == "") { return; } String expression = expressionTextBox.Lines[0]; for (int i = 1; i < expressionTextBox.Lines.Length; i++) { expression = expression + "\n" + expressionTextBox.Lines[i]; } history.Add(expression); history_index = history.Count - 1; Regex regex = new Regex(@"^\w+\((x|x,y)?\)="); for (int i = 0; i < expressionTextBox.Lines.Length; i++) { text += expressionTextBox.Lines[i]; } if (regex.Match(text).Success) { if (grafoveOkno == null || grafoveOkno.IsDisposed) //grafove okno este neni otvorene { grafoveOkno = new GrafForm(text, ref graphOpened, this); grafoveOkno.Visible = true; graphOpened = true; } else //grafove okno uz je otvorene { grafoveOkno.AddFunkcia(text); grafoveOkno.Show(); grafoveOkno.TopMost = true; grafoveOkno.Focus(); grafoveOkno.BringToFront(); grafoveOkno.TopMost = false; } } else { Thread t = new Thread(getResult); System.Threading.Timer timer = new System.Threading.Timer(abortGettingResult, t, 1250, Timeout.Infinite); t.Start(); } }
private void buttonPlot_Click(object sender, EventArgs e) { String text = ""; Regex regex = new Regex(@"^\w+\((x|x,y)?\)="); for (int i = 0; i < expressionTextBox.Lines.Length; i++) text += expressionTextBox.Lines[i]; if (regex.Match(text).Success) { if (grafoveOkno == null || grafoveOkno.IsDisposed) //grafove okno este neni otvorene { grafoveOkno = new GrafForm(text, ref graphOpened,this); grafoveOkno.Visible = true; graphOpened = true; } else //grafove okno uz je otvorene { grafoveOkno.AddFunkcia(text); grafoveOkno.Show(); grafoveOkno.TopMost = true; grafoveOkno.Focus(); grafoveOkno.BringToFront(); grafoveOkno.TopMost = false; } } else { if (grafoveOkno == null || grafoveOkno.IsDisposed) //grafove okno este neni otvorene { if(expressionTextBox.Text.CompareTo("")==0)grafoveOkno = new GrafForm(expressionTextBox.Text,ref graphOpened,this,false); else grafoveOkno = new GrafForm(expressionTextBox.Text, ref graphOpened, this, true); grafoveOkno.Visible = true; graphOpened = true; } else //grafove okno uz je otvorene { //grafoveOkno.AddFunkcia(text); grafoveOkno.Show(); grafoveOkno.TopMost = true; grafoveOkno.Focus(); grafoveOkno.BringToFront(); grafoveOkno.TopMost = false; } } }
private void buttonEquals_Click(object sender, EventArgs e) { String text = ""; if (expressionTextBox.Text == "") return; String expression = expressionTextBox.Lines[0]; for (int i = 1; i < expressionTextBox.Lines.Length; i++) expression = expression + "\n" + expressionTextBox.Lines[i]; history.Add(expression); history_index = history.Count - 1; Regex regex = new Regex(@"^\w+\((x|x,y)?\)="); for (int i = 0; i < expressionTextBox.Lines.Length; i++) text += expressionTextBox.Lines[i]; if(regex.Match(text).Success) { if (grafoveOkno==null || grafoveOkno.IsDisposed) //grafove okno este neni otvorene { grafoveOkno = new GrafForm(text,ref graphOpened,this); grafoveOkno.Visible = true; graphOpened = true; } else //grafove okno uz je otvorene { grafoveOkno.AddFunkcia(text); grafoveOkno.Show(); grafoveOkno.TopMost = true; grafoveOkno.Focus(); grafoveOkno.BringToFront(); grafoveOkno.TopMost = false; } } else { Thread t = new Thread(getResult); System.Threading.Timer timer = new System.Threading.Timer(abortGettingResult, t, 1250, Timeout.Infinite); t.Start(); } }