Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
v8.3
Browse files Browse the repository at this point in the history
- Bug fixes and Improvements
  • Loading branch information
U-C-S committed Sep 5, 2020
1 parent d200910 commit 3a8a71e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
Binary file modified Basic Calculator.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions Basic Calculator.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
2 changes: 1 addition & 1 deletion Basic Calculator/Basic Calculator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
Expand Down
10 changes: 5 additions & 5 deletions Basic Calculator/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
mc:Ignorable="d"
Title="Simple-Calculator" Height="340" Width="300"
ResizeMode="NoResize" WindowStyle="None" Background="#BF000000" AllowsTransparency="True"
BorderThickness="4,2,4,2" Foreground="{x:Null}" BorderBrush="#E5FFFFFF" KeyDown="Keyboard_press">
BorderThickness="2,2,2,2" Foreground="{x:Null}" BorderBrush="#E5FFFFFF" KeyDown="Keyboard_press">

<Window.Resources>
<Style x:Key = "btn" TargetType = "Button">
Expand Down Expand Up @@ -55,7 +55,7 @@
</Rectangle.Fill>
</Rectangle>

<Button Content="" Height="22" Margin="265,5,5,309.8" BorderBrush="{x:Null}" Foreground="{x:Null}" Click="Close" IsCancel="True" Panel.ZIndex="5" Cursor="Hand">
<Button Content="" Height="22" Margin="0,5,5,0" BorderBrush="{x:Null}" Foreground="{x:Null}" Click="Close" IsCancel="True" Panel.ZIndex="5" Cursor="Hand" Width="22.4" HorizontalAlignment="Right" VerticalAlignment="Top">
<Button.Background>
<ImageBrush ImageSource="close-window-24.png"/>
</Button.Background>
Expand Down Expand Up @@ -84,11 +84,11 @@
</Button.Style>
</Button>

<Rectangle HorizontalAlignment="Left" Height="26" Margin="262,3,0,0" VerticalAlignment="Top" Width="26" Panel.ZIndex="2">
<Rectangle HorizontalAlignment="Right" Height="22" Margin="0,5,5,0" VerticalAlignment="Top" Width="22" Panel.ZIndex="2">
<Rectangle.Fill>
<RadialGradientBrush>
<GradientStop Color="#B200FFA8"/>
<GradientStop Color="#00000000" Offset="0.7"/>
<GradientStop Color="#B200FFA8" Offset="0.55"/>
<GradientStop Color="#00000000" Offset="0.8"/>
</RadialGradientBrush>
</Rectangle.Fill>
</Rectangle>
Expand Down
18 changes: 6 additions & 12 deletions Basic Calculator/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ private void NumberFunc (string i)
else if (resultShowing)
{
boxResult.Text = i;
resultShowing = false;
}
else
{
boxResult.Text += i;
}
resultShowing = false;

}

private void DotCheck()
Expand All @@ -95,7 +96,7 @@ private void DotCheck()
//Calculation logic--
private void CheckandCal(string x)
{
if (((boxMain.Text.EndsWith("+") || boxMain.Text.EndsWith("-") || boxMain.Text.EndsWith("x") || boxMain.Text.EndsWith("/")) && boxResult.Text == "0") || resultShowing)
if (resultShowing && boxMain.Text != "")
{
boxMain.Text = boxMain.Text.Substring(0, boxMain.Text.Length - 1) + x;
operStore[numOp - 1] = x;
Expand All @@ -107,12 +108,7 @@ private void CheckandCal(string x)
numOp += 1;
}


if (numOp == 1 && boxMain.Text == "")
{
TheResult = float.Parse(boxResult.Text);
}
else if (numOp == 1)
if (numOp == 1)
{
TheResult = float.Parse(boxMain.Text.Substring(0, boxMain.Text.Length - 2));
resultShowing = true;
Expand Down Expand Up @@ -141,8 +137,7 @@ private float Calu(float x, string a, float y)
resu = x * y; break;
case "/":
resu = x / y; break;
default:
throw new Exception("Operator Error");
default: throw new Exception("Operator Error");
}
return resu;
}
Expand All @@ -165,7 +160,6 @@ private void ClearEverything()
boxResult.Text = "0";
operStore.Clear();
resultShowing = false;
InitializeComponent();
}

//For Keyboard Functionality-----
Expand Down Expand Up @@ -216,6 +210,6 @@ private void Keyboard_press(object sender, KeyEventArgs e)

}
}

}
}
4 changes: 2 additions & 2 deletions Basic Calculator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.2.0.0")]
[assembly: AssemblyFileVersion("8.2.0.0")]
[assembly: AssemblyVersion("8.3.0.0")]
[assembly: AssemblyFileVersion("8.3.0.0")]
[assembly: NeutralResourcesLanguage("en-US")]

0 comments on commit 3a8a71e

Please sign in to comment.