private void Click_parenthesis(object sender, EventArgs e) { if (activePower == false && SafteyNet.EmptyString(this.screen.Text) == true || SafteyNet.LastOperators(this.screen.Text) == true || SafteyNet.LastOpenParenthesis(this.screen.Text) == true) { if (SafteyNet.LastSpecials(this.screen.Text) == false) { this.screen.Text = SafteyNet.TooLargeScreen(this.screen.Text); screenText += "("; this.screen.Text += "("; activeDecimals = false; activeParenthesis++; GrayEquals(); } } else if (activeParenthesis > 0) { this.screen.Text = SafteyNet.TooLargeScreen(this.screen.Text); screenText += ")"; this.screen.Text += ")"; activeDecimals = false; activePlusMinus = false; activePower = false; activeDividePower = false; activeParenthesis--; GrayEquals(); } }
private void Click_plusMinus(object sender, EventArgs e) { if (SafteyNet.EmptyString(this.screen.Text) == true) { this.screen.Text = SafteyNet.TooLargeScreen(this.screen.Text); screenText += "(-"; this.screen.Text += "(-"; activeParenthesis++; activeDecimals = false; activePlusMinus = true; usedOperator = true; GrayEquals(); } else { if (SafteyNet.LastOpenParenthesis(this.screen.Text) == true || SafteyNet.LastOperators(this.screen.Text) == true) { if (SafteyNet.LastNegative(this.screen.Text) == false && SafteyNet.LastSpecials(this.screen.Text) == false) { this.screen.Text = SafteyNet.TooLargeScreen(this.screen.Text); screenText += "(-"; this.screen.Text += "(-"; activeParenthesis++; activeDecimals = false; activePlusMinus = true; usedOperator = true; GrayEquals(); } } } }