Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37abbd79d5 | |||
| f959cb157c | |||
| 3ef8843b1d | |||
| cb261ce99b | |||
| 13bfc40f9f | |||
| 1acf7d0d87 | |||
| eb0f3adec2 |
@@ -72,13 +72,15 @@ Public Module TreeViewItemHelper
|
||||
Dim treeViewItem As TreeViewItem = VisualUpwardSearch(Of TreeViewItem)(TryCast(e.OriginalSource, DependencyObject))
|
||||
If treeViewItem IsNot Nothing Then
|
||||
treeViewItem.IsSelected = True
|
||||
Dim Tree As TreeView = VisualUpwardSearch(Of TreeView)(TryCast(treeViewItem, DependencyObject))
|
||||
If Not IsNothing(Tree) Then
|
||||
Dim myTransform As GeneralTransform = treeViewItem.TransformToAncestor(Tree)
|
||||
If Not IsNothing(treeViewItem.ContextMenu) Then
|
||||
Dim Tree As TreeView = VisualUpwardSearch(Of TreeView)(TryCast(treeViewItem, DependencyObject))
|
||||
If Not IsNothing(Tree) Then
|
||||
Dim myTransform As GeneralTransform = treeViewItem.TransformToAncestor(Tree)
|
||||
|
||||
Dim myOffset As Point = myTransform.Transform(New Point(0, 0))
|
||||
treeViewItem.ContextMenu.HorizontalOffset = -treeViewItem.ActualWidth + (-myOffset.X) + Tree.ActualWidth - 3
|
||||
treeViewItem.ContextMenu.VerticalOffset = -3
|
||||
Dim myOffset As Point = myTransform.Transform(New Point(0, 0))
|
||||
treeViewItem.ContextMenu.HorizontalOffset = -treeViewItem.ActualWidth + (-myOffset.X) + Tree.ActualWidth - 3
|
||||
treeViewItem.ContextMenu.VerticalOffset = -3
|
||||
End If
|
||||
End If
|
||||
e.Handled = True
|
||||
End If
|
||||
|
||||
@@ -126,4 +126,7 @@ Public Module ConstIni
|
||||
Public Const S_MRUFILES As String = "MruFiles"
|
||||
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
|
||||
|
||||
Public Const S_TEMPLETESEL As String = "TempleteSel"
|
||||
Public Const K_CURRTEMPLETESEL As String = "CurrTempleteSel"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1,171 +1,188 @@
|
||||
<EgtWPFLib5:EgtMainWindow x:Class="EgtColorPickerV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtHexagon="clr-namespace:Icarus"
|
||||
Title="{Binding sTitle}"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="750" Height="450"
|
||||
Style="{StaticResource Dialog_Window}">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding sTitle}"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Style="{StaticResource Dialog_Window}">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl>
|
||||
<TabItem Header="{Binding BasicColor_Msg}">
|
||||
<Grid HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox ItemsSource="{Binding BasicColors}"
|
||||
SelectedItem="{Binding SelColor}"
|
||||
HorizontalAlignment="Center"
|
||||
BorderThickness="0">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="13"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Rectangle Width="20"
|
||||
Height="20"
|
||||
Margin="2"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
Fill="{Binding Fill}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding ColorPicker_Msg}">
|
||||
<TabItem.Resources>
|
||||
<Style TargetType="{x:Type EgtHexagon:EgtHexItem}" BasedOn="{StaticResource EgtHexItem}">
|
||||
<Setter Property="BorderThickness" Value="1.5"/>
|
||||
<Setter Property="BorderBrush" Value="White"/>
|
||||
</Style>
|
||||
</TabItem.Resources>
|
||||
<EgtHexagon:EgtHexList ItemsSource="{Binding HexList}"
|
||||
SelectedItem="{Binding sHexSelColor}"
|
||||
Orientation="Vertical"
|
||||
Margin="2.5"
|
||||
RowCount="13"
|
||||
ColumnCount="13"
|
||||
Height="300"
|
||||
Width="350"
|
||||
Style="{StaticResource EgtHexList}">
|
||||
<EgtHexagon:EgtHexList.ItemTemplate>
|
||||
<DataTemplate/>
|
||||
</EgtHexagon:EgtHexList.ItemTemplate>
|
||||
<EgtHexagon:EgtHexList.ItemContainerStyle>
|
||||
<Style TargetType="EgtHexagon:EgtHexItem" BasedOn="{StaticResource EgtHexItem}">
|
||||
<Setter Property="Grid.Row" Value="{Binding nRow}"/>
|
||||
<Setter Property="Grid.Column" Value="{Binding nColumn}"/>
|
||||
<Setter Property="Background" Value="{Binding Background}"/>
|
||||
</Style>
|
||||
</EgtHexagon:EgtHexList.ItemContainerStyle>
|
||||
</EgtHexagon:EgtHexList>
|
||||
</TabItem>
|
||||
<TabItem Header="{Binding ColorPickerTheme_Msg}">
|
||||
<Grid HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox ItemsSource="{Binding BasicColorsTheme}"
|
||||
SelectedItem="{Binding SelColorTheme}"
|
||||
BorderThickness="0">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="13"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Rectangle Width="20"
|
||||
Height="20"
|
||||
Margin="2"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
Fill="{Binding Fill}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1"
|
||||
Margin="5,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding CustomColor_Msg}"
|
||||
Margin="5,18,5,10"
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding BasicColor_Msg}"
|
||||
Margin="5,0,5,0"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox ItemsSource="{Binding CustomColors}"
|
||||
SelectedItem="{Binding SelCustomColor}"
|
||||
HorizontalAlignment="Center"
|
||||
BorderThickness="0">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="13"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Rectangle Width="20"
|
||||
Height="20"
|
||||
Margin="2"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
Fill="{Binding Fill}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
</ListBox>
|
||||
<ListBox Grid.Row="1"
|
||||
ItemsSource="{Binding BasicColors}"
|
||||
SelectedItem="{Binding SelColor}"
|
||||
HorizontalAlignment="Center">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="8"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Rectangle Width="20"
|
||||
Height="20"
|
||||
Margin="4"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
Fill="{Binding Fill}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding CustomColor_Msg}"
|
||||
Margin="5,0,5,0"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ListBox Grid.Row="3"
|
||||
Margin="5,0,0,0"
|
||||
ItemsSource="{Binding CustomColors}"
|
||||
SelectedItem="{Binding SelCustomColor}"
|
||||
HorizontalAlignment="Center">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="8"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Rectangle Width="20"
|
||||
Height="20"
|
||||
Margin="4"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
Fill="{Binding Fill}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid x:Name="CanvasGrid"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="5,10,5,0">
|
||||
<Canvas x:Name="MyCanvas"
|
||||
MouseDown="ColorRectangle_MouseDown"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Width="260"
|
||||
Height="{Binding ActualHeight, ElementName=CanvasGrid}">
|
||||
<Rectangle Grid.Column="0"
|
||||
Width="{Binding ActualWidth, ElementName=MyCanvas}"
|
||||
Height="{Binding ActualHeight, ElementName=MyCanvas}"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
IsEnabled="True">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0, 0.5" EndPoint="1.6, 0.5" >
|
||||
<GradientStop Color="Red" Offset="0" />
|
||||
<GradientStop Color="Yellow" Offset="0.1" />
|
||||
<GradientStop Color="Lime" Offset="0.2" />
|
||||
<GradientStop Color="Cyan" Offset="0.3" />
|
||||
<GradientStop Color="Blue" Offset="0.4" />
|
||||
<GradientStop Color="Purple" Offset="0.5" />
|
||||
<GradientStop Color="Red" Offset="0.6" />
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Rectangle Grid.Column="0"
|
||||
Width="{Binding ActualWidth, ElementName=MyCanvas}"
|
||||
Height="{Binding ActualHeight, ElementName=MyCanvas}"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
IsEnabled="True">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1" >
|
||||
<GradientStop Color="#00ffffff" Offset="0" />
|
||||
<GradientStop Color="Gray" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Ellipse x:Name="Ellipse"
|
||||
Stroke="Black"
|
||||
StrokeThickness="1"
|
||||
Width="15"
|
||||
Height="15"/>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
<Grid x:Name="CanvasGridL"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Grid.Column="1"
|
||||
Margin="5,10,10,0">
|
||||
<Canvas x:Name="MyCanvasL"
|
||||
MouseMove="Luminosity_MouseMove"
|
||||
MouseDown="Luminosity_MouseDown"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Height="{Binding ActualHeight, ElementName=CanvasGridL}"
|
||||
Width="20">
|
||||
<!--<Rectangle x:Name="LRect"
|
||||
Grid.Column="1"
|
||||
Width="20"
|
||||
Height="{Binding ActualHeight, ElementName=MyCanvasL}"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5"
|
||||
Fill="{Binding Luminosity_Fill}"/>-->
|
||||
<Rectangle Grid.Column="1"
|
||||
Width="20"
|
||||
Height="{Binding ActualHeight, ElementName=MyCanvasL}"
|
||||
Stroke="Black"
|
||||
StrokeThickness="0.5">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1" >
|
||||
<GradientStop Color="White" Offset="0" />
|
||||
<GradientStop x:Name="LightnessColor" Offset="0.5"/>
|
||||
<GradientStop Color="Black" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Path x:Name="Arrow"
|
||||
Grid.Column="1"
|
||||
Data="M0,0 l4,4 l0,2 l-4,-4 l-4,4 l0,-2 z "
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="10"
|
||||
Stroke="Black"
|
||||
Fill="Black"
|
||||
StrokeThickness="1">
|
||||
<!--Data="M13.5,10.697 l-3.497-3.6,-3.497,3.6 L6.494,8.328 l3.503-3.631 l3.48,3.592 L13.494,10.697z"-->
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform Angle="270" />
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,20,0,0">
|
||||
<Grid Grid.Row="1" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -183,15 +200,17 @@
|
||||
Fill="{Binding CurrColor}"/>
|
||||
<Button x:Name="SaveColor"
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
Margin="0,5,0,0"
|
||||
Content="{Binding AddCColor_Msg}"
|
||||
Command="{Binding SaveColor_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -208,7 +227,7 @@
|
||||
Margin="0,10,5,0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding Red, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ColorPicker_TextBox}"/>
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding Green_Msg}"
|
||||
Margin="5,5,5,0"
|
||||
@@ -220,7 +239,7 @@
|
||||
Margin="5,5,5,0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding Green, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ColorPicker_TextBox}"/>
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding Blu_Msg}"
|
||||
Margin="5,5,5,0"
|
||||
@@ -232,18 +251,58 @@
|
||||
Margin="5,5,5,0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding Blue, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ColorPicker_TextBox}"/>
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="H"
|
||||
Margin="0,10,5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBox Grid.Column="3"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,10,5,0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding Hue, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Text="S"
|
||||
Margin="5,5,5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBox Grid.Column="3"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="5,5,5,0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding Saturation, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<TextBlock Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Text="L"
|
||||
Margin="5,5,5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBox Grid.Column="3"
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="5,5,5,0"
|
||||
IsReadOnly="False"
|
||||
Text="{Binding Lightness, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<TextBlock Grid.Row="3"
|
||||
Grid.ColumnSpan="2"
|
||||
Text="{Binding Hexadecimal_Msg}"
|
||||
Margin="5,5,5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
<TextBox Grid.Column="2"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="3"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="5,5,5,0"
|
||||
Text="{Binding Hexadecimal}"
|
||||
Style="{StaticResource ColorPicker_TextBox}"/>
|
||||
Text="{Binding Hexadecimal, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Imports System.Windows.Forms
|
||||
Imports System.Drawing.Configuration
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class EgtColorPickerV
|
||||
|
||||
@@ -19,16 +21,19 @@ Public Class EgtColorPickerV
|
||||
|
||||
Public Property Color As System.Drawing.Color
|
||||
Get
|
||||
Return System.Drawing.Color.FromArgb(255, m_EgtColorPickerVM.Red, m_EgtColorPickerVM.Green, m_EgtColorPickerVM.Blue)
|
||||
Dim RgbColor As Color = HSLColor.HslToRgb(m_EgtColorPickerVM.HSLColor)
|
||||
Return System.Drawing.Color.FromArgb(255, RgbColor.R, RgbColor.G, RgbColor.B)
|
||||
End Get
|
||||
Set(value As System.Drawing.Color)
|
||||
m_EgtColorPickerVM.Red = value.R
|
||||
m_EgtColorPickerVM.Green = value.G
|
||||
m_EgtColorPickerVM.Blue = value.B
|
||||
m_EgtColorPickerVM.SetHSLColor(System.Windows.Media.Color.FromArgb(255, value.R, value.G, value.B))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
Private m_dH As Double = 0
|
||||
Private m_dS As Double = 0
|
||||
Private m_dL As Double = 0.5
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
|
||||
@@ -40,7 +45,7 @@ Public Class EgtColorPickerV
|
||||
m_EgtColorPickerVM = EtgColorPickerVM
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
#End Region
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
@@ -49,10 +54,251 @@ Public Class EgtColorPickerV
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
#End Region ' Events
|
||||
Private Sub EgtColorPickerVM_SetLuminosityFill(color As Color) Handles m_EgtColorPickerVM.m_SetLuminosityFill
|
||||
LightnessColor.Color = color
|
||||
End Sub
|
||||
|
||||
Private Sub EgtColorPickerVM_SetLuminosityFills() Handles m_EgtColorPickerVM.m_UpdateCursorsPos
|
||||
Dim dX As Double = m_EgtColorPickerVM.HSLColor.Hue / 360 * MyCanvas.ActualWidth
|
||||
Dim dY As Double = (1 - m_EgtColorPickerVM.HSLColor.Saturation) * MyCanvas.ActualHeight
|
||||
Dim dYL As Double = (1 - m_EgtColorPickerVM.HSLColor.Lightness) * MyCanvasL.ActualHeight
|
||||
Canvas.SetLeft(Ellipse, dX - (Ellipse.Width / 2))
|
||||
Canvas.SetTop(Ellipse, dY - (Ellipse.Height / 2))
|
||||
Canvas.SetTop(Arrow, dYL)
|
||||
Canvas.SetLeft(Arrow, MyCanvasL.ActualWidth)
|
||||
End Sub
|
||||
|
||||
Private Sub EgtColorPickerV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
||||
EgtColorPickerVM_SetLuminosityFills()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Seleziona il colore all'interno del rettangolo nominato ColorRectangle attraverso un'ellisse
|
||||
''' </summary>
|
||||
Private Sub ColorRectangle_MouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim dX As Double = Mouse.GetPosition(MyCanvas).X
|
||||
Dim dY As Double = Mouse.GetPosition(MyCanvas).Y
|
||||
|
||||
Dim sat As Double = dX / MyCanvas.ActualWidth * 360
|
||||
Dim ton As Double = 1 - dY / MyCanvas.ActualHeight
|
||||
|
||||
m_EgtColorPickerVM.UpdateHue(Math.Round(sat, MidpointRounding.AwayFromZero))
|
||||
m_EgtColorPickerVM.UpdateSaturation(Math.Round(ton, 2))
|
||||
m_EgtColorPickerVM.UpdateLightness(0.5)
|
||||
|
||||
'Dim r, g, b As Integer
|
||||
|
||||
If dX > 0 AndAlso dX < MyCanvas.ActualWidth And dY > 0 AndAlso dY < MyCanvas.ActualHeight Then
|
||||
Canvas.SetTop(Ellipse, dY - (Ellipse.Height / 2))
|
||||
Canvas.SetLeft(Ellipse, dX - (Ellipse.Width / 2))
|
||||
Canvas.SetTop(Arrow, MyCanvas.Height / 2)
|
||||
Canvas.SetLeft(Arrow, MyCanvasL.ActualWidth)
|
||||
End If
|
||||
|
||||
'HlsToRgb(sat, lum, 1 - ton, r, g, b)
|
||||
|
||||
'Dim colargb As System.Drawing.Color = ColorFromHSV(sat, ton, lum)
|
||||
|
||||
'Dim col As Color = Media.Color.FromRgb(colargb.R, colargb.G, colargb.B)
|
||||
'Dim col As Color = Media.Color.FromRgb(r, g, b)
|
||||
'm_EgtColorPickerVM.SetCurrColorFill(col)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Permette il movimento della freccia dall'alto verso il basso
|
||||
''' </summary>
|
||||
Private Sub Luminosity_MouseMove(sender As Object, e As Input.MouseEventArgs)
|
||||
'Dim dX As Double = Mouse.GetPosition(MyCanvasL).X
|
||||
'Dim dY As Double = Mouse.GetPosition(MyCanvasL).Y
|
||||
|
||||
'If dX > 0 AndAlso dX < MyCanvasL.ActualWidth And dY > 0 AndAlso dY < MyCanvasL.ActualHeight Then
|
||||
' Arrow.Visibility = Visibility.Visible
|
||||
' Canvas.SetTop(Arrow, dY)
|
||||
' Canvas.SetLeft(Arrow, MyCanvasL.ActualWidth)
|
||||
'Else
|
||||
' Arrow.Visibility = Visibility.Collapsed
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Modifica la luminosità del colore selezionato
|
||||
''' </summary>
|
||||
Private Sub Luminosity_MouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
|
||||
Arrow.Visibility = Visibility.Visible
|
||||
Dim dYPos As Double = Mouse.GetPosition(MyCanvasL).Y
|
||||
Canvas.SetTop(Arrow, dYPos)
|
||||
|
||||
Dim dX As Double = Canvas.GetLeft(Ellipse)
|
||||
Dim dY As Double = Canvas.GetTop(Ellipse)
|
||||
Dim dL As Double = Mouse.GetPosition(MyCanvasL).Y
|
||||
|
||||
Dim sat As Double = dX / MyCanvas.ActualWidth * 360
|
||||
Dim ton As Double = dY / MyCanvas.ActualHeight
|
||||
Dim lum As Double = dL / MyCanvasL.ActualHeight
|
||||
|
||||
m_EgtColorPickerVM.UpdateLightness(1 - Math.Round(lum, 2))
|
||||
|
||||
Dim r, g, b As Integer
|
||||
|
||||
HslToRgb(m_dH, m_dS, 1 - m_dL, r, g, b)
|
||||
' HslToRgb(sat, 1 - ton, 1 - lum, r, g, b)
|
||||
' HlsToRgb(sat, 1 - lum, 1 - ton, r, g, b)
|
||||
|
||||
'Dim col As Color = Media.Color.FromRgb(r, g, b)
|
||||
'm_EgtColorPickerVM.SetCurrColorFill(col)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Shared Function HslToRgb(ByVal h As Double, ByVal s As Double, ByVal l As Double, ByRef r As Integer, ByRef g As Integer, ByRef b As Integer) As Color
|
||||
Dim dConversionH As Double = Math.Round(h, MidpointRounding.AwayFromZero)
|
||||
Dim dConversionS As Double = Math.Round(s, 2)
|
||||
Dim dConversionL As Double = Math.Round(l, 2)
|
||||
Dim C As Double = (1 - Math.Abs(2 * dConversionL - 1)) * dConversionS
|
||||
Dim X = C * (1 - Math.Abs((dConversionH / 60) Mod 2 - 1))
|
||||
Dim m = dConversionL - C / 2
|
||||
Dim dRPrimo As Double
|
||||
Dim dGPrimo As Double
|
||||
Dim dBPrimo As Double
|
||||
|
||||
If dConversionH >= 0 Then
|
||||
If dConversionH < 60 Then
|
||||
dRPrimo = C
|
||||
dGPrimo = X
|
||||
dBPrimo = 0
|
||||
ElseIf dConversionH < 120 Then
|
||||
dRPrimo = X
|
||||
dGPrimo = C
|
||||
dBPrimo = 0
|
||||
ElseIf dConversionH < 180 Then
|
||||
dRPrimo = 0
|
||||
dGPrimo = C
|
||||
dBPrimo = X
|
||||
ElseIf dConversionH < 240 Then
|
||||
dRPrimo = 0
|
||||
dGPrimo = X
|
||||
dBPrimo = C
|
||||
ElseIf dConversionH < 300 Then
|
||||
dRPrimo = X
|
||||
dGPrimo = 0
|
||||
dBPrimo = C
|
||||
ElseIf dConversionH < 360 Then
|
||||
dRPrimo = C
|
||||
dGPrimo = 0
|
||||
dBPrimo = X
|
||||
End If
|
||||
End If
|
||||
|
||||
r = (dRPrimo + m) * 255
|
||||
g = (dGPrimo + m) * 255
|
||||
b = (dBPrimo + m) * 255
|
||||
End Function
|
||||
|
||||
Friend Shared Function RgbToHsl(ByVal r As Integer, ByVal g As Integer, ByVal b As Integer, ByRef h As Double, ByRef s As Double, ByRef l As Double) As Color
|
||||
Dim dRPrimo As Double = r / 255
|
||||
Dim dGPrimo As Double = g / 255
|
||||
Dim dBPrimo As Double = b / 255
|
||||
Dim CMax As Double = Math.Max(Math.Max(dRPrimo, dGPrimo), dBPrimo)
|
||||
Dim CMin As Double = Math.Min(Math.Min(dRPrimo, dGPrimo), dBPrimo)
|
||||
Dim Delta As Double = CMax - CMin
|
||||
If Delta = 0 Then
|
||||
h = 0
|
||||
ElseIf CMax = dRPrimo Then
|
||||
h = 60 * (((dGPrimo - dBPrimo) / Delta) Mod 6)
|
||||
ElseIf CMax = dGPrimo Then
|
||||
h = 60 * (((dBPrimo - dRPrimo) / Delta) + 2)
|
||||
ElseIf CMax = dBPrimo Then
|
||||
h = 60 * (((dRPrimo - dRPrimo) / Delta) + 4)
|
||||
End If
|
||||
|
||||
l = (CMax + CMin) / 2
|
||||
|
||||
If Delta = 0 Then
|
||||
s = 0
|
||||
Else
|
||||
s = Delta / (1 - Math.Abs(2 * l - 1))
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'''' <summary>
|
||||
'''' Converte il colore selezionato da HLS ( tonalità, luminosità, saturazione) in RGB
|
||||
'''' </summary>
|
||||
'''' <param name="h">Tonalità del colore selezionato espressa in double</param>
|
||||
'''' <param name="l">Luminosità del colore selezionato espressa in double</param>
|
||||
'''' <param name="s">Saturazione del colore selezionato espressa in double</param>
|
||||
'''' <param name="r">Colore Rosso restituito dalla funzione espresso in intero</param>
|
||||
'''' <param name="g">Colore Verde restituito dalla funzione espresso in intero</param>
|
||||
'''' <param name="b">Colore Blu restituito dalla funzione espresso in intero</param>
|
||||
'Private Shared Sub HlsToRgb(ByVal h As Double, ByVal l As Double, ByVal s As Double, <Out> ByRef r As Integer, <Out> ByRef g As Integer, <Out> ByRef b As Integer)
|
||||
' Dim p2 As Double
|
||||
|
||||
' If l <= 0.5 Then
|
||||
' p2 = l * (1 + s)
|
||||
' Else
|
||||
' p2 = l + s - l * s
|
||||
' End If
|
||||
|
||||
' Dim p1 As Double = 2 * l - p2
|
||||
' Dim double_r, double_g, double_b As Double
|
||||
|
||||
' If s = 0 Then
|
||||
' double_r = l
|
||||
' double_g = l
|
||||
' double_b = l
|
||||
' Else
|
||||
' double_r = QqhToRgb(p1, p2, h + 120)
|
||||
' double_g = QqhToRgb(p1, p2, h)
|
||||
' double_b = QqhToRgb(p1, p2, h - 120)
|
||||
' End If
|
||||
|
||||
' r = CInt((double_r * 255.0))
|
||||
' g = CInt((double_g * 255.0))
|
||||
' b = CInt((double_b * 255.0))
|
||||
'End Sub
|
||||
|
||||
'Private Shared Function QqhToRgb(ByVal q1 As Double, ByVal q2 As Double, ByVal hue As Double) As Double
|
||||
' If hue > 360 Then
|
||||
' hue -= 360
|
||||
' ElseIf hue < 0 Then
|
||||
' hue += 360
|
||||
' End If
|
||||
|
||||
' If hue < 60 Then Return q1 + (q2 - q1) * hue / 60
|
||||
' If hue < 180 Then Return q2
|
||||
' If hue < 240 Then Return q1 + (q2 - q1) * (240 - hue) / 60
|
||||
' Return q1
|
||||
'End Function
|
||||
|
||||
Public Shared Function ColorFromHSV(ByVal hue As Double, ByVal saturation As Double, ByVal value As Double) As System.Drawing.Color
|
||||
Dim hi As Integer = Convert.ToInt32(Math.Floor(hue / 60)) Mod 6
|
||||
Dim f As Double = hue / 60 - Math.Floor(hue / 60)
|
||||
value *= 255
|
||||
Dim v As Integer = Convert.ToInt32(value)
|
||||
Dim p As Integer = Convert.ToInt32(value * (1 - saturation))
|
||||
Dim q As Integer = Convert.ToInt32(value * (1 - f * saturation))
|
||||
Dim t As Integer = Convert.ToInt32(value * (1 - (1 - f) * saturation))
|
||||
|
||||
If hi = 0 Then
|
||||
Return System.Drawing.Color.FromArgb(255, v, t, p)
|
||||
ElseIf hi = 1 Then
|
||||
Return System.Drawing.Color.FromArgb(255, q, v, p)
|
||||
ElseIf hi = 2 Then
|
||||
Return System.Drawing.Color.FromArgb(255, p, v, t)
|
||||
ElseIf hi = 3 Then
|
||||
Return System.Drawing.Color.FromArgb(255, p, q, v)
|
||||
ElseIf hi = 4 Then
|
||||
Return System.Drawing.Color.FromArgb(255, t, p, v)
|
||||
Else
|
||||
Return System.Drawing.Color.FromArgb(255, v, p, q)
|
||||
End If
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Apre una finestra EgtColorPicker
|
||||
''' </summary>
|
||||
@@ -62,6 +308,6 @@ Public Class EgtColorPickerV
|
||||
Return Me.DialogResult
|
||||
End Function
|
||||
|
||||
#End Region ' Methods
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,373 +0,0 @@
|
||||
Imports System.Globalization
|
||||
|
||||
Public Class EgtHexagon
|
||||
Inherits Panel
|
||||
|
||||
#Region "ORIENTATION"
|
||||
|
||||
Public Shared ReadOnly OrientationProperty As DependencyProperty = DependencyProperty.RegisterAttached("Orientation",
|
||||
GetType(Orientation),
|
||||
GetType(EgtHexagon),
|
||||
New FrameworkPropertyMetadata(Orientation.Horizontal, FrameworkPropertyMetadataOptions.AffectsMeasure Or FrameworkPropertyMetadataOptions.AffectsArrange Or FrameworkPropertyMetadataOptions.[Inherits]))
|
||||
|
||||
Public Shared Sub SetOrientation(element As DependencyObject, value As Orientation)
|
||||
element.SetValue(OrientationProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetOrientation(element As DependencyObject) As Orientation
|
||||
Return CType(element.GetValue(OrientationProperty), Orientation)
|
||||
End Function
|
||||
|
||||
Public Property Orientation As Orientation
|
||||
Get
|
||||
Return CType(GetValue(OrientationProperty), Orientation)
|
||||
End Get
|
||||
Set(value As Orientation)
|
||||
SetValue(OrientationProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Orientation
|
||||
|
||||
#Region "ROW"
|
||||
|
||||
Public Shared ReadOnly RowCountProperty As DependencyProperty = DependencyProperty.Register("RowCount", GetType(Integer),
|
||||
GetType(EgtHexagon),
|
||||
New FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.AffectsMeasure Or FrameworkPropertyMetadataOptions.AffectsArrange), AddressOf ValidateCountCallback)
|
||||
|
||||
Public Property RowCount As Integer
|
||||
Get
|
||||
Return CInt(GetValue(RowCountProperty))
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
SetValue(RowCountProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Row
|
||||
|
||||
#Region "COLUMN"
|
||||
|
||||
Public Shared ReadOnly ColumnCountProperty As DependencyProperty = DependencyProperty.Register("ColumnCount",
|
||||
GetType(Integer),
|
||||
GetType(EgtHexagon),
|
||||
New FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.AffectsMeasure Or FrameworkPropertyMetadataOptions.AffectsArrange), AddressOf ValidateCountCallback)
|
||||
|
||||
Public Property ColumnCount As Integer
|
||||
Get
|
||||
Return CInt(GetValue(ColumnCountProperty))
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
SetValue(ColumnCountProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region 'Column
|
||||
|
||||
#Region "VALIDATE"
|
||||
|
||||
Private Shared Function ValidateCountCallback(value As Object) As Boolean
|
||||
If TypeOf value Is Integer Then
|
||||
Dim count As Integer = CInt(value)
|
||||
Return count > 0
|
||||
End If
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function GetRow(e As UIElement) As Integer
|
||||
Dim row As Integer = CInt(e.GetValue(Grid.RowProperty))
|
||||
If row >= RowCount Then row = RowCount - 1
|
||||
Return row
|
||||
End Function
|
||||
|
||||
Private Function GetColumn(e As UIElement) As Integer
|
||||
Dim column As Integer = CInt(e.GetValue(Grid.ColumnProperty))
|
||||
If column >= ColumnCount Then column = ColumnCount - 1
|
||||
Return column
|
||||
End Function
|
||||
|
||||
Protected Overrides Function MeasureOverride(ByVal availableSize As Size) As Size
|
||||
Dim w As Double = availableSize.Width
|
||||
Dim h As Double = availableSize.Height
|
||||
|
||||
If Double.IsInfinity(w) OrElse Double.IsInfinity(h) Then
|
||||
h = 0
|
||||
w = 0
|
||||
|
||||
For Each e As UIElement In InternalChildren
|
||||
e.Measure(availableSize)
|
||||
Dim s = e.DesiredSize
|
||||
If s.Height > h Then h = s.Height
|
||||
If s.Width > w Then w = s.Width
|
||||
Next
|
||||
|
||||
If Orientation = Orientation.Horizontal Then Return New Size(w * (ColumnCount * 3 + 1) / 4, h * (RowCount * 2 + 1) / 2)
|
||||
Return New Size(w * (ColumnCount * 2 + 1) / 2, h * (RowCount * 3 + 1) / 4)
|
||||
End If
|
||||
|
||||
Return availableSize
|
||||
End Function
|
||||
|
||||
#End Region ' Validate
|
||||
|
||||
#Region "HASSHIFT"
|
||||
|
||||
Private Sub HasShift(first As Boolean, last As Boolean)
|
||||
If Orientation = Orientation.Horizontal Then
|
||||
HasRowShift(first, last)
|
||||
Else
|
||||
HasColumnShift(first, last)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub HasRowShift(firstRow As Boolean, lastRow As Boolean)
|
||||
lastRow = True
|
||||
firstRow = lastRow
|
||||
Dim elements As UIElementCollection = MyBase.InternalChildren
|
||||
Dim i As Integer = 0
|
||||
|
||||
While i < elements.Count AndAlso (firstRow OrElse lastRow)
|
||||
Dim e = elements(i)
|
||||
If e.Visibility = Visibility.Collapsed Then Continue While
|
||||
Dim row As Integer = GetRow(e)
|
||||
Dim column As Integer = GetColumn(e)
|
||||
Dim modify As Integer = column Mod 2
|
||||
If row = 0 AndAlso modify = 0 Then firstRow = False
|
||||
If row = RowCount - 1 AndAlso modify = 1 Then lastRow = False
|
||||
i += 1
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub HasColumnShift(firstColumn As Boolean, lastColumn As Boolean)
|
||||
lastColumn = True
|
||||
firstColumn = lastColumn
|
||||
Dim elements As UIElementCollection = MyBase.InternalChildren
|
||||
Dim i As Integer = 0
|
||||
|
||||
While i < elements.Count AndAlso (firstColumn OrElse lastColumn)
|
||||
Dim e = elements(i)
|
||||
If e.Visibility = Visibility.Collapsed Then Continue While
|
||||
Dim row As Integer = GetRow(e)
|
||||
Dim column As Integer = GetColumn(e)
|
||||
Dim modify As Integer = row Mod 2
|
||||
If column = 0 AndAlso modify = 0 Then firstColumn = False
|
||||
If column = ColumnCount - 1 AndAlso modify = 1 Then lastColumn = False
|
||||
i += 1
|
||||
End While
|
||||
End Sub
|
||||
|
||||
#End Region ' HasShift
|
||||
|
||||
#Region "GETHEXSIZE"
|
||||
|
||||
Private Function GetHexSize(gridSize As Size) As Size
|
||||
Dim minH As Double = 0
|
||||
Dim minW As Double = 0
|
||||
|
||||
For Each e As UIElement In InternalChildren
|
||||
Dim f = TryCast(e, FrameworkElement)
|
||||
|
||||
If f IsNot Nothing Then
|
||||
If f.MinHeight > minH Then minH = f.MinHeight
|
||||
If f.MinWidth > minW Then minW = f.MinWidth
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim first, last As Boolean
|
||||
HasShift(first, last)
|
||||
Dim possibleSize = GetPossibleSize(gridSize)
|
||||
Dim possibleW As Double = possibleSize.Width
|
||||
Dim possibleH As Double = possibleSize.Height
|
||||
Dim w = Math.Max(minW, possibleW)
|
||||
Dim h = Math.Max(minH, possibleH)
|
||||
|
||||
Return New Size(w, h)
|
||||
End Function
|
||||
|
||||
Private Function GetPossibleSize(gridSize As Size) As Size
|
||||
Dim first, last As Boolean
|
||||
HasShift(first, last)
|
||||
If Orientation = Orientation.Horizontal Then Return GetPossibleSizeHorizontal(gridSize, first, last)
|
||||
Return GetPossibleSizeVertical(gridSize, first, last)
|
||||
End Function
|
||||
|
||||
Private Function GetPossibleSizeVertical(gridSize As Size, first As Boolean, last As Boolean) As Size
|
||||
Dim columns As Integer = ((If(first, 0, 1)) + 2 * ColumnCount - (If(last, 1, 0)))
|
||||
Dim w As Double = 2 * (gridSize.Width / columns)
|
||||
Dim rows As Integer = 1 + 3 * RowCount
|
||||
Dim h As Double = 4 * (gridSize.Height / rows)
|
||||
Return New Size(w, h)
|
||||
End Function
|
||||
|
||||
Private Function GetPossibleSizeHorizontal(gridSize As Size, first As Boolean, last As Boolean) As Size
|
||||
Dim columns As Integer = 1 + 3 * ColumnCount
|
||||
Dim w As Double = 4 * (gridSize.Width / columns)
|
||||
Dim rows As Integer = (If(first, 0, 1)) + 2 * RowCount - (If(last, 1, 0))
|
||||
Dim h As Double = 2 * (gridSize.Height / rows)
|
||||
Return New Size(w, h)
|
||||
End Function
|
||||
|
||||
#End Region ' GetHexSize
|
||||
|
||||
#Region "ARRANGE"
|
||||
|
||||
Protected Overrides Function ArrangeOverride(finalSize As Size) As Size
|
||||
Dim first, last As Boolean
|
||||
HasShift(first, last)
|
||||
Dim hexSize As Size = GetHexSize(finalSize)
|
||||
Dim columnWidth, rowHeight As Double
|
||||
|
||||
If Orientation = Orientation.Horizontal Then
|
||||
rowHeight = 0.5 * hexSize.Height
|
||||
columnWidth = 0.25 * hexSize.Width
|
||||
Else
|
||||
rowHeight = 0.25 * hexSize.Height
|
||||
columnWidth = 0.5 * hexSize.Width
|
||||
End If
|
||||
|
||||
Dim elements As UIElementCollection = MyBase.InternalChildren
|
||||
|
||||
For i As Integer = 0 To elements.Count - 1
|
||||
If elements(i).Visibility = Visibility.Collapsed Then Continue For
|
||||
ArrangeElement(elements(i), hexSize, columnWidth, rowHeight, first)
|
||||
Next
|
||||
|
||||
Return finalSize
|
||||
End Function
|
||||
|
||||
Private Sub ArrangeElement(e As UIElement, hexSize As Size, columnWidth As Double, rowHeight As Double, shift As Boolean)
|
||||
Dim row As Integer = GetRow(e)
|
||||
Dim column As Integer = GetColumn(e)
|
||||
Dim x As Double
|
||||
Dim y As Double
|
||||
|
||||
If Orientation = Orientation.Horizontal Then
|
||||
x = 3 * columnWidth * column
|
||||
y = rowHeight * (2 * row + (If(column Mod 2 = 1, 1, 0)) + (If(shift, -1, 0)))
|
||||
Else
|
||||
x = columnWidth * (2 * column + (If(row Mod 2 = 1, 1, 0)) + (If(shift, -1, 0)))
|
||||
y = 3 * rowHeight * row
|
||||
End If
|
||||
|
||||
e.Arrange(New Rect(x, y, hexSize.Width, hexSize.Height))
|
||||
End Sub
|
||||
|
||||
#End Region ' Arrange
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtHexList
|
||||
Inherits ListBox
|
||||
|
||||
Shared Sub New()
|
||||
DefaultStyleKeyProperty.OverrideMetadata(GetType(EgtHexList),
|
||||
New FrameworkPropertyMetadata(GetType(EgtHexList)))
|
||||
End Sub
|
||||
|
||||
Public Shared ReadOnly OrientationProperty As DependencyProperty = EgtHexagon.OrientationProperty.AddOwner(GetType(EgtHexList))
|
||||
Public Shared ReadOnly RowCountProperty As DependencyProperty = EgtHexagon.RowCountProperty.AddOwner(GetType(EgtHexList))
|
||||
Public Shared ReadOnly ColumnCountProperty As DependencyProperty = EgtHexagon.ColumnCountProperty.AddOwner(GetType(EgtHexList))
|
||||
|
||||
Public Property Orientation As Orientation
|
||||
Get
|
||||
Return CType(GetValue(OrientationProperty), Orientation)
|
||||
End Get
|
||||
Set(value As Orientation)
|
||||
SetValue(OrientationProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property RowCount As Integer
|
||||
Get
|
||||
Return CInt(GetValue(RowCountProperty))
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
SetValue(RowCountProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ColumnCount As Integer
|
||||
Get
|
||||
Return CInt(GetValue(ColumnCountProperty))
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
SetValue(ColumnCountProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Overrides Function IsItemItsOwnContainerOverride(item As Object) As Boolean
|
||||
Return (TypeOf item Is EgtHexItem)
|
||||
End Function
|
||||
|
||||
Protected Overrides Function GetContainerForItemOverride() As DependencyObject
|
||||
Return New EgtHexItem()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtHexItem
|
||||
Inherits ListBoxItem
|
||||
|
||||
Shared Sub New()
|
||||
DefaultStyleKeyProperty.OverrideMetadata(GetType(EgtHexItem),
|
||||
New FrameworkPropertyMetadata(GetType(EgtHexItem)))
|
||||
End Sub
|
||||
|
||||
Public Shared ReadOnly OrientationProperty As DependencyProperty = EgtHexagon.OrientationProperty.AddOwner(GetType(EgtHexItem))
|
||||
|
||||
Public Property Orientation As Orientation
|
||||
Get
|
||||
Return CType(GetValue(OrientationProperty), Orientation)
|
||||
End Get
|
||||
Set(value As Orientation)
|
||||
SetValue(OrientationProperty, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
|
||||
Public Class HexClipConverter
|
||||
Implements IMultiValueConverter
|
||||
|
||||
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
|
||||
Dim width As Double = CDbl(values(0))
|
||||
Dim height As Double = CDbl(values(1))
|
||||
Dim orientation As Orientation = CType(values(2), Orientation)
|
||||
|
||||
If width <= 0 OrElse height <= 0 Then Return Nothing
|
||||
|
||||
Dim pathGeometry As New PathGeometry With {
|
||||
.Figures = New PathFigureCollection()
|
||||
}
|
||||
|
||||
Dim pathFigure As New PathFigure()
|
||||
|
||||
If orientation = Orientation.Horizontal Then
|
||||
pathFigure.StartPoint = New Point(0, height * 0.5)
|
||||
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width * 0.25, 0)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width * 0.75, 0)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width, height * 0.5)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width * 0.75, height)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width * 0.25, height)})
|
||||
Else
|
||||
pathFigure.StartPoint = New Point(width * 0.5, 0)
|
||||
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width, height * 0.25)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width, height * 0.75)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(width * 0.5, height)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(0, height * 0.75)})
|
||||
pathFigure.Segments.Add(New LineSegment() With {.Point = New Point(0, height * 0.25)})
|
||||
End If
|
||||
|
||||
pathGeometry.Figures.Add(pathFigure)
|
||||
|
||||
Return pathGeometry
|
||||
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
|
||||
Throw New NotImplementedException()
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,325 +1,328 @@
|
||||
<EgtWPFLib5:EgtMainWindow x:Class="EgtManageFileDialogV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
Title="{Binding sTitle}"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Style="{StaticResource Dialog_Window}">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
Title="{Binding sTitle}"
|
||||
Height="500"
|
||||
Width="800"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Style="{StaticResource Dialog_Window}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Command="{Binding GoBack_Command}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="2.5,0,0,0"
|
||||
Margin="2.5,0,5,0"
|
||||
BorderBrush="Transparent"
|
||||
Style="{StaticResource RightPanel_Button}">
|
||||
<Image Source="\Resources\EgtDialog\Restore.png"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Column="1"
|
||||
Margin="5"
|
||||
Text="{Binding sUrl_Msg, Mode=TwoWay}"
|
||||
Text="{Binding sSelPath}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ComboBox Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding VisualizationList}"
|
||||
SelectedItem="{Binding SelVisualization}"
|
||||
ItemsSource="{Binding ViewModeList}"
|
||||
SelectedItem="{Binding SelViewMode}"
|
||||
Width="200"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>
|
||||
Height="30"
|
||||
Margin="2.5,5,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1"
|
||||
Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TreeView x:Name="FileTree"
|
||||
ItemsSource="{Binding RootList}"
|
||||
Height="300"
|
||||
Width="200"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center">
|
||||
FontSize="15"
|
||||
BorderBrush="White"
|
||||
Foreground="{StaticResource Icarus_Gray}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:EgtFolder}"
|
||||
ItemsSource="{Binding FolderList}">
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
ItemsSource="{Binding TreeItemList_View}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<DataTemplate DataType="{x:Type local:EgtItem}">
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<TabControl Grid.Column="1"
|
||||
Background="Transparent"
|
||||
BorderBrush="White"
|
||||
BorderThickness="0"
|
||||
Background="White"
|
||||
SelectedIndex="{Binding nSelectView}">
|
||||
<TabItem Visibility="{Binding ListBox_Visibility}">
|
||||
<Grid Grid.Column="1"
|
||||
Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Name_Msg}"
|
||||
Visibility="{Binding UVision_Visibility}"
|
||||
Margin="5,5,5,5"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<ListBox x:Name="FileList"
|
||||
Grid.Row="1"
|
||||
Width="350"
|
||||
Height="250"
|
||||
Margin="5,5,5,5"
|
||||
BorderBrush="White"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelTreeItem.ItemSelected}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate x:Key="ScheduleTemplate"
|
||||
DataType="{x:Type local:EgtDirectory}" >
|
||||
<Grid Margin="5,5,5,0">
|
||||
SelectedIndex="{Binding nSelTab}">
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</TabControl.ItemContainerStyle>
|
||||
<TabItem Header="LISTBOX">
|
||||
<ListBox x:Name="FileList"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
BorderBrush="White"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding ItemSelected, Mode=TwoWay}">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate x:Key="ListTemplateView"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0"
|
||||
Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="TilesTemplateView"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0"
|
||||
Height="50"
|
||||
Width="250">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="3"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sName}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding ghTypeItem}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sDimension}"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="ContentTemplateView"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0"
|
||||
Height="50">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding ghTypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="2"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sLastModifyDate}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sDimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
<Border Grid.Row="1"
|
||||
BorderThickness="1"
|
||||
BorderBrush="LightGray"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type local:EgtDirectory}">
|
||||
<ContentControl Content="{Binding}">
|
||||
<ContentControl.Style>
|
||||
<Style TargetType="{x:Type ContentControl}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="0">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ListTemplateView}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="1">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource TilesTemplateView}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="2">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ContentTemplateView}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ContentControl.Style>
|
||||
</ContentControl>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_MouseDoubleClick"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.Style>
|
||||
<Style TargetType="{x:Type ListBox}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"
|
||||
Value="0">
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"
|
||||
Value="1">
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"
|
||||
Value="2">
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ListBox.Style>
|
||||
</ListBox>
|
||||
</TabItem>
|
||||
<TabItem Header="DATAGRID">
|
||||
<DataGrid AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
Margin="5,5,5,10"
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding ItemSelected}"
|
||||
ColumnHeaderStyle="{StaticResource EgtManageFile_DataGridColumnHeader}">
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTemplateColumn Width="SizeToCells">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="15"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="BoxingTemplate"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="65"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="3"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
<DataGridTemplateColumn Width="5*">
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Name_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Margin="2.5,0,2.5,0"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sTypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding sDimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="ContentTemplateView"
|
||||
DataType="{x:Type local:EgtDirectory}">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding sIconSource}"
|
||||
Height="60"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sName}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sTypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="2"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding dLastModifyDate}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding sDimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type local:EgtDirectory}">
|
||||
<ContentControl Content="{Binding}">
|
||||
<ContentControl.Style>
|
||||
<Style TargetType="{x:Type ContentControl}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DataContext.nTaskStatus, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="0">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ScheduleTemplate}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nTaskStatus, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="1">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource BoxingTemplate}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DataContext.nTaskStatus, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="2">
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ContentTemplateView}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ContentControl.Style>
|
||||
</ContentControl>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate >
|
||||
<TextBlock Text="{Binding Name}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>-->
|
||||
|
||||
<!--<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="/Resources/ProjectManager/New.png"
|
||||
Height="65"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="3"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding Name}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding TypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
Text="{Binding Dimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>-->
|
||||
|
||||
<!--<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="/Resources/ProjectManager/New.png"
|
||||
Height="60"
|
||||
Style="{StaticResource Button_Image}"/>
|
||||
<UniformGrid Grid.Column="1"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding Name}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding TypeItem}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Column="2"
|
||||
Rows="2"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding LastModifyDate}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock TextAlignment="Left"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding Dimension}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>-->
|
||||
<!--</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
</ListBox>
|
||||
<UniformGrid Visibility="{Binding UVision_Visibility}"
|
||||
Grid.Column="1"
|
||||
Columns="3"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding LastModify_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding Type_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding Dimension_Msg}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Visibility="{Binding UVision_Visibility}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Columns="3"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding SelectedItem.dLastModifyDate, ElementName=FileList}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding SelectedItem.sTypeItem, ElementName=FileList}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<TextBlock Grid.Column="3"
|
||||
Grid.Row="1"
|
||||
Margin="5,5,5,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding SelectedItem.sDimension, ElementName=FileList}"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Visibility="{Binding DataGrid_Visibility}">
|
||||
<DataGrid AutoGenerateColumns="False"
|
||||
Height="300"
|
||||
Margin="5,5,5,10"
|
||||
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
|
||||
SelectedItem="{Binding SelTreeItem.ItemSelected}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding sName}">
|
||||
VerticalAlignment="Center"
|
||||
Margin="2.5,0,0,0"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<!--<DataGridTemplateColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12,6,12,6"/>
|
||||
</Style>
|
||||
</DataGridTemplateColumn.ElementStyle>-->
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Binding="{Binding sLastModifyDate}"
|
||||
Width="2*">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Name_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<TextBlock Text="{Binding DataContext.LastModify_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
@@ -331,25 +334,12 @@
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding dLastModifyDate}">
|
||||
<DataGridTextColumn Binding="{Binding ghTypeItem}"
|
||||
Width="1*">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.LastModify_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12,6,12,6"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding sTypeItem}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Type_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<TextBlock Text="{Binding DataContext.Type_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
@@ -361,10 +351,12 @@
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding sDimension}">
|
||||
<DataGridTextColumn Binding="{Binding sDimension}"
|
||||
Width="1*">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Dimension_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<TextBlock Text="{Binding DataContext.Dimension_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
@@ -378,73 +370,57 @@
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow"
|
||||
BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
</Style>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}"/>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding DataContext.DoubleClick_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"/>
|
||||
</DataGrid.InputBindings>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="5,5,5,5"
|
||||
Text="{Binding FileName_Msg}"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource DialogWindow_TextBlock}"/>
|
||||
<!--<ComboBox Grid.Column="1"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
IsEditable="True"
|
||||
ItemsSource="{Binding ListItemView}"
|
||||
SelectedItem="{Binding SelListItemView}"
|
||||
Width="400"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>-->
|
||||
<TextBox Grid.Column="1"
|
||||
Margin="2.5,2.5,2.5,5"
|
||||
Width="350"
|
||||
Height="30"
|
||||
TextAlignment="Left"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{Binding sSaveFileName}"
|
||||
Style="{StaticResource ParameterList_TextBox}"/>
|
||||
<ComboBox Grid.Column="2"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
ItemsSource="{Binding ListFilter}"
|
||||
SelectedItem="{Binding SelExstension}"
|
||||
ItemsSource="{Binding FilterList}"
|
||||
SelectedItem="{Binding SelFilter}"
|
||||
DisplayMemberPath="sNameExstension"
|
||||
HorizontalAlignment="Right"
|
||||
Width="200"
|
||||
Margin="2.5,0,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}">
|
||||
</ComboBox>
|
||||
<UniformGrid Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Rows="1"
|
||||
Margin="2.5,0,2.5,5">
|
||||
<Button IsDefault="True"
|
||||
Content="OK"
|
||||
Command="{Binding Ok_Command}"
|
||||
Margin="15,0,2.5,0"
|
||||
Style="{StaticResource RightPanel_HalfRound_Button}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="2.5,0,0,0"
|
||||
Style="{StaticResource RightPanel_HalfRound_Button}"/>
|
||||
</UniformGrid>
|
||||
Height="30"
|
||||
Margin="10,2.5,2.5,5"
|
||||
Style="{StaticResource RightPanel_ComboBox}"/>
|
||||
</Grid>
|
||||
<UniformGrid Grid.Row="3"
|
||||
Rows="1"
|
||||
Margin="2.5,0,2.5,0">
|
||||
<Button IsDefault="True"
|
||||
Content="OK"
|
||||
Command="{Binding Ok_Command}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="15,0,2.5,0"
|
||||
Style="{StaticResource RightPanel_HalfRound_Button}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="2.5,0,0,0"
|
||||
Style="{StaticResource RightPanel_HalfRound_Button}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtMainWindow>
|
||||
|
||||
@@ -8,6 +8,9 @@ Public Class EgtManageFileDialogV
|
||||
|
||||
Private Shadows DialogResult As DialogResult
|
||||
|
||||
''' <summary>
|
||||
''' Stringa che specifica il titolo da mostrare
|
||||
''' </summary>
|
||||
Public Overloads Property Title As String
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.sTitle
|
||||
@@ -53,6 +56,15 @@ Public Class EgtManageFileDialogV
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Mode As Integer
|
||||
Get
|
||||
Return m_EgtManageFileDialogVM.nMode
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_EgtManageFileDialogVM.nMode = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONTRUCTORS"
|
||||
@@ -83,6 +95,10 @@ Public Class EgtManageFileDialogV
|
||||
Return Me.DialogResult
|
||||
End Function
|
||||
|
||||
Private Sub ListBoxItem_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
|
||||
m_EgtManageFileDialogVM.MouseDoubleClick()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@ Public Class EgtMessageBoxVM
|
||||
End Property
|
||||
|
||||
Private m_Button As MessageBoxButton
|
||||
|
||||
Private m_Icon As MessageBoxImage
|
||||
Public ReadOnly Property sIconSource As String
|
||||
Get
|
||||
@@ -165,6 +166,7 @@ Public Class EgtMsgBoxButton
|
||||
Friend Sub SetIsDefault(bValue As Boolean)
|
||||
m_bIsDefault = bValue
|
||||
End Sub
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCommand As ICommand
|
||||
|
||||
@@ -176,26 +178,26 @@ Public Class EgtMsgBoxButton
|
||||
m_Type = Type
|
||||
Select Case m_Type
|
||||
Case Types.OK
|
||||
m_sMessage = EgtMsg(35001)
|
||||
Case Types.CANCEL
|
||||
m_sMessage = EgtMsg(35002)
|
||||
Case Types.YES
|
||||
m_sMessage = EgtMsg(35003)
|
||||
Case Types.NO
|
||||
m_sMessage = EgtMsg(35004)
|
||||
End Select
|
||||
m_sMessage = EgtMsg(35001)
|
||||
Case Types.CANCEL
|
||||
m_sMessage = EgtMsg(35002)
|
||||
Case Types.YES
|
||||
m_sMessage = EgtMsg(35003)
|
||||
Case Types.NO
|
||||
m_sMessage = EgtMsg(35004)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Sub New(Type As Types, bIsDefault As Boolean)
|
||||
MyClass.New(Type)
|
||||
m_bIsDefault = bIsDefault
|
||||
End Sub
|
||||
Sub New(Type As Types, bIsDefault As Boolean)
|
||||
MyClass.New(Type)
|
||||
m_bIsDefault = bIsDefault
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Shared Sub SetOwner(value As EgtMessageBoxVM)
|
||||
Friend Shared Sub SetOwner(value As EgtMessageBoxVM)
|
||||
Owner = value
|
||||
End Sub
|
||||
|
||||
@@ -227,7 +229,7 @@ Public Class EgtMsgBoxButton
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
#End Region ' Command
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
|
||||
@@ -150,7 +150,6 @@
|
||||
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
|
||||
<Compile Include="EgtColorPicker\EgtHexagon.vb" />
|
||||
<Compile Include="EgtMessageBox\EgtMessageBoxV.xaml.vb">
|
||||
<DependentUpon>EgtMessageBoxV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -895,6 +894,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtDialog\Folder.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtDialog\Root.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
|
||||
|
||||
@@ -166,14 +166,7 @@ Public Class MainWindowVM
|
||||
If Map.refRightPanelVM.SelPanel = RightPanelVM.Panels.SIMULATION AndAlso Not IsNothing(Map.refSimulationPanelVM) Then
|
||||
Map.refSimulationPanelVM.MySimul.ResetSimulation()
|
||||
End If
|
||||
' Gestisco eventuale file corrente modificato
|
||||
Dim bOk As Boolean = True
|
||||
'bOk = ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ)
|
||||
' se salvataggio annullato, rimango
|
||||
If Not bOk Then Return
|
||||
Dim bAllowClose As Boolean = Map.refSceneHostVM.MainController.ManageModified()
|
||||
' Salvo impostazione macchina corrente
|
||||
'Map.refMachinePanelVM.SaveCurrentMachine()
|
||||
Dim bAllowClose As Boolean = Map.refSceneHostVM.ManageModified()
|
||||
' Se non confermata chiusura, esco
|
||||
If Not bAllowClose Then Return
|
||||
' salvo modo di visualizzazione
|
||||
|
||||
@@ -801,6 +801,9 @@ Public Class OptionWindowVM
|
||||
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
|
||||
''' </summary>
|
||||
Public Sub TopSceneBackgroundCmd()
|
||||
Dim x As New Forms.ColorDialog
|
||||
x.ShowDialog()
|
||||
|
||||
' Recupero colore da Ini
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
|
||||
@@ -1231,7 +1234,7 @@ Public Class LayerColor
|
||||
'ColorDlg.FullOpen = True
|
||||
'ColorDlg.CustomColors = nCustomColors.ToArray()
|
||||
'ColorDlg.Color = Col.ToColor()
|
||||
' Visualizzo dialogo
|
||||
'' Visualizzo dialogo
|
||||
Dim ColorDlg As New EgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
|
||||
.CustomColors = nCustomColors.ToArray(),
|
||||
.Color = Col.ToColor()
|
||||
|
||||
@@ -160,17 +160,10 @@ Public Class ProjManagerVM
|
||||
"|New geometry EgalTech(*.nge)|*.nge",
|
||||
.FileName = "New.icrs",
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir}
|
||||
.InitialDirectory = sDir,
|
||||
.Mode = 1}
|
||||
od.ShowDialog()
|
||||
Dim sFilePath As String = od.FileName
|
||||
|
||||
'Dim save As New EgtSaveDialogV(Application.Current.MainWindow, New EgtSaveDialogVM()) With {
|
||||
' .Title = "Save",
|
||||
' .Filter = "Icarus project(*.icrs)|*.icrs",
|
||||
' .FileName = "New.icrs",
|
||||
' .InitialDirectory = sDir}
|
||||
'save.ShowDialog()
|
||||
'Dim sFilePath As String = save.FileName
|
||||
End Sub
|
||||
|
||||
Friend Sub NewProject(bDialog As Boolean)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -263,20 +263,21 @@ Public Class MySceneHostVM
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
'Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With {
|
||||
' .Title = "Open",
|
||||
' .Filter = "Icarus project(*.icrs)|*.icrs" &
|
||||
' "|New geometry EgalTech(*.nge)|*.nge",
|
||||
' .FilterIndex = 1,
|
||||
' .InitialDirectory = sDir
|
||||
'}
|
||||
Dim OpenFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With {
|
||||
.Title = "Open",
|
||||
.Filter = "Icarus project(*.icrs)|*.icrs" &
|
||||
"|New geometry EgalTech(*.nge)|*.nge",
|
||||
.FilterIndex = 1,
|
||||
.InitialDirectory = sDir
|
||||
}
|
||||
'Dim OpenFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
' .Title = "Open",
|
||||
' .Filter = "Icarus project(*.icrs)|*.icrs" &
|
||||
' "|New geometry EgalTech(*.nge)|*.nge",
|
||||
' .FilterIndex = 1,
|
||||
' .InitialDirectory = sDir,
|
||||
' .Mode = 2
|
||||
'}
|
||||
If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return False
|
||||
sFilePath = OpenFileDialog.FileName
|
||||
End If
|
||||
@@ -328,18 +329,19 @@ Public Class MySceneHostVM
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
' Assegnazione nome file con dialogo
|
||||
'Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With {
|
||||
' .Title = "Save",
|
||||
' .Filter = "Icarus Project(*.icrs)|*.icrs",
|
||||
' .FileName = sFile,
|
||||
' .InitialDirectory = IO.Path.GetDirectoryName(sFile)
|
||||
'}
|
||||
Dim SaveFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With {
|
||||
.Title = "Save",
|
||||
.Filter = "Icarus project(*.icrs)|*.icrs",
|
||||
.Filter = "Icarus Project(*.icrs)|*.icrs",
|
||||
.FileName = sFile,
|
||||
.InitialDirectory = sDir
|
||||
.InitialDirectory = IO.Path.GetDirectoryName(sFile)
|
||||
}
|
||||
'Dim SaveFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
|
||||
' .Title = "Save",
|
||||
' .Filter = "Icarus project(*.icrs)|*.icrs",
|
||||
' .FileName = sFile,
|
||||
' .InitialDirectory = sDir,
|
||||
' .Mode = 2
|
||||
'}
|
||||
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
Dim sFileName As String = SaveFileDialog.FileName
|
||||
EgtSetCurrFilePath(sFileName)
|
||||
@@ -724,6 +726,33 @@ Public Class MySceneHostVM
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Function ManageModified() As Boolean
|
||||
' se non modificato, procedo normalmente
|
||||
If Not EgtGetModified() Then
|
||||
Return True
|
||||
End If
|
||||
' chiedo cosa fare
|
||||
Dim sMsg As String = "Save changes"
|
||||
Dim sCurrFile = ""
|
||||
EgtGetCurrFilePath(sCurrFile)
|
||||
sCurrFile = Path.GetFileName(sCurrFile)
|
||||
If Not String.IsNullOrEmpty(sCurrFile) Then
|
||||
sMsg = String.Format("Save changes to {0}?", sCurrFile)
|
||||
Else
|
||||
sMsg = "Save changes?"
|
||||
End If
|
||||
Dim nRes = EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Select Case nRes
|
||||
Case Windows.Forms.DialogResult.Yes
|
||||
SaveProject()
|
||||
Return True
|
||||
Case Windows.Forms.DialogResult.No
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' ProjectManager
|
||||
|
||||
#Region "SCENE EVENTS"
|
||||
|
||||
@@ -933,13 +933,7 @@
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ColorPicker_TextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource BaseTextBox}">
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Width" Value="65"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="ParameterList_TextBox2" TargetType="{x:Type EgtWPFLib5:EgtTextBox2}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtTextBox2}}">
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="ExplicitUpdateSource" Value="EnterKeyPressOrLostFocus"/>
|
||||
@@ -4451,92 +4445,6 @@
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--EgtHexagon-->
|
||||
|
||||
<PrintApp:HexClipConverter x:Key="ClipConverter"/>
|
||||
|
||||
<Style TargetType="{x:Type PrintApp:EgtHexItem}" x:Key="EgtHexItem">
|
||||
<Setter Property="Background" Value="CornflowerBlue"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="1.5"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="PrintApp:EgtHexItem">
|
||||
<Grid Name="hexBorder" Background="{TemplateBinding BorderBrush}">
|
||||
<Grid.Clip>
|
||||
<MultiBinding Converter="{StaticResource ClipConverter}">
|
||||
<Binding Path="ActualWidth" ElementName="hexBorder"/>
|
||||
<Binding Path="ActualHeight" ElementName="hexBorder"/>
|
||||
<Binding Path="Orientation" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
</MultiBinding>
|
||||
</Grid.Clip>
|
||||
|
||||
<Grid Name="hexContent"
|
||||
Background="{TemplateBinding Background}"
|
||||
Margin="{TemplateBinding BorderThickness}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<Grid.Clip>
|
||||
<MultiBinding Converter="{StaticResource ClipConverter}">
|
||||
<Binding Path="ActualWidth" ElementName="hexContent"/>
|
||||
<Binding Path="ActualHeight" ElementName="hexContent"/>
|
||||
<Binding Path="Orientation" RelativeSource="{RelativeSource TemplatedParent}"/>
|
||||
</MultiBinding>
|
||||
</Grid.Clip>
|
||||
|
||||
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
ClipToBounds="True"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="BorderBrush" Value="Gold"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--HexList-->
|
||||
<Style TargetType="{x:Type PrintApp:EgtHexList}" x:Key="EgtHexList">
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<PrintApp:EgtHexagon ColumnCount="{Binding Path=ColumnCount, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
||||
RowCount="{Binding Path=RowCount, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
||||
Background="{Binding Path=Background, RelativeSource={RelativeSource AncestorType=ListBox}}"/>
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type PrintApp:EgtHexList}">
|
||||
<Grid>
|
||||
<Border BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
|
||||
<ScrollViewer Focusable="False"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--EgtMainWindow-->
|
||||
<!--
|
||||
|
||||
@@ -4795,6 +4703,11 @@
|
||||
</Style>
|
||||
|
||||
-->
|
||||
|
||||
<Style x:Key="EgtManageFile_DataGridColumnHeader" TargetType="DataGridColumnHeader">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user