This repository has been archived by the owner on Jul 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
130 lines (115 loc) · 6.97 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<Window x:Class="RustGuiEditor.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:RustGuiEditor"
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="CUI Editor" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Margin" Value="1"></Setter>
</Style>
<Style TargetType="xctk:IntegerUpDown">
<Setter Property="Margin" Value="1"></Setter>
</Style>
<x:Null x:Key="activeElement"></x:Null>
</Window.Resources>
<Grid ShowGridLines="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Menu VerticalAlignment="Top" Grid.Row="0" Grid.ColumnSpan="2">
<MenuItem Header="Файл">
<MenuItem Header="Новый проект" Click="CreateNewProject"/>
<MenuItem Header="Открыть проект" Click="LoadProject"/>
<MenuItem Header="Сохранить проект" Click="SaveProject"/>
<MenuItem Header="Выйти" Click="Exit"/>
</MenuItem>
<MenuItem Header="Экспорт">
<MenuItem Header="Настройки проекта" Click="OpenSettings"/>
<MenuItem Header="Сохранить в коде для CUI Helper" Click="ExportButton"/>
</MenuItem>
<MenuItem Header="Справка">
<MenuItem Header="О программе" Click="OpenAbout"/>
<Separator></Separator>
<MenuItem Header="Функции разработчика" IsEnabled="False"/>
<MenuItem Header="GC Collect" Click="ButtonGcCollect"/>
</MenuItem>
</Menu>
<ToolBarTray Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
<ToolBar ToolBarTray.IsLocked="True">
<Label>Проект:</Label>
<Button ToolTip="Новый проект" Click="CreateNewProject">
<Image Source="/images/icon_new.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Открыть проект" Click="LoadProject">
<Image Source="/images/icon_open.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Сохранить проект" Click="SaveProject">
<Image Source="/images/icon_save.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Настройки проекта" Click="OpenSettings">
<Image Source="/images/icon_settings.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Separator></Separator>
<Label>Создать:</Label>
<Button ToolTip="Прямоугольник" Click="CreateRectangleButton">
<Image Source="/images/icon_rectangle.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Изображение" Click="CreateImageButton">
<Image Source="/images/icon_image.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Текст" Click="CreateTextButton">
<Image Source="/images/icon_text.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Кнопка" Click="CreateButtonButton">
<Image Source="/images/icon_button.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Button ToolTip="Текстура" Click="CreateTextureButton">
<Image Source="/images/icon_cube.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
<Separator></Separator>
<Label>Экспорт:</Label>
<Button ToolTip="Экспорт кода CUI Helper" Click="ExportButton">
<Image Source="/images/icon_export.png" Height="16" RenderOptions.BitmapScalingMode="Fant"></Image>
</Button>
</ToolBar>
</ToolBarTray>
<StackPanel Grid.Row="2" Grid.Column="0" Margin="4" MinWidth="1" >
<Label Content="Изменить:"/>
<Grid x:Name="_editButtonsGrid">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Content="Позиция" Grid.Column="0" Grid.Row="0" IsEnabled="false" Click="SetMoveEditMode" x:Name="btnModeMove"/>
<Button Content="Размер" Grid.Column="1" Grid.Row="0" Click="SetResizeEditMode" x:Name="btnModeReize"/>
<Button Content="Центр по X" Grid.Column="0" Grid.Row="1" Click="CenterXButton"/>
<Button Content="Центр по Y" Grid.Column="1" Grid.Row="1" Click="CenterYButton"/>
<Button Content="Копировать" Grid.Column="0" Grid.Row="2" Click="CopyButton"/>
<Button Content="Удалить" Grid.Column="1" Grid.Row="2" Click="RemoveButton"/>
</Grid>
<Separator Background="Gray" Height="10" Grid.Row="3" Grid.ColumnSpan="2"/>
<xctk:PropertyGrid x:Name="_propertyGrid" Margin="1" AutoGenerateProperties="True"
SelectedObject="{DynamicResource ResourceKey=activeElement}" Height="200" Width="230"
ShowSearchBox="False" ShowSortOptions="False" ShowSummary="False" NameColumnWidth="100" ShowTitle="False">
</xctk:PropertyGrid>
</StackPanel>
<Canvas x:Name="mainCanvas" Grid.Row="2" Grid.Column="2" Background="Bisque" Width="1600" Height="900">
</Canvas>
</Grid>
</Window>