mirror of
https://github.com/fadden/6502bench.git
synced 2024-11-03 08:04:57 +00:00
2f82ff5b46
Also, add keyboard shortcuts to toolbar tooltips. This is particularly useful for navigate forward/backward, as those aren't part of the menu structure, and have two keyboard shortcuts apiece.
552 lines
31 KiB
XML
552 lines
31 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.WpfGui.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.WpfGui"
|
|
mc:Ignorable="d"
|
|
Title="6502bench SourceGen"
|
|
Icon="/SourceGenWPF;component/Res/SourceGenIcon.ico"
|
|
Width="1000" Height="700" MinWidth="800" MinHeight="500"
|
|
SourceInitialized="Window_SourceInitialized"
|
|
Loaded="Window_Loaded"
|
|
LocationChanged="Window_LocationChanged"
|
|
SizeChanged="Window_SizeChanged"
|
|
MouseDown="Window_MouseDown"
|
|
Closing="Window_Closing">
|
|
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<!-- style and control templates for main code ListView items -->
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="CodeListItemStyle.xaml"/>
|
|
<ResourceDictionary Source="../Res/CommandIcons.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<!-- don't center the ListView(GridView) column headers
|
|
https://stackoverflow.com/q/44119146/294248
|
|
(style without ID applies to all instances of that type)
|
|
-->
|
|
<Style TargetType="{x:Type GridViewColumnHeader}">
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
</Style>
|
|
|
|
<RoutedUICommand x:Key="AboutCmd" Text="About..."/>
|
|
<RoutedUICommand x:Key="AssembleCmd" Text="Assemble...">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+Shift+A</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="CloseCmd" Text="Close"/>
|
|
<RoutedUICommand x:Key="DebugSourceGenerationTestsCmd" Text="Source Generation Tests..."/>
|
|
<RoutedUICommand x:Key="EditAddressCmd" Text="Set Address..."/>
|
|
<RoutedUICommand x:Key="EditAppSettingsCmd" Text="Settings..."/>
|
|
<RoutedUICommand x:Key="EditHeaderCommentCmd" Text="Edit Header Comment..."/>
|
|
<RoutedUICommand x:Key="EditOperandCmd" Text="Edit Operand...">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+O</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="EditLabelCmd" Text="Edit Label...">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+L</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="EditLongCommentCmd" Text="Edit Long Comment...">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+M</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="EditStatusFlagsCmd" Text="Override Status Flags..."/>
|
|
<RoutedUICommand x:Key="ExitCmd" Text="Exit"/>
|
|
<RoutedUICommand x:Key="FindNextCmd" Text="Find Next">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>F3</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="GotoCmd" Text="Go To...">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+G</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="HintAsCodeEntryPointCmd" Text="Hint As Code Entry Point"/>
|
|
<RoutedUICommand x:Key="HintAsDataStartCmd" Text="Hint As Data Start"/>
|
|
<RoutedUICommand x:Key="HintAsInlineDataCmd" Text="Hint As Inline Data"/>
|
|
<RoutedUICommand x:Key="NavigateBackwardCmd" Text="Nav Backward">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Alt+Left</KeyGesture>
|
|
<KeyGesture>Ctrl+Minus</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="NavigateForwardCmd" Text="Nav Forward">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Alt+Right</KeyGesture>
|
|
<KeyGesture>Ctrl+Shift+Minus</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="NewProjectCmd" Text="New"/>
|
|
<RoutedUICommand x:Key="OpenCmd" Text="Open"/>
|
|
<RoutedUICommand x:Key="RemoveHintsCmd" Text="Remove Hints"/>
|
|
<RoutedUICommand x:Key="RecentProjectCmd"/>
|
|
<RoutedUICommand x:Key="RedoCmd" Text="Redo">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+Y</KeyGesture>
|
|
<KeyGesture>Ctrl+Shift+Z</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="SelectAllCmd" Text="Select All">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+A</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="ToggleDataScanCmd" Text="Toggle Data Scan">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+D</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
<RoutedUICommand x:Key="UndoCmd" Text="Undo">
|
|
<RoutedUICommand.InputGestures>
|
|
<KeyGesture>Ctrl+Z</KeyGesture>
|
|
</RoutedUICommand.InputGestures>
|
|
</RoutedUICommand>
|
|
|
|
<CollectionViewSource x:Key="SymbolTableSource" Source="{Binding SymbolsList}"
|
|
Filter="SymbolsList_Filter"/>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
|
|
<Window.CommandBindings>
|
|
<CommandBinding Command="{StaticResource AboutCmd}"
|
|
Executed="AboutCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditAppSettingsCmd}"
|
|
Executed="EditAppSettingsCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource AssembleCmd}"
|
|
CanExecute="IsProjectOpen" Executed="AssembleCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource CloseCmd}"
|
|
CanExecute="IsProjectOpen" Executed="CloseCmd_Executed"/>
|
|
<CommandBinding Command="Copy"
|
|
CanExecute="IsProjectOpen" Executed="CopyCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource DebugSourceGenerationTestsCmd}"
|
|
Executed="DebugSourceGenerationTestsCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditAddressCmd}"
|
|
CanExecute="CanEditAddress" Executed="EditAddressCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditHeaderCommentCmd}"
|
|
CanExecute="IsProjectOpen" Executed="EditHeaderCommentCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditLabelCmd}"
|
|
CanExecute="CanEditLabel" Executed="EditLabelCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditLongCommentCmd}"
|
|
CanExecute="CanEditLongComment" Executed="EditLongCommentCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditOperandCmd}"
|
|
CanExecute="CanEditOperand" Executed="EditOperandCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource EditStatusFlagsCmd}"
|
|
CanExecute="CanEditStatusFlags" Executed="EditStatusFlagsCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource ExitCmd}"
|
|
Executed="ExitCmd_Executed"/>
|
|
<CommandBinding Command="Find"
|
|
CanExecute="IsProjectOpen" Executed="FindCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource FindNextCmd}"
|
|
CanExecute="IsProjectOpen" Executed="FindNextCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource GotoCmd}"
|
|
CanExecute="IsProjectOpen" Executed="GotoCmd_Executed"/>
|
|
<CommandBinding Command="Help"
|
|
Executed="HelpCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource HintAsCodeEntryPointCmd}"
|
|
CanExecute="CanHintAsCodeEntryPoint" Executed="HintAsCodeEntryPointCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource HintAsDataStartCmd}"
|
|
CanExecute="CanHintAsDataStart" Executed="HintAsDataStartCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource HintAsInlineDataCmd}"
|
|
CanExecute="CanHintAsInlineData" Executed="HintAsInlineDataCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource NavigateBackwardCmd}"
|
|
CanExecute="CanNavigateBackward" Executed="NavigateBackwardCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource NavigateForwardCmd}"
|
|
CanExecute="CanNavigateForward" Executed="NavigateForwardCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource NewProjectCmd}"
|
|
Executed="NewProjectCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource OpenCmd}"
|
|
Executed="OpenCmd_Executed"/>
|
|
<CommandBinding Command="Properties"
|
|
CanExecute="IsProjectOpen" Executed="EditProjectPropertiesCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource RemoveHintsCmd}"
|
|
CanExecute="CanRemoveHints" Executed="RemoveHintsCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource RecentProjectCmd}" x:Name="recentProjectCmd"
|
|
Executed="RecentProjectCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource RedoCmd}"
|
|
CanExecute="CanRedo" Executed="RedoCmd_Executed"/>
|
|
<CommandBinding Command="Save"
|
|
CanExecute="IsProjectOpen" Executed="SaveCmd_Executed"/>
|
|
<CommandBinding Command="SaveAs"
|
|
CanExecute="IsProjectOpen" Executed="SaveAsCmd_Executed"/>
|
|
<!-- ListView has a built-in Ctrl+A handler; this only fires when codeListView is not in focus -->
|
|
<CommandBinding Command="{StaticResource SelectAllCmd}"
|
|
CanExecute="IsProjectOpen" Executed="SelectAllCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource ToggleDataScanCmd}"
|
|
CanExecute="IsProjectOpen" Executed="ToggleDataScanCmd_Executed"/>
|
|
<CommandBinding Command="{StaticResource UndoCmd}"
|
|
CanExecute="CanUndo" Executed="UndoCmd_Executed"/>
|
|
</Window.CommandBindings>
|
|
|
|
<DockPanel>
|
|
<Menu Name="appMenu" DockPanel.Dock="Top">
|
|
<MenuItem Header="_File">
|
|
<MenuItem Command="{StaticResource NewProjectCmd}"/>
|
|
<MenuItem Command="{StaticResource OpenCmd}"/>
|
|
<MenuItem Command="Save"/>
|
|
<MenuItem Command="SaveAs"/>
|
|
<MenuItem Command="{StaticResource CloseCmd}"/>
|
|
<Separator/>
|
|
<MenuItem Command="{StaticResource AssembleCmd}"/>
|
|
<MenuItem Command="Print"/>
|
|
<Separator/>
|
|
<MenuItem Name="recentProjectsMenu" Header="Recent Projects" SubmenuOpened="RecentProjectsMenu_SubmenuOpened">
|
|
<MenuItem Header="(none)"/>
|
|
</MenuItem>
|
|
<Separator/>
|
|
<MenuItem Command="{StaticResource ExitCmd}" InputGestureText="Alt+F4"/>
|
|
</MenuItem>
|
|
<MenuItem Header="_Edit" SubmenuOpened="EditMenu_SubmenuOpened">
|
|
<MenuItem Command="{StaticResource UndoCmd}"/>
|
|
<MenuItem Command="{StaticResource RedoCmd}"/>
|
|
<Separator/>
|
|
<MenuItem Command="Copy"/>
|
|
<Separator/>
|
|
<MenuItem Command="{StaticResource SelectAllCmd}"/>
|
|
<MenuItem Command="Find"/>
|
|
<MenuItem Command="{StaticResource FindNextCmd}"/>
|
|
<MenuItem Command="{StaticResource GotoCmd}"/>
|
|
<Separator/>
|
|
<MenuItem Command="{StaticResource EditHeaderCommentCmd}"/>
|
|
<MenuItem Command="Properties" Header="Project Properties..."/>
|
|
<!-- IsChecked is set whenever the menu is opened -->
|
|
<MenuItem Name="toggleDataScanMenuItem"
|
|
Command="{StaticResource ToggleDataScanCmd}" IsCheckable="True"/>
|
|
<Separator/>
|
|
<MenuItem Command="{StaticResource EditAppSettingsCmd}"/>
|
|
</MenuItem>
|
|
<MenuItem Name="actionsMenu" Header="_Actions">
|
|
<MenuItem Command="{StaticResource EditAddressCmd}"/>
|
|
<MenuItem Command="{StaticResource EditStatusFlagsCmd}"/>
|
|
<MenuItem Command="{StaticResource EditLabelCmd}"/>
|
|
<MenuItem Command="{StaticResource EditOperandCmd}"/>
|
|
<MenuItem Header="Edit Comment..."/> <!-- Ctrl+; -->
|
|
<MenuItem Command="{StaticResource EditLongCommentCmd}"/>
|
|
<MenuItem Header="Edit Note..."/> <!-- Ctrl+N -->
|
|
<MenuItem Header="Edit Project Symbol..."/>
|
|
<Separator/>
|
|
<MenuItem Command="{StaticResource HintAsCodeEntryPointCmd}" InputGestureText="Ctrl+H, Ctrl+C"/>
|
|
<MenuItem Command="{StaticResource HintAsDataStartCmd}" InputGestureText="Ctrl+H, Ctrl+D"/>
|
|
<MenuItem Command="{StaticResource HintAsInlineDataCmd}" InputGestureText="Ctrl+H, Ctrl+I"/>
|
|
<MenuItem Command="{StaticResource RemoveHintsCmd}" InputGestureText="Ctrl+H, Ctrl+R"/>
|
|
<Separator/>
|
|
<MenuItem Header="Format Split-Address Table..."/>
|
|
<MenuItem Header="Toggle Single-Byte Format"/> <!-- Ctrl+B -->
|
|
<MenuItem Header="Format As Word"/> <!-- Ctrl+W -->
|
|
<MenuItem Header="Delete Note/Long Comment"/> <!-- Del -->
|
|
<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 Command="{StaticResource AboutCmd}"/>
|
|
</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 Command="{StaticResource DebugSourceGenerationTestsCmd}"/>
|
|
</MenuItem>
|
|
</Menu>
|
|
|
|
<ToolBarTray DockPanel.Dock="Top">
|
|
<ToolBar RenderOptions.BitmapScalingMode="NearestNeighbor">
|
|
<Button Command="{StaticResource NavigateBackwardCmd}"
|
|
ToolTip="Navigate backward (Alt+Left, Ctrl+Minus, or back button on mouse)">
|
|
<ContentControl Template="{StaticResource icon_StepBackwards}"/>
|
|
</Button>
|
|
<Button Command="{StaticResource NavigateForwardCmd}"
|
|
ToolTip="Navigate forward (Alt+Right or Ctrl+Shift+Minus)">
|
|
<ContentControl Template="{StaticResource icon_StepForward}"/>
|
|
</Button>
|
|
<Separator/>
|
|
<Button Command="{StaticResource NewProjectCmd}" ToolTip="Create new project">
|
|
<ContentControl Template="{StaticResource icon_NewFile}"/>
|
|
</Button>
|
|
<Button Command="{StaticResource OpenCmd}" ToolTip="Open project">
|
|
<ContentControl Template="{StaticResource icon_OpenFile}"/>
|
|
</Button>
|
|
<Button Command="Save" ToolTip="Save project (Ctrl+S)">
|
|
<ContentControl Template="{StaticResource icon_SaveFile}"/>
|
|
</Button>
|
|
<Separator/>
|
|
<Button Command="Copy" ToolTip="Copy to clipboard (Ctrl+C)">
|
|
<ContentControl Template="{StaticResource icon_CopyToClipboard}"/>
|
|
</Button>
|
|
<Separator/>
|
|
<Button Command="Help" ToolTip="Help - open manual in browser (F1)">
|
|
<ContentControl Template="{StaticResource icon_F1Help}"/>
|
|
</Button>
|
|
</ToolBar>
|
|
</ToolBarTray>
|
|
|
|
<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. This needs to be the last thing defined in the
|
|
DockPanel, so that LastChildFill will expand this to fill all available space. -->
|
|
<Grid Name="triptychGrid" DockPanel.Dock="Top">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="256" MinWidth="100"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*" MinWidth="150"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="256" MinWidth="100"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<GridSplitter Name="leftSplitter" Width="4" Grid.Column="1" HorizontalAlignment="Left"/>
|
|
<GridSplitter Name="rightSplitter" Width="4" Grid.Column="3" HorizontalAlignment="Center"/>
|
|
|
|
<Grid Name="leftPanel" Grid.Column="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="2*" MinHeight="100"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*" MinHeight="100"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Grid.Row="0" Header="References">
|
|
<DataGrid Name="referencesGrid" IsReadOnly="True"
|
|
ItemsSource="{Binding ReferencesList}"
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
SnapsToDevicePixels="True"
|
|
GridLinesVisibility="Vertical"
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
AutoGenerateColumns="False"
|
|
HeadersVisibility="Column"
|
|
CanUserReorderColumns="False"
|
|
SelectionMode="Single"
|
|
MouseDoubleClick="ReferencesList_MouseDoubleClick">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Header="Offset" Width="53" Binding="{Binding Offset}"/>
|
|
<DataGridTextColumn Header="Addr" Width="53" Binding="{Binding Addr}"/>
|
|
<DataGridTextColumn Header="Type" Width="119" Binding="{Binding Type}"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Grid.Row="2" Header="Notes">
|
|
<DataGrid Name="notesGrid" IsReadOnly="True"
|
|
ItemsSource="{Binding NotesList}"
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
SnapsToDevicePixels="True"
|
|
GridLinesVisibility="Vertical"
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
AutoGenerateColumns="False"
|
|
HeadersVisibility="Column"
|
|
CanUserReorderColumns="False"
|
|
SelectionMode="Single"
|
|
MouseDoubleClick="NotesList_MouseDoubleClick">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Header="Offset" Width="53" Binding="{Binding Offset}"/>
|
|
<DataGridTextColumn Header="Note" Width="400" Binding="{Binding Note}">
|
|
<DataGridTextColumn.ElementStyle>
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
<!-- The default highlight uses dark blue background with
|
|
white text, but our highlight colors are meant to work
|
|
with black text. So override Foreground as well. -->
|
|
<Setter Property="Background" Value="{Binding BackBrush}"/>
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
</Style>
|
|
</DataGridTextColumn.ElementStyle>
|
|
</DataGridTextColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</GroupBox>
|
|
|
|
<GridSplitter Height="4" Grid.Row="1"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
|
|
</Grid>
|
|
|
|
<Grid Name="launchPanel" Grid.Column="2"
|
|
Visibility="{Binding Path=LaunchPanelVisibility}" d:IsHidden="True">
|
|
<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="240" Height="50" Margin="10,30,10,10"
|
|
Command="{StaticResource NewProjectCmd}"/>
|
|
<Button Content="Open existing project" Width="240" Height="50" Margin="10"
|
|
Command="{StaticResource OpenCmd}"/>
|
|
<Button Name="recentProjectButton1" Width="240" Height="50" Margin="10"
|
|
Command="{DynamicResource RecentProjectCmd}" CommandParameter="0">
|
|
<Button.Content>
|
|
<StackPanel>
|
|
<TextBlock HorizontalAlignment="Center">Recent project #1</TextBlock>
|
|
<TextBlock Name="recentProjectName1" HorizontalAlignment="Center">???</TextBlock>
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
<Button Name="recentProjectButton2" Width="240" Height="50" Margin="10"
|
|
Command="{DynamicResource RecentProjectCmd}" CommandParameter="1">
|
|
<Button.Content>
|
|
<StackPanel>
|
|
<TextBlock HorizontalAlignment="Center">Recent project #2</TextBlock>
|
|
<TextBlock Name="recentProjectName2" HorizontalAlignment="Center">???</TextBlock>
|
|
</StackPanel>
|
|
</Button.Content>
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<ListView Name="codeListView" Grid.Column="2"
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
Visibility="{Binding Path=CodeListVisibility}"
|
|
VirtualizingStackPanel.VirtualizationMode="Recycling"
|
|
ItemContainerStyle="{StaticResource codeListItemStyle}"
|
|
SelectionChanged="CodeListView_SelectionChanged"
|
|
MouseDoubleClick="CodeListView_MouseDoubleClick">
|
|
<ListView.Resources>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
|
|
<!-- <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text }" /> -->
|
|
</Style>
|
|
</ListView.Resources>
|
|
<ListView.View>
|
|
<GridView AllowsColumnReorder="False">
|
|
<GridViewColumn Header="Offset" Width="60"
|
|
DisplayMemberBinding="{Binding Offset}"/>
|
|
<GridViewColumn Header="Addr" Width="60"
|
|
CellTemplate="{StaticResource addrHighlightTemplate}"/>
|
|
<GridViewColumn Header="Bytes" Width="93"
|
|
DisplayMemberBinding="{Binding Bytes}"/>
|
|
<GridViewColumn Header="Flags" Width="80"
|
|
DisplayMemberBinding="{Binding Flags}"/>
|
|
<GridViewColumn Header="Attr" Width="54"
|
|
DisplayMemberBinding="{Binding Attr}"/>
|
|
<GridViewColumn Header="Label" Width="73"
|
|
CellTemplate="{StaticResource labelHighlightTemplate}"/>
|
|
<GridViewColumn Header="Opcode" Width="60"
|
|
DisplayMemberBinding="{Binding Opcode}"/>
|
|
<GridViewColumn Header="Operand" Width="100"
|
|
DisplayMemberBinding="{Binding Operand}"/>
|
|
<GridViewColumn Header="Comment" Width="344"
|
|
DisplayMemberBinding="{Binding Comment}"/>
|
|
</GridView>
|
|
</ListView.View>
|
|
|
|
<ListView.ContextMenu>
|
|
<!-- this is populated as a clone of the Actions menu during init -->
|
|
<ContextMenu/>
|
|
</ListView.ContextMenu>
|
|
|
|
</ListView>
|
|
|
|
<Grid Name="rightPanel" Grid.Column="4">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="2*" MinHeight="100"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*" 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 Name="symUserLabels" Content="User" Width="40" Margin="2,2"
|
|
Checked="SymbolsListFilter_Changed" Unchecked="SymbolsListFilter_Changed"/>
|
|
<ToggleButton Name="symProjectSymbols" Content="Proj" Width="40" Margin="2,2"
|
|
Checked="SymbolsListFilter_Changed" Unchecked="SymbolsListFilter_Changed"/>
|
|
<ToggleButton Name="symPlatformSymbols" Content="Plat" Width="40" Margin="2,2"
|
|
Checked="SymbolsListFilter_Changed" Unchecked="SymbolsListFilter_Changed"/>
|
|
<ToggleButton Name="symAutoLabels" Content="Auto" Width="40" Margin="2,2"
|
|
Checked="SymbolsListFilter_Changed" Unchecked="SymbolsListFilter_Changed"/>
|
|
<ToggleButton Name="symAddresses" Content="Addr" Width="40" Margin="2,2"
|
|
Checked="SymbolsListFilter_Changed" Unchecked="SymbolsListFilter_Changed"/>
|
|
<ToggleButton Name="symConstants" Content="Cnst" Width="40" Margin="2,2"
|
|
Checked="SymbolsListFilter_Changed" Unchecked="SymbolsListFilter_Changed"/>
|
|
</WrapPanel>
|
|
|
|
<DataGrid Grid.Row="1" Name="symbolsGrid"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding Source={StaticResource SymbolTableSource}}"
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
SnapsToDevicePixels="True"
|
|
GridLinesVisibility="Vertical"
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
AutoGenerateColumns="False"
|
|
HeadersVisibility="Column"
|
|
CanUserReorderColumns="False"
|
|
SelectionMode="Single"
|
|
Sorting="SymbolsList_Sorting"
|
|
MouseDoubleClick="SymbolsList_MouseDoubleClick">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Header="Type" Width="36" Binding="{Binding Type}"/>
|
|
<DataGridTextColumn Header="Value" Width="66" Binding="{Binding Value}"/>
|
|
<DataGridTextColumn Header="Name" Width="120" Binding="{Binding Name}"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Grid.Row="2" Header="Info">
|
|
<TextBox Text="{Binding InfoPanelContents}"
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
TextWrapping="Wrap"/>
|
|
</GroupBox>
|
|
|
|
<GridSplitter Height="4" Grid.Row="1"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
|
|
</Grid>
|
|
</Grid>
|
|
</DockPanel>
|
|
</Window>
|