forked from akshinmustafayev/EasyJob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
131 lines (131 loc) · 8.08 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
131
<Window x:Class="EasyJob.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:ej="clr-namespace:EasyJob.Windows"
xmlns:local="clr-namespace:EasyJob"
mc:Ignorable="d" Icon="pack://application:,,,/Images/icon.ico"
Title="EasyJob Executor" Height="450" Width="800" WindowStartupLocation="CenterScreen">
<Window.Resources>
<ContextMenu x:Key="RemoveTabContextMenu">
<MenuItem Name="cmdRemoveTab" Header="Remove tab" Click="ContextMenuRemoveTab_Click"/>
</ContextMenu>
<ContextMenu x:Key="RemoveActionButtonContextMenu">
<MenuItem Name="cmdRemove" Header="Remove button" Click="ContextMenuRemoveActionButton_Click"/>
</ContextMenu>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="7"/>
<RowDefinition Height="84"/>
</Grid.RowDefinitions>
<Grid.Resources>
<DataTemplate x:Key="MainTabHeaderTemplate">
<Label Content="{Binding TabHeader}" Name="TabHeaderSelector" PreviewMouseDown="TabHeaderSelector_PreviewMouseDown"/>
</DataTemplate>
<DataTemplate x:Key="MainTabItemTemplate">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="7"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollViewer x:Name="MainScroll" Grid.Row="0" Background="#F7F7F7" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding TabActionButtons}" Margin="8">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" MaxWidth="{Binding ActualWidth, ElementName=MainScroll}" Margin="0,0,-10,0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Margin="0,5,5,0" Padding="5" Content="{Binding ButtonText}" Style="{StaticResource EJButtonStyle}" Click="ActionButton_Click" PreviewMouseDown="ActionButton_PreviewMouseDown">
<Button.ToolTip>
<ToolTip Style="{StaticResource EJToolTipStyle}" Content="{Binding ButtonDescription}" />
</Button.ToolTip>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<GridSplitter Grid.Row="1" Height="5" HorizontalAlignment="Stretch"/>
<TextBox Grid.Row="2" Text="{Binding Path=TabTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" FontFamily="Consolas" Background="{Binding Path=ConsoleBackground}" Foreground="{Binding Path=ConsoleForeground}"/>
<Grid Grid.Row="3" Margin="0,5,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Margin="2,0,5,0" Padding="5" Content="Clear Output" Style="{StaticResource EJButtonStyle}" Click="ClearOutputButton_Click" />
<Button Grid.Column="2" Margin="0,0,5,0" Padding="5" Style="{StaticResource EJButtonStyle}" Click="ScrollToTopButton_Click">
<Image Source="pack://application:,,,/Images/up.png" Margin="-1"/>
</Button>
<Button Grid.Column="3" Margin="0,0,5,0" Padding="5" Style="{StaticResource EJButtonStyle}" Click="ScrollToBottomButton_Click">
<Image Source="pack://application:,,,/Images/down.png" Margin="-1"/>
</Button>
</Grid>
</Grid>
</DataTemplate>
</Grid.Resources>
<Menu Grid.Row="0" Padding="5" FlowDirection="LeftToRight" IsMainMenu="True">
<MenuItem Header="File">
<MenuItem Header="Reload config" Click="ReloadConfigMenuItem_Click">
<MenuItem.Icon>
<Image Source="pack://application:,,,/Images/reload.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Open app folder" Click="OpenAppFolderMenuItem_Click">
<MenuItem.Icon>
<Image Source="pack://application:,,,/Images/folder.png"/>
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem Header="Exit" Click="MenuItemExit_Click"/>
</MenuItem>
<MenuItem Header="Help">
<MenuItem Header="About" Click="MenuAbout_Click" />
</MenuItem>
</Menu>
<TabControl x:Name="MainTab" Grid.Row="1" ItemTemplate="{StaticResource MainTabHeaderTemplate}"
ContentTemplate="{StaticResource MainTabItemTemplate}" Style="{StaticResource EJTabControl}" ItemContainerStyle="{StaticResource EJTabItem}">
</TabControl>
<GridSplitter Grid.Row="2" Height="5" HorizontalAlignment="Stretch"/>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="7"/>
<ColumnDefinition Width="250"/>
</Grid.ColumnDefinitions>
<ListBox Grid.Column="0" x:Name="EventsList" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding}" TextWrapping="Wrap"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch"/>
<ListBox x:Name="TasksList" Grid.Column="2">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="2" Orientation="Horizontal">
<Button Name="TasksListStop" Margin="0" Height="22" Width="22" Click="TasksListStop_Click">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Background="Transparent">
<Image Source="pack://application:,,,/Images/x.png" Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<TextBlock Margin="10 0 2 0" Text="{Binding Path=TaskID, Mode=TwoWay}" HorizontalAlignment="Left" Foreground="Blue"/>
<TextBlock Margin="5 0 2 0" Text="{Binding Path=TaskFile, Mode=TwoWay}" HorizontalAlignment="Left"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Window>