Esempio n. 1
0
        public Calculator()
        {
            InitializeComponent();
              Initialize_NumericButtons();

              calc_engine_ = new RPN_CalculatorEngine();
              last_pos_ = new Point(0, 0);
              screen_font_ = new Font("Arial", 14.0f, FontStyle.Bold);
              calc_screen.Font = screen_font_;
              calc_screen.Text = "0";
              calc_screen.TextAlign = HorizontalAlignment.Right;
              //this.TransparencyKey = Color.FromArgb(255, 0, 0);
              //this.BackColor = Color.Black;

              btn_zero.ForeColor = Color.WhiteSmoke;
              btn_zero.BackColor = Color.Black;

              btn_one.ForeColor = Color.WhiteSmoke;
              btn_one.BackColor = Color.Black;
              //btn_one.Font = digit_font_;

              btn_two.ForeColor = Color.WhiteSmoke;
              btn_two.BackColor = Color.Black;
              //btn_two.Font = digit_font_;

              btn_three.ForeColor = Color.WhiteSmoke;
              btn_three.BackColor = Color.Black;
              //btn_three.Font = digit_font_;

              btn_four.ForeColor = Color.WhiteSmoke;
              btn_four.BackColor = Color.Black;
              //btn_four.Font = digit_font_;

              btn_five.ForeColor = Color.WhiteSmoke;
              btn_five.BackColor = Color.Black;
              //btn_five.Font = digit_font_;

              btn_six.ForeColor = Color.WhiteSmoke;
              btn_six.BackColor = Color.Black;
              //btn_six.Font = digit_font_;

              btn_seven.ForeColor = Color.WhiteSmoke;
              btn_seven.BackColor = Color.Black;
              //btn_seven.Font = digit_font_;

              btn_eight.ForeColor = Color.WhiteSmoke;
              btn_eight.BackColor = Color.Black;
              //btn_eight.Font = digit_font_;

              btn_nine.ForeColor = Color.WhiteSmoke;
              btn_nine.BackColor = Color.Black;
              //btn_nine.Font = digit_font_;

              btn_dot.ForeColor = Color.WhiteSmoke;
              btn_dot.BackColor = Color.DarkSlateBlue;
              //btn_dot.Font = digit_font_;

              btn_plus.ForeColor = Color.WhiteSmoke;
              btn_plus.BackColor = Color.DarkSlateBlue;
              //btn_plus.Font = digit_font_;

              btn_minus.ForeColor = Color.WhiteSmoke;
              btn_minus.BackColor = Color.DarkSlateBlue;
              //btn_minus.Font = digit_font_;

              btn_mul.ForeColor = Color.WhiteSmoke;
              btn_mul.BackColor = Color.DarkSlateBlue;
              //btn_mul.Font = digit_font_;

              btn_div.ForeColor = Color.WhiteSmoke;
              btn_div.BackColor = Color.DarkSlateBlue;
              //btn_div.Font = digit_font_;

              btn_mod.ForeColor = Color.WhiteSmoke;
              btn_mod.BackColor = Color.DarkSlateBlue;
              //btn_mod.Font = digit_font_;

              btn_inv.ForeColor = Color.WhiteSmoke;
              btn_inv.BackColor = Color.DarkSlateBlue;
              //btn_inv.Font = medium_font_;

              btn_lparen.ForeColor = Color.WhiteSmoke;
              btn_lparen.BackColor = Color.DarkSlateBlue;

              btn_rparen.ForeColor = Color.WhiteSmoke;
              btn_rparen.BackColor = Color.DarkSlateBlue;

              btn_equal.ForeColor = Color.WhiteSmoke;
              btn_equal.BackColor = Color.DarkSlateBlue;
              //btn_equal.Font = digit_font_;

              btn_leftarrow.BackColor = Color.DarkSlateBlue;
              btn_rightarrow.BackColor = Color.DarkSlateBlue;

              btn_sqrt.ForeColor = Color.WhiteSmoke;
              btn_sqrt.BackColor = Color.DarkSlateBlue;
              //btn_sqrt.Font = digit_font_;

              btn_sine.ForeColor = Color.WhiteSmoke;
              btn_sine.BackColor = Color.Sienna;
              //btn_sine.Font = medium_font_;

              btn_cosine.ForeColor = Color.WhiteSmoke;
              btn_cosine.BackColor = Color.Sienna;
              //btn_cosine.Font = medium_font_;

              btn_tan.ForeColor = Color.WhiteSmoke;
              btn_tan.BackColor = Color.Sienna;
              //btn_tan.Font = medium_font_;

              btn_atan.ForeColor = Color.WhiteSmoke;
              btn_atan.BackColor = Color.Sienna;
              //btn_atan.Font = medium_font_;

              btn_asin.ForeColor = Color.WhiteSmoke;
              btn_asin.BackColor = Color.Sienna;
              //btn_asin.Font = medium_font_;

              btn_acos.ForeColor = Color.WhiteSmoke;
              btn_acos.BackColor = Color.Sienna;
              //btn_acos.Font = medium_font_;

              btn_logln.ForeColor = Color.WhiteSmoke;
              btn_logln.BackColor = Color.Sienna;
              //btn_logln.Font = medium_font_;

              btn_log.ForeColor = Color.WhiteSmoke;
              btn_log.BackColor = Color.Sienna;
              //btn_log.Font = medium_font_;

              btn_pow.ForeColor = Color.WhiteSmoke;
              btn_pow.BackColor = Color.Sienna;
              //btn_pow.Font = medium_font_;

              btn_abs.ForeColor = Color.WhiteSmoke;
              btn_abs.BackColor = Color.Sienna;

              btn_rand.ForeColor = Color.WhiteSmoke;
              btn_rand.BackColor = Color.Sienna;

              btn_fact.ForeColor = Color.WhiteSmoke;
              btn_fact.BackColor = Color.Sienna;
              //btn_fact.Font = medium_font_;

              btn_bkspc.BackColor = Color.Crimson;
              btn_bkspc.ForeColor = Color.WhiteSmoke;

              btn_ce.BackColor = Color.Crimson;
              btn_ce.ForeColor = Color.WhiteSmoke;

              btn_ac.BackColor = Color.Crimson;
              btn_ac.ForeColor = Color.WhiteSmoke;

              btn_comma.BackColor = Color.DarkSlateBlue;
              btn_comma.ForeColor = Color.WhiteSmoke;

              btn_close.BackColor = Color.Crimson;
              btn_min.BackColor = Color.Crimson;
        }
