-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
148 lines (136 loc) · 9.13 KB
/
MainWindow.xaml
File metadata and controls
148 lines (136 loc) · 9.13 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<Window x:Class="CustomWindow.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:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.ExtendViewIntoTitleBar="True"
ui:TitleBar.IsBackButtonVisible="False"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:avEditEx="clr-namespace:TextEditLib;assembly=TextEditLib"
mc:Ignorable="d"
Title="G-Code Razor" Height="550" Width="850"
UseLayoutRounding="True"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
>
<Border Name="main" BorderThickness="0" BorderBrush="Black" Margin="0">
<DockPanel>
<!-- Title Bar Area -->
<Border Name="border" DockPanel.Dock="Top" Height="32">
<Grid>
<Grid Background="Black" HorizontalAlignment="Stretch" Margin="0,0,296,0">
<Image VerticalAlignment="Center" Margin="7 4 7 4" HorizontalAlignment="Left" DockPanel.Dock="Left" Source="logo.png" Width="30" ></Image>
<TextBlock VerticalAlignment="Center" Margin="40 0 0 0" Foreground="White" FontSize="19" Text="{Binding Title, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/>
</Grid>
<!-- System Button Area -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Background="Black">
<StackPanel.Resources>
<Style TargetType="{x:Type Button}" x:Key="systemButton">
<Setter Property="Padding" Value="0"/>
<Setter Property="Width" Value="45"/>
<Setter Property="Height" Value="32"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderThickness="0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Button.IsMouseOver" Value="True">
<Setter Property="Button.Background" Value="#414142" />
</Trigger>
</Style.Triggers>
</Style>
</StackPanel.Resources>
<Grid Width="160" Background="#FF252525">
<ui:TitleBarButton x:Name="SeeExampleButton" Width="160" Style="{StaticResource systemButton}" Click="SeeExamplesButtonPressed">
<Label FontSize="20" x:Name="SeeExamplesLabel" FontFamily="{DynamicResource MaterialDesignFont}">See Examples</Label>
</ui:TitleBarButton>
</Grid>
<Grid Width="140"></Grid>
</StackPanel>
</Grid>
</Border>
<!-- Content Area -->
<Grid DockPanel.Dock="Bottom">
<Grid x:Name="CodeView" Visibility="Visible">
<Grid.RowDefinitions>
<RowDefinition x:Name="TopRow" Height="*" MinHeight="10"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
<RowDefinition x:Name="BottomRow" Height="*" MinHeight="10"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<avEditEx:TextEdit x:Name="InputArea" Text="Enter your code here ..." Padding="6"
SyntaxHighlighting="{Binding HighlightingDefinition, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
FontSize="20"
FontFamily="Consolas"
Background="#FF1E1E1E"
Foreground="White"
LineNumbersForeground="#999"
ShowLineNumbers="True"
EditorCurrentLineBackground="#222"
TextChanged="InputTextChanged"
/>
</Grid>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch" Background="#8100c1" />
<Grid Grid.Row="2">
<avEditEx:TextEdit x:Name="OutputArea" Padding="6"
SyntaxHighlighting="{Binding HighlightingDefinition, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
FontSize="20"
FontFamily="Consolas"
Background="#FF1E1E1E"
Foreground="White"
LineNumbersForeground="#999"
ShowLineNumbers="True"
EditorCurrentLineBackground="#222"
IsReadOnly="True"
/>
<Grid Name="GenerateOverlay" Visibility="Visible" Background="#3FFFFFFF" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Label HorizontalAlignment="Center" FontSize="30">Press the button below to generate raw G-Code.</Label>
<Button Margin="0 20 0 0" MaxWidth="200" FontSize="30" Height="45" Click="GenerateButtonPressed">Generate</Button>
</StackPanel>
</Grid>
<Grid Name="LoadingOverlay" Visibility="Collapsed" Background="#3FFFFFFF" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Label HorizontalAlignment="Center" FontSize="30">Generating ...</Label>
</StackPanel>
</Grid>
</Grid>
<Grid x:Name="SplitterButtonUp" Grid.Row="0">
<Button Width="20" Height="20" Margin="0 0 0 -5" Padding="-10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="SplitterUpButtonPressed">
<materialDesign:PackIcon Kind="ChevronDoubleUp" Foreground="White" Width="22" Height="22"/>
</Button>
</Grid>
<Grid x:Name="SplitterButtonDown" Grid.Row="2">
<Button Width="20" Height="20" Margin="0 -5 0 0" Padding="-10" HorizontalAlignment="Right" VerticalAlignment="Top" Click="SplitterDownButtonPressed">
<materialDesign:PackIcon Kind="ChevronDoubleDown" Foreground="White" Width="22" Height="22"/>
</Button>
</Grid>
</Grid>
<Grid x:Name="ExamplesView" Visibility="Collapsed">
<ScrollViewer>
<StackPanel Margin="20 20 20 10">
<Label FontSize="38">Examples:</Label>
<Separator/>
<StackPanel x:Name="ExParent">
</StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="14" Margin="0 30 0 0">© Copyright 2020; G-Code Razor; Jam-Es.com</TextBlock>
</StackPanel>
</ScrollViewer>
</Grid>
</Grid>
</DockPanel>
</Border>
</Window>