Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculator_王一涵_无38 #11

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update SubPage.xaml
  • Loading branch information
yihan-wa authored Aug 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c0d16c76baa76dbd146074eff72bd670a710e202
59 changes: 52 additions & 7 deletions MAUICalculator/SubPage.xaml
Original file line number Diff line number Diff line change
@@ -3,10 +3,55 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUICalculator.SubPage"
Title="Advanced Calculator">
<VerticalStackLayout>
<Label
Text="Implement your advanced calculaor here!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

<Grid RowSpacing="0" ColumnSpacing="0" Padding="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<!-- Display label -->
<Label x:Name="displayLabel" Text="0" FontSize="Large" HorizontalTextAlignment="End" VerticalOptions="Center" Grid.Row="0" Grid.ColumnSpan="4" />

<!-- Function buttons -->
<Grid Grid.Row="1" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- Row 1 -->
<Button Text="x^y" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="0" Grid.Column="0" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="sqrt" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="0" Grid.Column="1" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="lg" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="0" Grid.Column="2" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="ln" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="0" Grid.Column="3" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>

<!-- Row 2 -->
<Button Text="sin" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="1" Grid.Column="0" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="cos" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="1" Grid.Column="1" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="tan" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="1" Grid.Column="2" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="pi" Background="LightSkyBlue" Clicked="OnComplexNumberClicked" Grid.Row="1" Grid.Column="3" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>

<!-- Row 3 -->
<Button Text="e" Background="LightSkyBlue" Clicked="OnComplexNumberClicked" Grid.Row="2" Grid.Column="0" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="!" Background="LightSkyBlue" Clicked="OnComplexOperatorClicked" Grid.Row="2" Grid.Column="1" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="0" Background="LightSkyBlue" Clicked="OnNumberClicked" Grid.Row="2" Grid.Column="2" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="=" Background="LightSkyBlue" Clicked="OnEqualClicked" Grid.Row="2" Grid.Column="3" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>

<!-- Row 4 -->
<Button Text="AC" Background="LightSkyBlue" Clicked="OnClearClicked" Grid.Row="3" Grid.Column="0" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="DEL" Background="LightSkyBlue" Clicked="OnDeleteClicked" Grid.Row="3" Grid.Column="1" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="+" Background="LightSkyBlue" Clicked="OnOperatorClicked" Grid.Row="3" Grid.Column="2" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
<Button Text="-" Background="LightSkyBlue" Clicked="OnOperatorClicked" Grid.Row="3" Grid.Column="3" Margin="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
</Grid>
</Grid>
</ContentPage>