Commit 22e7b5c3 authored by Боев Андрей Олегович's avatar Боев Андрей Олегович
Browse files

add dialog processing

parent e71a19b7
No related merge requests found
Showing with 43 additions and 5 deletions
+43 -5
......@@ -8,19 +8,25 @@
Title="ReadySetPrint" Height="400" Width="640" ResizeMode="NoResize" Icon="/logo.png">
<StackPanel HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal">
<Button Content="Выбрать папку" Width="100" Margin="5"></Button>
<Button Content="Выбрать папку" Width="100" Margin="5" Name="BtnChooseFolder" Click="BtnChooseFolder_Click"></Button>
<TextBlock Text="Путь:" Margin="5" VerticalAlignment="Center" Name="TBPath"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Расположение:" VerticalAlignment="Center" Margin="5"></TextBlock>
<ComboBox Width="100" Margin="5"></ComboBox>
<Button Content="Выбрать цвет" Margin="5" Width="100"></Button>
<TextBlock Text="Цвет краёв:" Margin="5" Name="TBColor" VerticalAlignment="Center"></TextBlock>
<ComboBox Width="100" Margin="5" SelectedIndex="0" Name="CBPosition" SelectionChanged="CBPosition_SelectionChanged">
<ComboBoxItem Content="center"></ComboBoxItem>
<ComboBoxItem Content="top"></ComboBoxItem>
<ComboBoxItem Content="bottom"></ComboBoxItem>
<ComboBoxItem Content="left"></ComboBoxItem>
<ComboBoxItem Content="right"></ComboBoxItem>
</ComboBox>
<Button Content="Выбрать цвет" Margin="5" Width="100" Name="BtnChooseColor" Click="BtnChooseColor_Click"></Button>
<TextBlock Text="Цвет краёв: White" Margin="5" Name="TBColor" VerticalAlignment="Center"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel>
<TextBlock Text="Исходные фото:" Margin="5 5 5 0"></TextBlock>
<ListView Margin="5" Width="300" Height="191">
<ListView Margin="5" Width="300" Height="191" Name="LVOriginalPhotos">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Margin="5"></TextBlock>
......
......@@ -12,6 +12,9 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms;
using System.Drawing;
//using ImageMagick;
namespace ReadySetPrint
{
......@@ -20,9 +23,36 @@ namespace ReadySetPrint
/// </summary>
public partial class MainWindow : Window
{
private System.Drawing.Color _borderColor = System.Drawing.Color.White;
private string _folderPath;
public MainWindow()
{
InitializeComponent();
}
private void BtnChooseFolder_Click(object sender, RoutedEventArgs e)
{
using (var dlg = new FolderBrowserDialog())
{
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
_folderPath = dlg.SelectedPath;
TBPath.Text = "Путь: " + dlg.SelectedPath;
}
}
}
private void BtnChooseColor_Click(object sender, RoutedEventArgs e)
{
using (ColorDialog dlg = new ColorDialog())
{
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
_borderColor = dlg.Color;
TBColor.Text = "Цвет краёв: " + dlg.Color.Name.ToString();
}
}
}
}
}
......@@ -37,6 +37,8 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment