-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
97 lines (93 loc) · 4.99 KB
/
MainWindow.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
<adonisControls:AdonisWindow x:Class="PD2SoundBankEditor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:adonisControls="clr-namespace:AdonisUI.Controls;assembly=AdonisUI"
xmlns:adonisExtensions="clr-namespace:AdonisUI.Extensions;assembly=AdonisUI"
Closed="OnWindowClosed"
Title="PD2 Soundbank Editor"
Height="480"
Width="720">
<Window.Style>
<Style TargetType="Window" BasedOn="{StaticResource {x:Type Window}}"/>
</Window.Style>
<Window.CommandBindings>
<CommandBinding Command="Save" CanExecute="CommandSaveCanExecute" Executed="CommandSaveExecuted" />
<CommandBinding Command="SaveAs" CanExecute="CommandSaveAsCanExecute" Executed="CommandSaveAsExecuted" />
</Window.CommandBindings>
<Grid>
<Grid Name="mainGrid" Margin="8,0,8,32">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Menu IsMainMenu="True" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,0,0,8" HorizontalAlignment="Stretch">
<MenuItem Header="_File">
<MenuItem Header="_Open..." Click="OnOpenButtonClick"/>
<Separator />
<MenuItem Header="_Save" Command="Save"/>
<MenuItem Header="Save _as..." Command="SaveAs"/>
<Separator />
<MenuItem Header="Recent _files" Name="recentFilesList">
<MenuItem.ItemContainerStyle>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Header" Value="{Binding}"/>
<EventSetter Event="Click" Handler="OnRecentFileClick"/>
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<Separator />
<MenuItem Header="_Exit" Click="OnExitButtonClick"/>
</MenuItem>
<MenuItem Header="_Tools">
<MenuItem Header="_Convert loose files..." Click="OnConvertLooseFilesClick"/>
<MenuItem Name="setAudioPropertiedMenuItem" Header="_Set audio properties..." Click="OnSetAudioPropertiesClick" IsEnabled="False"/>
</MenuItem>
<MenuItem Header="_View">
<MenuItem Header="_Hide unreferenced files" IsCheckable="True" IsChecked="{Binding HideUnreferencedEnabled, Mode=TwoWay}" Checked="OnFilterChanged" Unchecked="OnFilterChanged"/>
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Header="_Suppress playback errors" IsCheckable="True" IsChecked="{Binding SuppressErrorsEnabled, Mode=TwoWay}"/>
<MenuItem Header="Check for _updates on startup" IsCheckable="True" IsChecked="{Binding UpdateCheckEnabled, Mode=TwoWay}"/>
<Separator />
<MenuItem Header="_About..." Click="OnAboutButtonClick"/>
</MenuItem>
</Menu>
<DataGrid Name="dataGrid" AutoGenerateColumns="False" Grid.Column="0" Grid.Row="1" SelectionChanged="OnDataGridSelectionChanged" HorizontalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTemplateColumn SortMemberPath="Offset" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="▶" Click="OnPlayButtonClick" Width="20" Height="20" Padding="0,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="ID" Binding="{Binding Id}" IsReadOnly="True"/>
<DataGridTextColumn Header="Size" Binding="{Binding Size, StringFormat={}{0:0.0} KB}" IsReadOnly="True"/>
<DataGridTextColumn Width="*" Header="Note" Binding="{Binding Note}" IsReadOnly="False"/>
<DataGridTextColumn Width="*" Header="Replacement" Binding="{Binding ReplacementFile}" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
<Grid Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="8,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Name="extractAllButton" Content="Extract all" Click="OnExtractButtonClick" IsEnabled="False" Height="24"/>
<Button Grid.Row="1" Name="extractSelectedButton" Content="Extract selected" Click="OnExtractButtonClick" IsEnabled="False" Height="24"/>
<Button Grid.Row="2" Name="replaceSelectedButton" Content="Replace selected..." Click="OnReplaceButtonClick" IsEnabled="False" Height="24" Margin="0,8,0,0"/>
<Button Grid.Row="3" Name="replaceByNamesButton" Content="Replace by ID..." Click="OnReplaceByNamesButtonClick" IsEnabled="False" Height="24" Margin="0,0,0,0"/>
<TextBox Grid.Row="5" Name="filterTextBox" adonisExtensions:WatermarkExtension.Watermark="Filter" TextChanged="OnFilterChanged" Height="24"/>
</Grid>
</Grid>
<ProgressBar Name="progressBar" Margin="8,8,8,8" VerticalAlignment="Bottom" Height="16"/>
</Grid>
</adonisControls:AdonisWindow>