-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCheatPane.xaml
225 lines (189 loc) · 10.5 KB
/
CheatPane.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<Page
x:Class="VBA10.CheatPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:VBA10"
xmlns:ctl="using:VBA10.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="500"
d:DesignWidth="600">
<Grid x:Name="LayoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Adaptive triggers -->
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="wideView">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="1000" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="panelCheatList.(RelativePanel.RightOf)" Value="panelAddCode"/>
<Setter Target="rowCode.Height" Value="200"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="mediumView">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="500" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="panelCheatList.(RelativePanel.Below)" Value="panelAddCode"/>
<Setter Target="rowCode.Height" Value="100"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="narrowView">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="panelCheatList.(RelativePanel.Below)" Value="panelAddCode"/>
<Setter Target="rowCode.Height" Value="100"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="titleBar"
Height="48"
Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}">
<TextBlock x:Name="title"
Style="{StaticResource PageTitleTextBlockStyle}"
Text="**CHEATS"
x:Uid="CHEATS"/>
</Grid>
<TextBlock x:Name="txtNoROM" Visibility="Collapsed"
Grid.Row="1"
Margin="12,8,12,4"
Text="Please start a rom first."
x:Uid="StartARom"/>
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
Grid.Row="1"
x:Name="svMain">
<RelativePanel >
<StackPanel x:Name="panelAddCode"
Padding="12,0,12,0"
BorderBrush="{ThemeResource ListBoxBorderThemeBrush}"
MaxWidth="400"
>
<TextBlock Grid.Row="0" Text="**Add"
Style="{ThemeResource TitleTextBlockStyle}"
Margin="0,8,0,4"
x:Uid="Add"
/>
<TextBlock Grid.Row="0" Text="invisible text to stretch the panel invisible text to stretch the panel invisible text to stretch the panel"
Height="0"
/>
<TextBlock TextWrapping="Wrap"
Margin="0,4,0,4"
x:Name="descLabel"
HorizontalAlignment="Left"
Text="**This emulator supports Gameshark, CodeBreaker and GameGenie codes."
x:Uid="CheatInstruction"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="100" x:Name="rowCode" />
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" MinWidth="90"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0"
Text="**Description:"
VerticalAlignment="Center"
x:Uid="Description"
/>
<TextBox Grid.Row="0" Grid.Column="1"
Name="descBox" Margin="0,4,0,4"
/>
<TextBlock Grid.Row="1" Grid.Column="0"
Text="**Code:" VerticalAlignment="Top"
Margin="0,4,0,0"
x:Uid="Code"/>
<TextBox
Name="codeBox" AcceptsReturn="True"
Grid.Row="1" Grid.Column="1"
Margin="0,4,0,4"
/>
<Button Grid.Row="3" Content="**Add"
HorizontalAlignment="Stretch"
Margin="0,4,0,4" Name="addButton"
Click="addButton_Click"
x:Uid="AddBtn"/>
</Grid>
</StackPanel>
<StackPanel x:Name="panelCheatList"
Padding="12,0,12,0"
BorderBrush="{ThemeResource ListBoxBorderThemeBrush}"
MaxWidth="400"
>
<StackPanel.Resources>
<CollectionViewSource x:Name="cvsAllCheats"/>
</StackPanel.Resources>
<TextBlock Text="**List"
Style="{ThemeResource TitleTextBlockStyle}"
Margin="0,8,0,4"
x:Uid="List"
/>
<TextBlock x:Name="txtNoCheat"
Text="No cheat code has been entered."
x:Uid="NoCheat"
Visibility="Collapsed"
Margin="0,4,0,4" />
<ListBox Name="cheatList"
Background="Transparent"
ItemsSource="{Binding Source={StaticResource cvsAllCheats}}"
Margin="0,4,0,4" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<CheckBox Name="enableCheatBox"
IsChecked="{Binding Enabled}"
Checked="enableCheatBox_Checked"
Unchecked="enableCheatBox_Checked"
Content="{Binding Description}"
Grid.Row="0"
Grid.Column="0"/>
<!--<Button Grid.Column="1"
Name="EditCheatButton"
Content=""
Style="{StaticResource AppBarButtonStyleSmall}"
/>-->
<Button Grid.Column="2" Click="DeleteCheatButton_Click"
Name="DeleteCheatButton"
Content=""
Style="{StaticResource AppBarButtonStyleSmall}"
/>
<TextBlock Text="{Binding CheatCode}" FontSize="16"
Grid.Row="1"
Grid.ColumnSpan="3"
/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</RelativePanel>
</ScrollViewer>
</Grid>
</Page>