forked from James231/GCode-Razor-PostProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
191 lines (177 loc) · 11.8 KB
/
MainWindow.xaml
File metadata and controls
191 lines (177 loc) · 11.8 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<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: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"
WindowStyle="None"
Title="G-Code Razor" Height="550" Width="850"
StateChanged="Window_StateChanged" LocationChanged="Window_LocationChanged"
UseLayoutRounding="True"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="5"/>
</WindowChrome.WindowChrome>
<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" PreviewMouseDown="System_MouseDown" PreviewMouseMove="System_MouseMove">
<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">
<Button x:Name="SeeExampleButton" Width="160" Style="{StaticResource systemButton}" Click="SeeExamplesButtonPressed">
<Label FontSize="20" x:Name="SeeExamplesLabel">See Examples</Label>
</Button>
</Grid>
<Button Click="Mimimize_Click" Style="{StaticResource systemButton}">
<Rectangle Width="11"
Stroke="white"
StrokeThickness="1"/>
</Button>
<Button Click="Maximize_Click" Style="{StaticResource systemButton}">
<Grid>
<Rectangle Name="rectMax" Width="10" Height="10"
Stroke="white"
StrokeThickness="1"/>
<Canvas Name="rectMin" Visibility="Hidden" RenderOptions.EdgeMode="Aliased">
<Polyline Points="2.375,2 2.375,0.375 10.625,0.375 10.625,8.625 9,8.625"
StrokeThickness="0.75" Stroke="white" RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality"/>
<Rectangle Width="9" Height="9"
Stroke="white"
StrokeThickness="1" Margin="0,2,2,0" SnapsToDevicePixels="True" RenderOptions.EdgeMode="Aliased" RenderOptions.BitmapScalingMode="HighQuality" />
</Canvas>
</Grid>
</Button>
<Button Click="Close_Click">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource systemButton}">
<Style.Triggers>
<Trigger Property="Button.IsMouseOver" Value="True">
<Setter Property="Button.Background" Value="#E81123" />
</Trigger>
</Style.Triggers>
<Setter Property="Button.Background" Value="black" />
</Style>
</Button.Style>
<Canvas Height="25" Width="35">
<Line
X1="12" Y1="8"
X2="22" Y2="18"
Stroke="white" StrokeThickness="1"/>
<Line
X1="12" Y1="18"
X2="22" Y2="8"
Stroke="white" StrokeThickness="1"/>
</Canvas>
</Button>
</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>