diff options
| author | lempamo <[email protected]> | 2017-07-13 19:13:35 -0500 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-13 19:13:35 -0500 |
| commit | 7c02e210108003913dfc77a001f546bb0617dba8 (patch) | |
| tree | 47483f2d12766475390f10f785de3dd0603fdd2a /TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs | |
| parent | 8f5ced0b128eddaf6656a417097fed13bc9aa2ef (diff) | |
| download | histacom2-7c02e210108003913dfc77a001f546bb0617dba8.tar.gz histacom2-7c02e210108003913dfc77a001f546bb0617dba8.tar.bz2 histacom2-7c02e210108003913dfc77a001f546bb0617dba8.zip | |
pixel perfected:tm: calculator
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs index 14111c1..9e923bb 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicCalculator.cs @@ -16,6 +16,19 @@ namespace TimeHACK.OS.Win95.Win95Apps public WinClassicCalculator() { InitializeComponent(); + foreach (Control c in Controls) + { + if (c is Button) + { + c.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0))); + c.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); + } + else + { + c.Font = new Font(TitleScreen.pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); + } + } + txtNumbers.Paint += (sender, args) => Paintbrush.PaintClassicBordersIndented(sender, args, 2); } public double prevnum = 0; public bool iszero = true; @@ -180,6 +193,10 @@ namespace TimeHACK.OS.Win95.Win95Apps switch (coperator) { case "+": + if (prevnum == 0) + { + break; + } txtNumbers.Text = (prevnum + double.Parse(txtNumbers.Text)).ToString(); prevnum = double.Parse(txtNumbers.Text); break; @@ -221,7 +238,7 @@ namespace TimeHACK.OS.Win95.Win95Apps coperator = "+"; Calculate(); prevnum = double.Parse(txtNumbers.Text); - txtNumbers.Text = "0"; + iszero = true; } private void Button19_Click(object sender, EventArgs e) |
