|
11 | 11 | Icon="appicon.ico"> |
12 | 12 |
|
13 | 13 | <Window.Resources> |
14 | | - <!-- |
15 | | - calc_update_tweaks: This below style will apply to all Buttons by default. |
16 | | - We set HorizontalAlignment and VeriticalAlignment to "Stretch" so that each button will fill its Grid cell. |
17 | | - The Margin is here so that there's a bit of space between each button. |
18 | | - --> |
19 | 14 | <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"> |
20 | 15 | <Setter Property="HorizontalAlignment" Value="Stretch"/> |
21 | 16 | <Setter Property="VerticalAlignment" Value="Stretch"/> |
22 | 17 | <Setter Property="Margin" Value="2"/> |
23 | 18 | </Style> |
24 | 19 |
|
25 | | - <!-- |
26 | | - calc_update_tweaks: We also make a new Style called "GrayButton". The buttons that have the gray appearance will use |
27 | | - this style. |
28 | | - --> |
29 | 20 | <Style x:Key="GrayButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"> |
30 | 21 | <Setter Property="Background" Value="#33aaaabb"/> |
31 | 22 | </Style> |
32 | 23 | </Window.Resources> |
33 | 24 |
|
34 | 25 | <Grid x:Name="MainGrid"> |
35 | 26 | <DockPanel Name="MyPanel"> |
36 | | - <!-- |
37 | | - calc_update_tweaks: Remove the hardcoded hight to make the Menu taller so that the menu items can be fully visible. |
38 | | - --> |
39 | 27 | <Menu Name="MainMenu" DockPanel.Dock="Top"> |
40 | 28 | <MenuItem Header="File"> |
| 29 | + <!-- Demo4_Step2_AddIsland |
41 | 30 | <MenuItem Name="CreateDrawingIslandMenuItem" Click="CreateDrawingIslandMenuItem_Click" Header="Create DrawingIsland" /> |
| 31 | + --> |
42 | 32 | <MenuItem Click="OnMenuExit" Header="Exit" /> |
43 | 33 | </MenuItem> |
44 | 34 | <MenuItem Header="View"> |
45 | 35 | <MenuItem Name="StandardMenu" Click="OnMenuStandard" IsCheckable="true" IsChecked="True" |
46 | 36 | Header="Standard" /> |
| 37 | + <!-- Demo3_Step2_AddCompact |
47 | 38 | <MenuItem Name="CompactView" Click="CompactView_Click" Header="Enter Compact View" /> |
| 39 | + --> |
48 | 40 | </MenuItem> |
49 | 41 | <MenuItem Header="Help"> |
50 | 42 | <MenuItem Click="OnMenuAbout" Header="About" /> |
|
81 | 73 | <Button Name="B3" Click="DigitBtn_Click" Grid.Column="6" Grid.Row="4">3</Button> |
82 | 74 | <Button Name="B0" Click="DigitBtn_Click" Grid.Column="4" Grid.Row="5">0</Button> |
83 | 75 | <Button Name="BPeriod" Click="DigitBtn_Click" Grid.Column="5" Grid.Row="5">.</Button> |
84 | | - <!-- |
85 | | - calc_update_tweaks: We add Style="{StaticResource GrayButton}" here to the Buttons we want to be gray to |
86 | | - use the new Style we defined above. |
87 | | - --> |
88 | 76 | <Button Name="BPM" Click="OperBtn_Click" Style="{StaticResource GrayButton}" Grid.Column="6" Grid.Row="5">+/-</Button> |
89 | 77 | <Button Name="BDevide" Click="OperBtn_Click" Style="{StaticResource GrayButton}" Grid.Column="7" Grid.Row="2">/</Button> |
90 | 78 | <Button Name="BMultiply" Click="OperBtn_Click" Style="{StaticResource GrayButton}" Grid.Column="7" Grid.Row="3">*</Button> |
|
102 | 90 | ToolTip="Usage: 'A 1/X'"> |
103 | 91 | 1/X |
104 | 92 | </Button> |
105 | | - <!-- |
106 | | - calc_update_tweaks: Let's make the "=" Button an Accent button, so it's easy to find. |
107 | | - --> |
108 | 93 | <Button Name="BEqual" Click="OperBtn_Click" Grid.Column="8" Grid.Row="5" |
109 | 94 | Foreground="{DynamicResource AccentButtonForeground}" Background="{DynamicResource AccentButtonBackground}">=</Button> |
110 | 95 | <Button Name="BC" Click="OperBtn_Click" Style="{StaticResource GrayButton}" Grid.Column="8" Grid.Row="1" |
|
133 | 118 | </Button> |
134 | 119 | <TextBlock Name="BMemBox" Grid.Column="3" Grid.Row="1" Margin="10,17,10,17" Grid.ColumnSpan="2">Memory: [empty]</TextBlock> |
135 | 120 |
|
136 | | - <!-- |
137 | | - calc_update_tweaks: Make the calculator text a little larger to be more visible. |
138 | | - Also, make the TextBox borders a little less harsh. |
139 | | - --> |
140 | 121 | <local:MyTextBox Grid.ColumnSpan="9" x:Name="DisplayBox" Height="30" Margin="5" FontSize="20" BorderBrush="LightGray"/> |
141 | 122 | <Border x:Name="DisplayAreaBorder" Grid.Row="1" Grid.ColumnSpan="3" Grid.RowSpan="5" Margin="5"> |
142 | 123 | <local:MyTextBox x:Name="PaperBox" BorderBrush="LightGray"/> |
|
146 | 127 | </DockPanel> |
147 | 128 |
|
148 | 129 | <!-- This is what's shown when we enter the compat view mode--> |
| 130 | + <!-- Demo3_Step2_AddCompact |
149 | 131 | <DockPanel Name="CompactPanel" Visibility="Collapsed"> |
150 | 132 | <DockPanel DockPanel.Dock="Top"> |
151 | 133 | <Button Name="ExitCompactViewButton" Click="ExitCompactViewButton_Click" DockPanel.Dock="Right">Restore</Button> |
|
155 | 137 | <Border x:Name="CompactAreaBorder"> |
156 | 138 | </Border> |
157 | 139 | </DockPanel> |
| 140 | + --> |
158 | 141 | </Grid> |
159 | 142 | </Window> |
0 commit comments