forked from retifrav/hugeCSVsplitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
76 lines (72 loc) · 4.71 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
<Window
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" mc:Ignorable="d" x:Class="hugeCSVsplitter.MainWindow"
Title="Huge CSV splitter | Press F1 for help" Height="340" Width="573" ResizeMode="CanMinimize">
<Grid Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" UseLayoutRounding="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="105"/>
<ColumnDefinition/>
<ColumnDefinition Width="70" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="40" />
<RowDefinition/>
</Grid.RowDefinitions>
<Label Margin="2" Grid.Row="0" Grid.Column="0" Content="CSV file:" HorizontalAlignment="Right"/>
<TextBox Name="sourceCSVpath" Margin="2 2 2 2" Grid.Row="0" Grid.Column="1" TextChanged="sourceCSVpath_TextChanged"
ToolTip="Path to the CSV file for splitting. Double click to set path." VerticalContentAlignment="Center" MouseDoubleClick="sourceCSVpath_MouseDoubleClick"></TextBox>
<Label Margin="2" Grid.Row="1" Grid.Column="0" Content="Output directory:" HorizontalAlignment="Right"/>
<TextBox Margin="2" Name="outputDir" Grid.Row="1" Grid.Column="1" VerticalContentAlignment="Center"
ToolTip="Path to directory, where splitted parts will be saved. Leave this field blank, if you want to put them in the same directory as the source CSV file. Double click to set path." MouseDoubleClick="outputDir_MouseDoubleClick"></TextBox>
<Button Name="btn_spitDat" IsEnabled="False" Grid.Row="0" Grid.RowSpan="2" Grid.Column="2"
Margin="2" Click="btn_spitDat_Click" ToolTip="Split the file">
<Image Source="reses/axe.png">
<Image.Style>
<Style TargetType="Image">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Button>
<Button Name="btn_stopDat" Visibility="Hidden" Grid.Row="0" Grid.RowSpan="2" Grid.Column="2"
Margin="2" Click="btn_stopDat_Click" ToolTip="Stop the splitting">
<Image Source="reses/stop.png"/>
</Button>
<Border Name="bdr_drop" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Margin="2 5 2 2" BorderThickness="3">
<Border.BorderBrush>
<VisualBrush>
<VisualBrush.Visual>
<Rectangle StrokeDashArray="4 1"
Stroke="#AABBCC"
StrokeThickness="4"
RadiusX="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=CornerRadius.TopRight}"
RadiusY="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=CornerRadius.BottomLeft}"
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}"/>
</VisualBrush.Visual>
</VisualBrush>
</Border.BorderBrush>
<TextBlock FontSize="40" TextWrapping="WrapWithOverflow" Name="dragLabel"
TextAlignment="Center" FontFamily="Open Sans" FontWeight="Bold" Foreground="#AABBCC"
HorizontalAlignment="Center" VerticalAlignment="Center">
Drag your enormous<LineBreak/>CSV file<LineBreak/>here
</TextBlock>
</Border>
<Label Grid.Row="3" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
AllowDrop="True" Drop="TextBlock_Drop" DragEnter="TextBlock_DragEnter"
Name="dropArea" DragLeave="dropArea_DragLeave">
</Label>
<ProgressBar Name="pb_splitting" Grid.Row="2" Grid.ColumnSpan="3" Margin="2 7 2 7"
Visibility="Hidden" />
<TextBox Margin="2" Name="txbx_log" Grid.Row="3" Grid.ColumnSpan="3" Visibility="Hidden"
IsReadOnly="True" VerticalScrollBarVisibility="Auto"/>
</Grid>
</Window>