old-SuperVM/SuperVM.VisualDebugger/MainWindow.xaml

128 lines
5.5 KiB
XML

<Window x:Class="SuperVM.VisualDebugger.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:SuperVM.VisualDebugger"
xmlns:avalon="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<local:VirtualMachineModel />
</Window.DataContext>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="File" />
</Menu>
<ToolBar DockPanel.Dock="Top">
<ToolBar.Resources>
<Style TargetType="Path">
<Setter Property="Fill" Value="Black" />
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="16" />
<Setter Property="Stretch" Value="Uniform" />
</Style>
</ToolBar.Resources>
<Button ToolTip="Assemble and Restart" Command="{Binding Path=RecompileCommand}" >
<Path Data="F1 M 38,22.1667L 58.5832,37.6043L 58.5832,38.7918L 38,53.8333L 38,22.1667 Z M 33.25,22.1667L 33.25,53.8333L 26.9167,53.8333L 26.9167,22.1667L 33.25,22.1667 Z "/>
</Button>
<Separator />
<Button ToolTip="Reset" Command="{Binding Path=ResetCommand}">
<Path Data="F1 M 52,24L 52,52L 47,52L 47,43C 47,38.0295 42.9706,34 38,34L 37,34L 37,30L 30.25,36.5L 37,43L 37,39L 38,39C 40.2091,39 42,40.7909 42,43L 42,52L 24,52L 24,24L 52,24 Z "/>
</Button>
<Button ToolTip="Single Step" Command="{Binding Path=StepCommand}">
<Path Data="F1 M 33,25L 59,25L 59,30L 33,30L 33,25 Z M 36,33L 59,33L 59,38L 36,38L 36,33 Z M 36,41L 59,41L 59,46L 36,46L 36,41 Z M 33,49L 59,49L 59,54L 33,54L 33,49 Z M 21,37C 21,39.2092 22.7909,41 25,41L 27,41L 27,37.0001L 33.75,43.5L 27,50L 27,46L 25,46C 20.0294,46 16,41.9705 16,37L 16,34C 16,29.0295 20.0294,25 25,25L 27,25L 27,30L 25,30C 22.7909,30 21,31.7909 21,34L 21,37 Z "/>
</Button>
</ToolBar>
<DockPanel>
<Grid DockPanel.Dock="Right" Width="200">
<TabControl>
<TabItem Header="CPU State">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.Resources>
<Style TargetType="TextBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style TargetType="CheckBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</Grid.Resources>
<Label Grid.Row="0" Grid.Column="0" Content="Stack Pointer" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=StackPointer, UpdateSourceTrigger=PropertyChanged}"/>
<Label Grid.Row="1" Grid.Column="0" Content="Base Pointer" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=BasePointer, UpdateSourceTrigger=PropertyChanged}"/>
<Label Grid.Row="2" Grid.Column="0" Content="Code Pointer" />
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=CodePointer, UpdateSourceTrigger=PropertyChanged}"/>
<Label Grid.Row="3" Grid.Column="0" Content="Flags" />
<Grid Grid.Row="3" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" IsChecked="{Binding Path=FlagZ}" Content="Z"/>
<CheckBox Grid.Column="1" IsChecked="{Binding Path=FlagN}" Content="N"/>
</Grid>
<Label Grid.Row="4" Grid.Column="0" Content="Stack:" />
<ScrollViewer Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2">
<ItemsControl Grid.IsSharedSizeScope="True" ItemsSource="{Binding Path=Stack}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
<Style TargetType="TextBlock" >
<Setter Property="Margin" Value="4,2" />
</Style>
</DataTemplate.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="A" />
<ColumnDefinition Width="1" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=Index}" />
<Border Grid.Column="1" Background="Black" />
<TextBox Grid.Column="2" HorizontalContentAlignment="Right" Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</TabItem>
</TabControl>
</Grid>
<TabControl>
<TabItem Header="Assembler">
<local:CodeEditor
x:Name="codeEditor"
ShowLineNumbers="True"
Code="{Binding Path=Source, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</TabItem>
<TabItem Header="Code">
</TabItem>
</TabControl>
</DockPanel>
</DockPanel>
</Window>