Esempio n. 2
0
        public Calculator()
        {
            InitializeComponent();
            Initialize_NumericButtons();

            calc_engine_          = new RPN_CalculatorEngine();
            last_pos_             = new Point(0, 0);
            screen_font_          = new Font("Arial", 14.0f, FontStyle.Bold);
            calc_screen.Font      = screen_font_;
            calc_screen.Text      = "0";
            calc_screen.TextAlign = HorizontalAlignment.Right;
            //this.TransparencyKey = Color.FromArgb(255, 0, 0);
            //this.BackColor = Color.Black;

            btn_zero.ForeColor = Color.WhiteSmoke;
            btn_zero.BackColor = Color.Black;

            btn_one.ForeColor = Color.WhiteSmoke;
            btn_one.BackColor = Color.Black;
            //btn_one.Font = digit_font_;

            btn_two.ForeColor = Color.WhiteSmoke;
            btn_two.BackColor = Color.Black;
            //btn_two.Font = digit_font_;

            btn_three.ForeColor = Color.WhiteSmoke;
            btn_three.BackColor = Color.Black;
            //btn_three.Font = digit_font_;

            btn_four.ForeColor = Color.WhiteSmoke;
            btn_four.BackColor = Color.Black;
            //btn_four.Font = digit_font_;

            btn_five.ForeColor = Color.WhiteSmoke;
            btn_five.BackColor = Color.Black;
            //btn_five.Font = digit_font_;

            btn_six.ForeColor = Color.WhiteSmoke;
            btn_six.BackColor = Color.Black;
            //btn_six.Font = digit_font_;

            btn_seven.ForeColor = Color.WhiteSmoke;
            btn_seven.BackColor = Color.Black;
            //btn_seven.Font = digit_font_;

            btn_eight.ForeColor = Color.WhiteSmoke;
            btn_eight.BackColor = Color.Black;
            //btn_eight.Font = digit_font_;

            btn_nine.ForeColor = Color.WhiteSmoke;
            btn_nine.BackColor = Color.Black;
            //btn_nine.Font = digit_font_;

            btn_dot.ForeColor = Color.WhiteSmoke;
            btn_dot.BackColor = Color.DarkSlateBlue;
            //btn_dot.Font = digit_font_;

            btn_plus.ForeColor = Color.WhiteSmoke;
            btn_plus.BackColor = Color.DarkSlateBlue;
            //btn_plus.Font = digit_font_;

            btn_minus.ForeColor = Color.WhiteSmoke;
            btn_minus.BackColor = Color.DarkSlateBlue;
            //btn_minus.Font = digit_font_;

            btn_mul.ForeColor = Color.WhiteSmoke;
            btn_mul.BackColor = Color.DarkSlateBlue;
            //btn_mul.Font = digit_font_;

            btn_div.ForeColor = Color.WhiteSmoke;
            btn_div.BackColor = Color.DarkSlateBlue;
            //btn_div.Font = digit_font_;

            btn_mod.ForeColor = Color.WhiteSmoke;
            btn_mod.BackColor = Color.DarkSlateBlue;
            //btn_mod.Font = digit_font_;

            btn_inv.ForeColor = Color.WhiteSmoke;
            btn_inv.BackColor = Color.DarkSlateBlue;
            //btn_inv.Font = medium_font_;

            btn_lparen.ForeColor = Color.WhiteSmoke;
            btn_lparen.BackColor = Color.DarkSlateBlue;

            btn_rparen.ForeColor = Color.WhiteSmoke;
            btn_rparen.BackColor = Color.DarkSlateBlue;

            btn_equal.ForeColor = Color.WhiteSmoke;
            btn_equal.BackColor = Color.DarkSlateBlue;
            //btn_equal.Font = digit_font_;

            btn_leftarrow.BackColor  = Color.DarkSlateBlue;
            btn_rightarrow.BackColor = Color.DarkSlateBlue;

            btn_sqrt.ForeColor = Color.WhiteSmoke;
            btn_sqrt.BackColor = Color.DarkSlateBlue;
            //btn_sqrt.Font = digit_font_;

            btn_sine.ForeColor = Color.WhiteSmoke;
            btn_sine.BackColor = Color.Sienna;
            //btn_sine.Font = medium_font_;

            btn_cosine.ForeColor = Color.WhiteSmoke;
            btn_cosine.BackColor = Color.Sienna;
            //btn_cosine.Font = medium_font_;

            btn_tan.ForeColor = Color.WhiteSmoke;
            btn_tan.BackColor = Color.Sienna;
            //btn_tan.Font = medium_font_;

            btn_atan.ForeColor = Color.WhiteSmoke;
            btn_atan.BackColor = Color.Sienna;
            //btn_atan.Font = medium_font_;

            btn_asin.ForeColor = Color.WhiteSmoke;
            btn_asin.BackColor = Color.Sienna;
            //btn_asin.Font = medium_font_;

            btn_acos.ForeColor = Color.WhiteSmoke;
            btn_acos.BackColor = Color.Sienna;
            //btn_acos.Font = medium_font_;

            btn_logln.ForeColor = Color.WhiteSmoke;
            btn_logln.BackColor = Color.Sienna;
            //btn_logln.Font = medium_font_;

            btn_log.ForeColor = Color.WhiteSmoke;
            btn_log.BackColor = Color.Sienna;
            //btn_log.Font = medium_font_;

            btn_pow.ForeColor = Color.WhiteSmoke;
            btn_pow.BackColor = Color.Sienna;
            //btn_pow.Font = medium_font_;

            btn_abs.ForeColor = Color.WhiteSmoke;
            btn_abs.BackColor = Color.Sienna;

            btn_rand.ForeColor = Color.WhiteSmoke;
            btn_rand.BackColor = Color.Sienna;

            btn_fact.ForeColor = Color.WhiteSmoke;
            btn_fact.BackColor = Color.Sienna;
            //btn_fact.Font = medium_font_;

            btn_bkspc.BackColor = Color.Crimson;
            btn_bkspc.ForeColor = Color.WhiteSmoke;

            btn_ce.BackColor = Color.Crimson;
            btn_ce.ForeColor = Color.WhiteSmoke;

            btn_ac.BackColor = Color.Crimson;
            btn_ac.ForeColor = Color.WhiteSmoke;

            btn_comma.BackColor = Color.DarkSlateBlue;
            btn_comma.ForeColor = Color.WhiteSmoke;

            btn_close.BackColor = Color.Crimson;
            btn_min.BackColor   = Color.Crimson;
        }