-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
108 lines (105 loc) · 6.47 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
98
99
100
101
102
103
104
105
106
107
108
<Window x:Class="MapyCZforTS_CS.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:loc="clr-namespace:MapyCZforTS_CS.Localization"
xmlns:local="clr-namespace:MapyCZforTS_CS"
mc:Ignorable="d"
Title="MapyCZforTS" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight">
<Window.Resources>
<!-- Source https://stackoverflow.com/a/63734191/6035781 -->
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="20" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto"
Margin="0" Padding="0"
VerticalAlignment="Stretch" VerticalContentAlignment="Center"
Text="{Binding Value, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}">
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1"
Command="{x:Static Slider.IncreaseSmall}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1"
Command="{x:Static Slider.DecreaseSmall}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<TabControl>
<TabItem Header="{x:Static loc:Strings.MenuMain}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="180" Margin="20">
<StackPanel.LayoutTransform>
<ScaleTransform ScaleX="1.2" ScaleY="1.2" />
</StackPanel.LayoutTransform>
<Label Content="{x:Static loc:Strings.LabelSelectMapset}" />
<ComboBox x:Name="mapsetInput" SelectionChanged="mapsetInput_SelectionChanged" HorizontalAlignment="Stretch" />
<Label>
<Label.Content>
<TextBlock>
<Run x:Name="MaxZoomText" Text="" />
</TextBlock>
</Label.Content>
</Label>
<Button x:Name="toogleProxy" Content="{x:Static loc:Strings.ButtonEnableProxy}" Margin="0,10" Padding="10,20" Click="toogleProxy_Click" />
</StackPanel>
</TabItem>
<TabItem Header="{x:Static loc:Strings.MenuSettings}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="180" Margin="20">
<StackPanel.LayoutTransform>
<ScaleTransform ScaleX="1.2" ScaleY="1.2" />
</StackPanel.LayoutTransform>
<Label Content="{x:Static loc:Strings.LabelPort}" />
<Slider x:Name="portInput" AllowDrop="False" Minimum="80" Maximum="65535" Value="5001" ValueChanged="portInput_ValueChanged" />
<Button x:Name="clearCache" Content="{x:Static loc:Strings.LabelClearCache}" Margin="0,10,0,5" Padding="10,10" Click="clearCache_Click" />
<Button x:Name="openLog" Content="{x:Static loc:Strings.LabelOpenLog}" Margin="0,5" Padding="10,10" Click="openLog_Click" />
<CheckBox x:Name="loggingCheckbox" Content="{x:Static loc:Strings.CheckboxAdvancedLogging}" HorizontalAlignment="Left" Margin="0,5,0,10" Checked="loggingCheckbox_Checked" Unchecked="loggingCheckbox_Checked" />
<CheckBox x:Name="cachingCheckbox" Content="{x:Static loc:Strings.CheckboxCaching}" HorizontalAlignment="Left" Margin="0" Grid.Row="1" Checked="cachingCheckbox_Checked" Unchecked="cachingCheckbox_Checked" />
</StackPanel>
</TabItem>
<TabItem Header="{x:Static loc:Strings.MenuAbout}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="180" Margin="20">
<StackPanel.LayoutTransform>
<ScaleTransform ScaleX="1.2" ScaleY="1.2" />
</StackPanel.LayoutTransform>
<Label Content="Mapy.cz for Train Simulator" />
<Label Content="© Jáchym Hurtík 2022" />
</StackPanel>
</TabItem>
</TabControl>
</Window>