1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-04 15:05:03 +00:00
6502bench/SourceGenWPF/ProjWin/MainWindow.xaml
Andy McFadden ce27ae720e Port project loader code
Created a file to hold the non-WPF parts of ProjectView.cs.
Pulled some code related to project loading into it.  Created a few
related dialogs.
2019-05-05 16:50:28 -07:00

258 lines
12 KiB
XML

<!--
Copyright 2019 faddenSoft
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Window x:Class="SourceGenWPF.ProjWin.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SourceGenWPF.ProjWin"
mc:Ignorable="d"
Title="6502bench SourceGen"
Icon="/SourceGenWPF;component/Res/SourceGenIcon.ico"
Width="810" Height="510" MinWidth="800" MinHeight="500">
<Window.Resources>
<RoutedUICommand x:Key="AssembleCmd" Text="Assemble...">
<RoutedUICommand.InputGestures>
<KeyGesture>Ctrl+Shift+A</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="RecentProject"/>
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource AssembleCmd}" Executed="AssembleCmd_Executed"/>
<CommandBinding Command="{StaticResource RecentProject}" Executed="RecentProject_Executed"/>
</Window.CommandBindings>
<DockPanel>
<Menu Name="AppMenu" DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="New"/>
<MenuItem Header="Open"/>
<MenuItem Command="Save"/>
<MenuItem Command="SaveAs"/>
<MenuItem Command="Close"/>
<Separator/>
<MenuItem Command="{StaticResource AssembleCmd}"/>
<MenuItem Command="Print"/>
<Separator/>
<MenuItem Header="Recent Projects">
<MenuItem Header="(none)"/>
</MenuItem>
<Separator/>
<MenuItem Header="Exit"/>
</MenuItem>
<MenuItem Header="_Edit">
<MenuItem Command="Undo"/>
<MenuItem Command="Redo"/>
<Separator/>
<MenuItem Command="Copy"/>
<Separator/>
<MenuItem Command="SelectAll"/>
<MenuItem Command="Find"/>
<MenuItem Header="Find Next"/>
<MenuItem Header="Go To..."/>
<Separator/>
<MenuItem Header="Edit Header Comment..."/>
<MenuItem Command="Properties" Header="Project Properties..."/>
<MenuItem Header="Toggle Data Scan"/>
<Separator/>
<MenuItem Header="Settings..."/>
</MenuItem>
<MenuItem Header="_Actions">
<MenuItem Header="Set Address..."/>
<MenuItem Header="Override Status Flags..."/>
<MenuItem Header="Edit Label..."/>
<MenuItem Header="Edit Operand..."/>
<MenuItem Header="Edit Comment..."/>
<MenuItem Header="Edit Long Comment..."/>
<MenuItem Header="Edit Note..."/>
<MenuItem Header="Edit Project Symbol..."/>
<Separator/>
<MenuItem Header="Hint As Code Entry Point"/>
<MenuItem Header="Hint As Data Start"/>
<MenuItem Header="Hint As Inline Data"/>
<MenuItem Header="Remove Hints"/>
<Separator/>
<MenuItem Header="Format Split-Address Table..."/>
<MenuItem Header="Toggle Single-Byte Format"/>
<MenuItem Header="Format As Word"/>
<MenuItem Header="Delete Note/Long Comment"/>
<Separator/>
<MenuItem Header="Show Hex Dump"/>
</MenuItem>
<MenuItem Header="_Tools">
<MenuItem Header="Hex Dump..."/>
<MenuItem Header="ASCII Chart"/>
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Command="Help"/>
<MenuItem Header="About..."/>
</MenuItem>
<MenuItem Header="_DEBUG" Name="DebugMenu">
<MenuItem Command="Refresh" Header="Re-analyze"/>
<MenuItem Header="Show Undo/Redo History"/>
<MenuItem Header="Show Analyzer Output"/>
<MenuItem Header="Show Analysis Timers"/>
<MenuItem Header="Extension Script Info..."/>
<Separator/>
<MenuItem Header="Toggle Comment Rulers"/>
<MenuItem Header="Use Keep-Alive Hack"/>
<Separator/>
<MenuItem Header="Source Generation Tests..."/>
</MenuItem>
</Menu>
<ToolBar DockPanel.Dock="Top">
<Button Content="tbb" Width="75"/>
</ToolBar>
<StatusBar Name="MainStatusBar" DockPanel.Dock="Bottom">
<TextBlock Text="Ready"/>
</StatusBar>
<!-- Main part of the window. Three side-by-side panels, only the middle of which changes
size when the window is resized. -->
<Grid Name="TriptychGrid" DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="168" MinWidth="100"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" MinWidth="150"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="187" MinWidth="100"/>
</Grid.ColumnDefinitions>
<GridSplitter Width="4" Grid.Column="1" HorizontalAlignment="Left"/>
<GridSplitter Width="4" Grid.Column="3" HorizontalAlignment="Center"/>
<Grid Name="LeftPanel" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="100"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*" MinHeight="100"/>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="References">
<DataGrid Name="ReferencesList" IsReadOnly="True"
FontFamily="{StaticResource GeneralMonoFont}">
<DataGrid.Columns>
<DataGridTextColumn Header="Offset" Binding="{Binding Offset}"/>
<DataGridTextColumn Header="Addr" Binding="{Binding Addr}"/>
<DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GroupBox Grid.Row="2" Header="Notes">
<DataGrid Name="NotesList" IsReadOnly="True"
FontFamily="{StaticResource GeneralMonoFont}">
<DataGrid.Columns>
<DataGridTextColumn Header="Offset" Binding="{Binding Offset}"/>
<DataGridTextColumn Header="Note" Binding="{Binding Note}"/>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
<GridSplitter Height="4" Grid.Row="1"
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
</Grid>
<Grid Name="CenterPanel" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Image Source="/SourceGenWPF;component/Res/Logo.png" Height="100"/>
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" VerticalAlignment="Center"
Text="6502bench SourceGen" FontSize="36"/>
<TextBlock Grid.Row="1" VerticalAlignment="Center"
Text="{Binding ProgramVersionString, StringFormat={}Version {0},
RelativeSource={RelativeSource FindAncestor, AncestorType=Window},
FallbackValue=Version X.Y.Z-alpha1}"
FontSize="24"/>
</Grid>
</StackPanel>
<StackPanel Grid.Row="1" HorizontalAlignment="Left">
<Button Content="Start new project" Width="200" Height="50" Margin="10,30,10,10"/>
<Button Content="Open existing project" Width="200" Height="50" Margin="10"/>
<Button Content="Recent project #1" Width="200" Height="50" Margin="10"
CommandParameter="1"
Command="{DynamicResource RecentProject}"/>
<Button Content="Recent project #2" Width="200" Height="50" Margin="10"
CommandParameter="2"
Command="{DynamicResource RecentProject}"/>
</StackPanel>
</Grid>
<Grid Name="RightPanel" Grid.Column="4">
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="100"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="143" MinHeight="100"/>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="Symbols">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0">
<ToggleButton Content="User" Width="40" Margin="2,2"/>
<ToggleButton Content="Proj" Width="40" Margin="2,2"/>
<ToggleButton Content="Plat" Width="40" Margin="2,2"/>
<ToggleButton Content="Auto" Width="40" Margin="2,2"/>
<ToggleButton Content="Addr" Width="40" Margin="2,2"/>
<ToggleButton Content="Cnst" Width="40" Margin="2,2"/>
</WrapPanel>
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Auto" Margin="0,4,0,0">
<DataGrid Name="SymbolsList" IsReadOnly="True"
FontFamily="{StaticResource GeneralMonoFont}">
<DataGrid.Columns>
<DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
<DataGridTextColumn Header="Value" Binding="{Binding Value}"/>
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
</DataGrid.Columns>
</DataGrid>
</ScrollViewer>
</Grid>
</GroupBox>
<GroupBox Grid.Row="2" Header="Info">
<TextBox/>
</GroupBox>
<GridSplitter Height="4" Grid.Row="1"
HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
</Grid>
</Grid>
</DockPanel>
</Window>