-
Notifications
You must be signed in to change notification settings - Fork 242
Expand file tree
/
Copy pathHexInput.axaml
More file actions
74 lines (68 loc) · 3.09 KB
/
HexInput.axaml
File metadata and controls
74 lines (68 loc) · 3.09 KB
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
<UserControl
xmlns="https://github.com/avaloniaui"
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:l="using:Mesen.Localization"
xmlns:c="using:Mesen.Controls"
xmlns:u="using:Mesen.Utilities"
mc:Ignorable="d"
MinWidth="140"
x:Name="root"
HorizontalAlignment="Stretch"
x:Class="Mesen.Debugger.Controls.HexInput"
>
<UserControl.Resources>
<StreamGeometry x:Key="FirstButton">M7,0 L2,5 7,10 M0,0 L0,10</StreamGeometry>
<StreamGeometry x:Key="LargeButton">M0,0 L5,5 0,10 M7,0 L7,10</StreamGeometry>
<StreamGeometry x:Key="PrevLargeButton">M7,0 L3,4 7,8 M3,0 L-1,4 3,8</StreamGeometry>
<StreamGeometry x:Key="NextLargeButton">M-1,0 L3,4 -1,8 M3,0 L7,4 3,8</StreamGeometry>
<StreamGeometry x:Key="PrevMediumButton">M2,0 L-2,4 2,8</StreamGeometry>
<StreamGeometry x:Key="NextMediumButton">M0,0 L4,4 0,8</StreamGeometry>
<StreamGeometry x:Key="PrevSmallButton">M0,1 H6</StreamGeometry>
<StreamGeometry x:Key="NextSmallButton">M0,3 H6 M3,0 V6</StreamGeometry>
</UserControl.Resources>
<UserControl.Styles>
<Style Selector="RepeatButton">
<Setter Property="Width" Value="16" />
<Setter Property="MinWidth" Value="16" />
<Setter Property="Padding" Value="4 0" />
<Setter Property="MinHeight" Value="21" />
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
<Style Selector="Path">
<Setter Property="Stroke" Value="{DynamicResource ButtonForeground}"/>
<Setter Property="StrokeThickness" Value="0.75"/>
</Style>
<Style Selector="RepeatButton:disabled Path">
<Setter Property="Stroke" Value="{DynamicResource ButtonForegroundDisabled}"/>
</Style>
</UserControl.Styles>
<DockPanel DataContext="{Binding ElementName=root}">
<RepeatButton Command="{Binding DecrementLarge}" DockPanel.Dock="Left" ToolTip.Tip="Previous page">
<Path Data="{StaticResource PrevLargeButton}" />
</RepeatButton>
<RepeatButton Command="{Binding DecrementMedium}" DockPanel.Dock="Left" ToolTip.Tip="Previous tile" Margin="-1 0 0 0">
<Path Data="{StaticResource PrevMediumButton}"/>
</RepeatButton>
<RepeatButton Command="{Binding DecrementSmall}" DockPanel.Dock="Left" ToolTip.Tip="Previous byte" Margin="-1 0 0 0">
<Path Data="{StaticResource PrevSmallButton}"/>
</RepeatButton>
<RepeatButton Command="{Binding IncrementLarge}" DockPanel.Dock="Right" ToolTip.Tip="Next page">
<Path Data="{StaticResource NextLargeButton}" />
</RepeatButton>
<RepeatButton Command="{Binding IncrementMedium}" DockPanel.Dock="Right" ToolTip.Tip="Next tile" Margin="0 0 -1 0">
<Path Data="{StaticResource NextMediumButton}" />
</RepeatButton>
<RepeatButton Command="{Binding IncrementSmall}" DockPanel.Dock="Right" ToolTip.Tip="Next byte" Margin="0 0 -1 0">
<Path Data="{StaticResource NextSmallButton}" />
</RepeatButton>
<c:MesenNumericTextBox
Hex="True"
Value="{Binding Value}"
Max="{Binding Maximum}"
Min="{Binding Minimum}"
/>
</DockPanel>
</UserControl>