Merge commit 'dda46787db9dbbb232e2c81b4ef093fba7036ec3'

This commit is contained in:
Dario Sassi
2026-03-12 18:27:27 +01:00
23 changed files with 736 additions and 207 deletions
+3
View File
@@ -51,6 +51,9 @@ Module ConstGen
' Chiave di Info in gruppo di lavoro per none part-program
Public Const KEY_MCHGRP_NCNAME As String = "NcName"
' File Dimensioni Griglia CAM5
Public Const DIMENSION_FILE_NAME As String = "Dimension.ini"
' Costante per flag di BBox
Public Const BBFLAG As Integer = GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM
+1
View File
@@ -322,6 +322,7 @@
<Compile Include="Utility\Analyze.vb" />
<Compile Include="Utility\BasePanelVM.vb" />
<Compile Include="Utility\BindingProxy.vb" />
<Compile Include="Utility\DynamicGridModule.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Internals\MruList.vb" />
<Compile Include="Utility\MachineModel.vb" />
+14 -5
View File
@@ -46,6 +46,13 @@ Public Class MainWindowVM
End Set
End Property
Private m_sDimensionDir As String = String.Empty
Public ReadOnly Property DimensionDir As String
Get
Return m_sDimensionDir
End Get
End Property
Private m_cmdMainWindow_ContentRendered As ICommand
Private m_cmdAboutBox As ICommand
' MainWindow Activated Event
@@ -97,11 +104,11 @@ Public Class MainWindowVM
Public ReadOnly Property IconSource As String
Get
#If PLATFORM = "x64" Then
#If PLATFORM = "x64" Then
Return "/Resources/EgtCAM5_64.ico"
#else
Return "/Resources/EgtCAM5.ico"
#End If
#Else
Return "/Resources/EgtCAM5.ico"
#End If
End Get
End Property
@@ -197,7 +204,7 @@ Public Class MainWindowVM
End If
End Sub
Private Function OnTerminateProcess( nExitCode As Integer) As Boolean
Private Function OnTerminateProcess(nExitCode As Integer) As Boolean
' Aggiorno istanze usate
ReleaseInstance()
' Dichiaro di procedere con la terminazione del programma
@@ -347,6 +354,8 @@ Public Class MainWindowVM
Else
IniFile.m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKER_DFL_DIR
End If
' Recupero percorso file Dimension
m_sDimensionDir = m_sConfigDir & "\" & DIMENSION_FILE_NAME
' Verifico indice di istanza
ManageInstance()
' Imposto tipo di chiave
@@ -8,7 +8,7 @@
<TextBlock Text="{Binding PropertiesMsg}"/>
</Expander.Header>
<UniformGrid>
<TextBox Text="{Binding InfoBox, Mode=OneWay}" MaxHeight="100" IsReadOnly="True"
<TextBox Text="{Binding InfoBox, Mode=OneWay}" IsReadOnly="True"
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"/>
</UniformGrid>
</Expander>
@@ -21,6 +21,7 @@ Public Class InfoExpanderVM
Set(value As Boolean)
If value <> m_IsExpanded Then
m_IsExpanded = value
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(m_IsExpanded)
OnPropertyChanged("IsEnabled")
End If
End Set
@@ -24,6 +24,7 @@ Public Class LayerTreeViewItem
Set(value As Boolean)
If (value <> m_isSelected) Then
m_isSelected = value
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(value)
If value Then
' recupero l'Id del nuovo oggetto selezionato
Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False)
@@ -5,7 +5,7 @@
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:local="clr-namespace:EgtCAM5">
<Expander IsExpanded="True" Style="{StaticResource ExpanderStyle}">
<Expander IsExpanded="{Binding ManageLayerIsExpanded}" Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding HeaderName}" Margin="0,0,5,0"/>
@@ -13,7 +13,11 @@
</StackPanel>
</Expander.Header>
<StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<UniformGrid Rows="1">
<Button Content="{Binding NewPartMsg}" Command="{Binding NewPartCommand}" Height="30"/>
@@ -21,7 +25,7 @@
<Button Content="{Binding ColorMsg}" Command="{Binding LayerColorCommand}" Height="30"/>
</UniformGrid>
<TreeView x:Name="LayerTreeView" MinHeight="300" MaxHeight="400"
<TreeView Grid.Row="1" x:Name="LayerTreeView"
ItemsSource="{Binding Path=LayerList}"
VirtualizingStackPanel.IsVirtualizing = "True"
VirtualizingStackPanel.VirtualizationMode = "Recycling">
@@ -116,6 +120,6 @@
</ContextMenu>
</TreeView.ContextMenu>
</TreeView>
</StackPanel>
</Grid>
</Expander>
</UserControl>
@@ -55,6 +55,22 @@ Public Class ManageLayerExpanderVM
End Get
End Property
Private m_ManageLayerIsExpanded As Boolean
Public Property ManageLayerIsExpanded As Boolean
Get
Return m_ManageLayerIsExpanded
End Get
Set(value As Boolean)
m_ManageLayerIsExpanded = value
Map.refDrawOptionPanelVM.SetManageLayerRowIsExpanded(m_ManageLayerIsExpanded)
OnPropertyChanged("ManageLayerIsExpanded")
End Set
End Property
Friend Sub SetManageLayerIsExpanded(value As Boolean)
m_ManageLayerIsExpanded = value
OnPropertyChanged("ManageLayerIsExpanded")
End Sub
#Region "Messages"
Public ReadOnly Property NewPartMsg As String
@@ -140,6 +156,7 @@ Public Class ManageLayerExpanderVM
Map.SetRefManageLayerExpanderVM(Me)
'Imposto tempo di evidenziazione delle entità clickate
ObjTreeTimer.Interval = TimeSpan.FromMilliseconds(1000)
SetManageLayerIsExpanded(True)
End Sub
#End Region ' Constructor
@@ -241,6 +258,7 @@ Public Class ManageLayerExpanderVM
If m_nObjTreeOldId <> GDB_ID.NULL Then
Map.refProjectVM.SetLastInteger(m_nObjTreeOldId)
Map.refProjectVM.ExecuteCommand(Controller.CMD.SETCURRPARTLAYER)
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(True)
End If
End Sub
+19 -7
View File
@@ -1,15 +1,27 @@
<UserControl x:Class="DrawOptionPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="250"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
<StackPanel Name="ciao" Background="Transparent" Margin="0,0,3.5001,0" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
<Grid x:Name="DrawGrid" Background="Transparent" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
<Grid.RowDefinitions>
<RowDefinition MinHeight="0" Height="400" MaxHeight="800"
EgtCAM5:DrawOptionPanelVM.RowId="ManageLayer"
EgtCAM5:DrawOptionPanelVM.IsExpanded="{Binding ManageLayerRowIsExpanded}"/>
<RowDefinition MinHeight="0" Height="150" MaxHeight="400"
EgtCAM5:DrawOptionPanelVM.RowId="Info"
EgtCAM5:DrawOptionPanelVM.IsExpanded="{Binding InfoRowIsExpanded}"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--ContentPresenter that contains the ManageLayerExpander-->
<ContentPresenter Content="{Binding ManageLayerExpander,Mode=OneWay}"/>
<ContentPresenter Content="{Binding ManageLayerExpander,Mode=OneWay}"/>
<GridSplitter x:Name="ManagerLayerGridSplitter" Style="{StaticResource General_GridSplitter}"/>
<!--ContentPresenter that contains the InfoExpander-->
<ContentPresenter Content="{Binding InfoExpander}"/>
<ContentPresenter Grid.Row="1" Content="{Binding InfoExpander}"/>
<GridSplitter x:Name="InfoGridSplitter" Grid.Row="1" Style="{StaticResource General_GridSplitter}"/>
<!--ContentPresenter that contains the InputExpander-->
<ContentPresenter Content="{Binding InputExpander}"/>
</StackPanel>
<ContentPresenter Grid.Row="2" Content="{Binding InputExpander}"/>
</Grid>
</UserControl>
</UserControl>
+24 -2
View File
@@ -1,7 +1,29 @@
Public Class DrawOptionPanelV
Private Sub Me_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim x = ciao.MaxHeight
Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
If Not IsActivePlugin() Then
AddHandler DrawGrid.Loaded,
Sub()
DynamicGridModule.RestoreDrawGridLayout(DrawGrid, "ManageLayer", 0, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
DynamicGridModule.RestoreDrawGridLayout(DrawGrid, "Info", 1, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
DrawGrid.UpdateLayout()
End Sub
AddHandler ManagerLayerGridSplitter.DragCompleted,
Sub()
DynamicGridModule.SaveDrawGridLayout(DrawGrid, "ManageLayer", If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
End Sub
AddHandler InfoGridSplitter.DragCompleted,
Sub()
DynamicGridModule.SaveDrawGridLayout(DrawGrid, "Info", If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
End Sub
End If
End Sub
End Class
+83 -3
View File
@@ -1,6 +1,4 @@
Imports EgtUILib
Public Class DrawOptionPanelVM
Public Class DrawOptionPanelVM
Inherits ViewModelBase
' GRAPHICAL ELEMENTS
@@ -37,6 +35,28 @@ Public Class DrawOptionPanelVM
End Get
End Property
Private m_ManageLayerRowIsExpanded As Boolean = True
Public ReadOnly Property ManageLayerRowIsExpanded As Boolean
Get
Return m_ManageLayerRowIsExpanded
End Get
End Property
Friend Sub SetManageLayerRowIsExpanded(value As Boolean)
m_ManageLayerRowIsExpanded = value
OnPropertyChanged("ManageLayerRowIsExpanded")
End Sub
Private m_InfoRowIsExpanded As Boolean = True
Public ReadOnly Property InfoRowIsExpanded As Boolean
Get
Return m_InfoRowIsExpanded
End Get
End Property
Friend Sub SetInfoRowIsExpanded(value As Boolean)
m_InfoRowIsExpanded = value
OnPropertyChanged("InfoRowIsExpanded")
End Sub
#Region "CONSTRUCTOR"
Sub New()
@@ -60,4 +80,64 @@ Public Class DrawOptionPanelVM
#End Region ' METHODS
#Region "DEPENCY PROPERTY"
Public Shared ReadOnly RowIdProperty As DependencyProperty =
DependencyProperty.RegisterAttached(
"RowId",
GetType(String),
GetType(DrawOptionPanelVM),
New PropertyMetadata(Nothing)
)
Public Shared Sub SetRowId(element As DependencyObject, value As String)
element.SetValue(RowIdProperty, value)
End Sub
Public Shared Function GetRowId(element As DependencyObject) As String
Return CType(element.GetValue(RowIdProperty), String)
End Function
Public Shared ReadOnly IsExpandedProperty As DependencyProperty =
DependencyProperty.RegisterAttached(
"IsExpanded",
GetType(Boolean),
GetType(DrawOptionPanelVM),
New PropertyMetadata(True, AddressOf OnIsExpandedChanged)
)
Public Shared Sub SetIsExpanded(element As DependencyObject, value As Boolean)
element.SetValue(IsExpandedProperty, value)
End Sub
Public Shared Function GetIsExpanded(element As DependencyObject) As Boolean
Return CType(element.GetValue(IsExpandedProperty), Boolean)
End Function
Private Shared Sub OnIsExpandedChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim row As RowDefinition = TryCast(d, RowDefinition)
If IsNothing(row) Then Return
Dim isExpanded As Boolean = CBool(e.NewValue)
Dim rowId As String = GetRowId(row)
Dim rowHeight As Double = 0
If rowId = "ManageLayer" Then
rowHeight = 400
ElseIf rowId = "Info" Then
rowHeight = 150
End If
If Not isExpanded Then
row.ClearValue(RowDefinition.HeightProperty)
row.Height = New GridLength(1, GridUnitType.Auto)
Else
row.Height = New GridLength(rowHeight)
End If
End Sub
#End Region ' Depency Property
End Class
@@ -1,177 +1,176 @@
<UserControl x:Class="OperationsListExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<StackPanel Name="OperationsListExpanderViewStackPanel" IsEnabled="{Binding OpersListViewIsEnabled}">
<Expander Header="{Binding OperationListHeader}"
IsEnabled="{Binding OpersListViewIsEnabled}"
IsExpanded="{Binding ListIsExpanded}" Name="OperationsListExpander"
Style="{StaticResource ExpanderStyle}">
<Expander.InputBindings>
<KeyBinding Key="Escape" Command="{Binding CancelOperationCommand}" CommandParameter="Escape"/>
</Expander.InputBindings>
<Expander Header="{Binding OperationListHeader}" IsExpanded="{Binding ListIsExpanded}" Name="OperationsListExpander"
Style="{StaticResource ExpanderStyle}">
<Expander.InputBindings>
<KeyBinding Key="Escape" Command="{Binding CancelOperationCommand}" CommandParameter="Escape"/>
</Expander.InputBindings>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel>
<UniformGrid Rows="1">
<Button Content="{Binding NewMachiningBtnContent}" Command="{Binding NewMachiningCommand}" Height="30"/>
<Button Content="{Binding NewPositioningBtnContent}" Command="{Binding NewPositioningCommand}" Height="30"/>
<Button Content="{Binding CancelOperationBtnContent}" Command="{Binding CancelOperationCommand}" Height="30"/>
</UniformGrid>
<UniformGrid Rows="1">
<Button Content="{Binding NewMachiningBtnContent}" Command="{Binding NewMachiningCommand}" Height="30"/>
<Button Content="{Binding NewPositioningBtnContent}" Command="{Binding NewPositioningCommand}" Height="30"/>
<Button Content="{Binding CancelOperationBtnContent}" Command="{Binding CancelOperationCommand}" Height="30"/>
</UniformGrid>
<ListBox IsSynchronizedWithCurrentItem="False" ItemsSource="{Binding OperationList}"
Height="200" x:Name="OperationList" IsEnabled="{Binding IsEnabledOperationList}" SelectionMode="Extended">
<ListBox.Resources>
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
<DataTemplate.Resources>
<Style x:Key="LayoutRoot" TargetType="Grid">
<!--<Style.Triggers>
--><!--these are the triggers that make the code cursor jump from box 1 to box 2 to box 3.--><!--
<DataTrigger Binding="{Binding ElementName=Box, Path=Visibility}" Value="Visible">
<Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=Box}"/>
</DataTrigger>
</Style.Triggers>-->
</Style>
</DataTemplate.Resources>
<Border Background="Transparent">
<Border.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
<ListBox Grid.Row="1"
IsSynchronizedWithCurrentItem="False"
ItemsSource="{Binding OperationList}"
x:Name="OperationList" IsEnabled="{Binding IsEnabledOperationList}" SelectionMode="Extended">
<ListBox.Resources>
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
<DataTemplate.Resources>
<Style x:Key="LayoutRoot" TargetType="Grid"/>
</DataTemplate.Resources>
<Border Background="Transparent">
<Border.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
CommandParameter="{Binding Id}"/>
</Border.InputBindings>
<Grid Style="{StaticResource LayoutRoot}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/>
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="1"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>
</Border.InputBindings>
<Grid Style="{StaticResource LayoutRoot}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/>
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="1"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>
<TextBlock Grid.Column="2" Text="{Binding Name}"
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
Width="150"
x:Name="Box"
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
<!--IsVisibleChanged="MachiningOpListBoxItem_IsVisibleChanged"
<TextBlock Grid.Column="2" Text="{Binding Name}"
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
Width="150"
x:Name="Box"
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
<!--IsVisibleChanged="MachiningOpListBoxItem_IsVisibleChanged"
LostKeyboardFocus="MachiningOpListBoxItem_LostKeyboardFocus">-->
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding ModifyNameEnterCommand}"/>
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
</TextBox.InputBindings>
</TextBox>
<TextBlock Grid.Column="3" Text="{Binding Info}"/>
</Grid>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type EgtCAM5:DispositionOpListBoxItem}">
<Border CornerRadius="1" Background="{StaticResource EgaltechBlue3}">
<Border.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding ModifyNameEnterCommand}"/>
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
</TextBox.InputBindings>
</TextBox>
<TextBlock Grid.Column="3" Text="{Binding Info}"/>
</Grid>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type EgtCAM5:DispositionOpListBoxItem}">
<Border CornerRadius="1" Background="{StaticResource EgaltechBlue3}">
<Border.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
CommandParameter="{Binding Id}"/>
</Border.InputBindings>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
<CheckBox IsChecked="{Binding OnOffAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
<!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}"
</Border.InputBindings>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
<CheckBox IsChecked="{Binding OnOffAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
<!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}"
IsChecked="{Binding OnOffAll}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>-->
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
<TextBlock Text="{Binding Name}" Foreground="White"
FontSize="15" FontWeight="SemiBold"/>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<!--<Interactivity:Interaction.Triggers>
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
<TextBlock Text="{Binding Name}" Foreground="White"
FontSize="15" FontWeight="SemiBold"/>
</StackPanel>
</Border>
</DataTemplate>
</ListBox.Resources>
<!--<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>-->
<!--<Interactivity:Interaction.Triggers>
<Interactivity:EventTrigger EventName="MouseDoubleClick">
<Interactivity:InvokeCommandAction Command="{Binding OperationListDoubleClickCommand}"/>
</Interactivity:EventTrigger>
</Interactivity:Interaction.Triggers>-->
<!--<Interactivity:Interaction.Behaviors>
<!--<Interactivity:Interaction.Behaviors>
<EgtCAM5:ScrollIntoViewForListBox/>
</Interactivity:Interaction.Behaviors>-->
<ListBox.InputBindings>
<KeyBinding Key="Delete" Command="{Binding CancelOperationCommand}"/>
</ListBox.InputBindings>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="False"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="True"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="{Binding DuplicateMachMsg}"
Command="{Binding DuplicateMachCommand}"
IsEnabled="{Binding DuplicateCmd_IsEnabled}">
</MenuItem>
<MenuItem Header="{Binding MachToDbMsg}"
Command="{Binding MachToDbCommand}"
IsEnabled="{Binding MachToDb_IsEnabled}">
</MenuItem>
<MenuItem Header="{Binding RenameMsg}"
Command="{Binding RenameCommand}"
IsEnabled="{Binding Rename_IsEnabled}">
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Style>
<Style TargetType="ListBox">
<EventSetter Event="SelectionChanged" Handler="ItemsControl_SelectionChanged"/>
</Style>
</ListBox.Style>
</ListBox>
<ListBox.InputBindings>
<KeyBinding Key="Delete" Command="{Binding CancelOperationCommand}"/>
</ListBox.InputBindings>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="False"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="True"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="{Binding DuplicateMachMsg}"
Command="{Binding DuplicateMachCommand}"
IsEnabled="{Binding DuplicateCmd_IsEnabled}">
</MenuItem>
<MenuItem Header="{Binding MachToDbMsg}"
Command="{Binding MachToDbCommand}"
IsEnabled="{Binding MachToDb_IsEnabled}">
</MenuItem>
<MenuItem Header="{Binding RenameMsg}"
Command="{Binding RenameCommand}"
IsEnabled="{Binding Rename_IsEnabled}">
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Style>
<Style TargetType="ListBox">
<EventSetter Event="SelectionChanged" Handler="ItemsControl_SelectionChanged"/>
</Style>
</ListBox.Style>
</ListBox>
<UniformGrid Rows="1">
<Button Content="{Binding MoveUpMsg}" Command="{Binding MoveUpCommand}" Height="30" IsEnabled="{Binding MoveUp_IsEnabled}" />
<Button Content="{Binding MoveDownMsg}" Command="{Binding MoveDownCommand}" Height="30" IsEnabled="{Binding MoveDown_IsEnabled}"/>
<Button Content="{Binding UpdateMsg}" Command="{Binding UpdateCommand}" Height="30"/>
<Button Content="{Binding SetUpMsg}" Command="{Binding SetUpCommand}" Height="30"/>
</UniformGrid>
<UniformGrid Grid.Row="2" Rows="1">
<Button Content="{Binding MoveUpMsg}" Command="{Binding MoveUpCommand}" Height="30" IsEnabled="{Binding MoveUp_IsEnabled}" />
<Button Content="{Binding MoveDownMsg}" Command="{Binding MoveDownCommand}" Height="30" IsEnabled="{Binding MoveDown_IsEnabled}"/>
<Button Content="{Binding UpdateMsg}" Command="{Binding UpdateCommand}" Height="30"/>
<Button Content="{Binding SetUpMsg}" Command="{Binding SetUpCommand}" Height="30"/>
</UniformGrid>
</StackPanel>
</Expander>
</StackPanel>
</Grid>
</Expander>
</UserControl>
@@ -85,6 +85,7 @@ Public Class OperationsListExpanderVM
If value <> m_ListIsExpanded Then
Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.OPERATIONLIST, value)
SetStatusOnLamp()
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(value)
End If
End Set
End Property
@@ -472,6 +473,8 @@ Public Class OperationsListExpanderVM
EgtDraw()
End If
End If
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(False)
End Sub
#End Region ' OperationListDoubleClickCommand
+19 -8
View File
@@ -1,24 +1,35 @@
<UserControl x:Class="MachiningOptionPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="250"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
<StackPanel Name="ciao" Background="Transparent" Margin="0,0,3.5001,0" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
<Grid x:Name="MachiningGrid" Background="Transparent" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
<Grid.RowDefinitions>
<RowDefinition MinHeight="0" Height="350" MaxHeight="800" EgtCAM5:MachiningOptionPanelVM.IsExpanded="{Binding OperationsListRowIsExpanded}"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--ContentPresenter that contains the OperationsListExpander-->
<ContentPresenter Content="{Binding OperationsListExpander,Mode=OneWay}"/>
<GridSplitter Name="MachiningGridSplitter" Style="{StaticResource General_GridSplitter}"/>
<!--ContentPresenter that contains the OperationParametersExpander-->
<ContentPresenter Content="{Binding OperationParametersExpander,Mode=OneWay}"/>
<ContentPresenter Grid.Row="1" Content="{Binding OperationParametersExpander,Mode=OneWay}"/>
<!--ContentPresenter that contains the MachiningsTreeExpander-->
<ContentPresenter Content="{Binding MachiningsTreeExpander}"/>
<ContentPresenter Grid.Row="2" Content="{Binding MachiningsTreeExpander}"/>
<!--ContentPresenter that contains the SimulationExpander-->
<ContentPresenter Content="{Binding SimulationExpander}"/>
<ContentPresenter Grid.Row="3" Content="{Binding SimulationExpander}"/>
<!--ContentPresenter that contains the EstimationsExpander-->
<ContentPresenter Content="{Binding EstimationsExpander}"/>
<ContentPresenter Grid.Row="4" Content="{Binding EstimationsExpander}"/>
<Button Content="{Binding GenerateMsg}" Height="30"
<Button Grid.Row="5"
Content="{Binding GenerateMsg}" Height="30"
IsEnabled="{Binding GenerateIsEnabled}"
Command="{Binding GenerateCommand}"/>
</StackPanel>
</Grid>
</UserControl>
+18 -2
View File
@@ -1,7 +1,23 @@
Public Class MachiningOptionPanelV
Private Sub Me_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim x = ciao.MaxHeight
Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
If Not IsActivePlugin() Then
AddHandler MachiningGrid.Loaded,
Sub()
DynamicGridModule.RestoreMachiningGridLayout(MachiningGrid, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_MACHINING_PLUGIN, DynamicGridModule.PROJECT_MACHINING))
MachiningGrid.UpdateLayout()
End Sub
AddHandler MachiningGridSplitter.DragCompleted,
Sub()
DynamicGridModule.SaveMachiningGridLayout(MachiningGrid, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_MACHINING_PLUGIN, DynamicGridModule.PROJECT_MACHINING))
End Sub
End If
End Sub
End Class
+46
View File
@@ -132,6 +132,17 @@ Public Class MachiningOptionPanelVM
End Get
End Property
Private m_OperationsListRowIsExpanded As Boolean = True
Public ReadOnly Property OperationsListRowIsExpanded As Boolean
Get
Return m_OperationsListRowIsExpanded
End Get
End Property
Friend Sub SetOperationsListRowIsExpanded(value As Boolean)
m_OperationsListRowIsExpanded = value
OnPropertyChanged("OperationsListRowIsExpanded")
End Sub
#Region "Messages"
Public ReadOnly Property GenerateMsg As String
@@ -195,4 +206,39 @@ Public Class MachiningOptionPanelVM
#End Region ' COMMANDS
#Region "DEPENCY PROPERTY"
Public Shared ReadOnly IsExpandedProperty As DependencyProperty =
DependencyProperty.RegisterAttached(
"IsExpanded",
GetType(Boolean),
GetType(MachiningOptionPanelVM),
New PropertyMetadata(True, AddressOf OnIsExpandedChanged)
)
Public Shared Sub SetIsExpanded(element As DependencyObject, value As Boolean)
element.SetValue(IsExpandedProperty, value)
End Sub
Public Shared Function GetIsExpanded(element As DependencyObject) As Boolean
Return CType(element.GetValue(IsExpandedProperty), Boolean)
End Function
Private Shared Sub OnIsExpandedChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim row As RowDefinition = TryCast(d, RowDefinition)
If IsNothing(row) Then Return
Dim isExpanded As Boolean = CBool(e.NewValue)
If Not isExpanded Then
row.ClearValue(RowDefinition.HeightProperty)
row.Height = New GridLength(1, GridUnitType.Auto)
Else
row.Height = New GridLength(350)
End If
End Sub
#End Region ' Depency Property
End Class
+1 -1
View File
@@ -1,6 +1,6 @@
<EgtFloating:EgtFloatingPanel x:Class="OptionPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="250"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
TitleBarOrientation="Vertical"
Visibility="{Binding Panel_Visibility}">
+1
View File
@@ -60,6 +60,7 @@ Public Class OptionPanelVM
Map.refSimulationExpanderVM.Simulation_IsExpanded = False
Map.refEstimationsExpanderVM.Estimation_IsExpanded = False
End If
If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.SetManageLayerIsExpanded(True)
NotifyPropertyChanged("ModePanel")
End Sub
+1 -1
View File
@@ -13,7 +13,7 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style>
<Setter Property="DockPanel.Dock" Value="{Binding}" />
<Setter Property="DockPanel.Dock" Value="{Binding}"/>
</Style>
</ItemsControl.ItemContainerStyle>
+65 -16
View File
@@ -58,9 +58,15 @@ Public Class ProjectVM
End Get
End Property
Private m_DynamicGrid As New Grid()
Public ReadOnly Property DynamicGrid As Grid
Get
Return m_DynamicGrid
End Get
End Property
#End Region
#Region "EGTUILIB FIELDS"
Private m_bCPlaneTypePos As Boolean
@@ -80,6 +86,17 @@ Public Class ProjectVM
TMDbParamVisibility.bFirst = True
' Inizializza i parametri della scena
'InitializeEgtProject()
Dim m_TopTrayV As New TopTrayV
Dim m_LeftTrayV As New LeftTrayV
Dim m_RightTrayV As New RightTrayV
Dim m_BottomTrayV As New BottomTrayV
Dim m_SceneContentControlV As New SceneContentControlV
DynamicGridModule.CreateDynamicGrid()
Dim gridSplitter As GridSplitter = DynamicGridModule.CreateGridSplitter()
' aggiungo componenti interfaccia
Dim bPlugin As Boolean = False
Dim PluginDirNameList() As String = {}
@@ -106,12 +123,17 @@ Public Class ProjectVM
Dim ConfigurationData As IPluginConfigData = Map.refMainWindowVM.GetConfigData(Of IPluginConfigData)(PluginName & ".ConfigurationData")
If Not IsNothing(ConfigurationData) And ConfigurationData.ControlList.Count > 0 Then
For Each Element In ConfigurationData.ControlList
PopolateGridWithPlugIn(m_TopTrayV, m_RightTrayV, m_BottomTrayV, m_SceneContentControlV, gridSplitter)
Select Case Element.Name
Case PLUGIN_RIGHT_TRAY
m_PanelList.Add(New RightTrayV)
'm_PanelList.Add(New RightTrayV)
'aggiungo RightTrayV alla griglia
m_DynamicGrid.Children.Add(m_RightTrayV)
Map.refOptionPanelVM.SetPanelViewState(Element.ViewPanelState)
Case PLUGIN_LEFT_TRAY
m_PanelList.Add(New LeftTrayV)
'm_PanelList.Add(New LeftTrayV)
' aggiungo LeftTrayV alla griglia
m_DynamicGrid.Children.Add(m_LeftTrayV)
Case Else
m_PanelList.Add(Map.refMainWindowVM.GetControlByName(Of IPluginControl)(Element))
End Select
@@ -119,17 +141,44 @@ Public Class ProjectVM
End If
End If
Next
m_PanelList.Add(New BottomTrayV)
m_PanelList.Add(New TopTrayV)
'm_PanelList.Add(New BottomTrayV)
'm_PanelList.Add(New TopTrayV)
' aggiungo gridSplitter alla griglia
m_DynamicGrid.Children.Add(gridSplitter)
' aggiungo BottomTrayV alla griglia
m_DynamicGrid.Children.Add(m_BottomTrayV)
' aggiungo TopTrayV alla griglia
m_DynamicGrid.Children.Add(m_TopTrayV)
' nascondo tasti gestione progetto se attivo plugin
Map.refTopCommandBarVM.SetProjectManagerVisibility(False)
Else
m_PanelList.Add(New TopTrayV)
m_PanelList.Add(New LeftTrayV)
m_PanelList.Add(New RightTrayV)
m_PanelList.Add(New BottomTrayV)
'm_PanelList.Add(New TopTrayV)
'm_PanelList.Add(New LeftTrayV)
'm_PanelList.Add(New RightTrayV)
'm_PanelList.Add(New BottomTrayV)
DynamicGridModule.PopulateGrid(m_TopTrayV, m_LeftTrayV, m_RightTrayV, m_BottomTrayV, m_SceneContentControlV, gridSplitter)
' aggiungo TopTrayV alla griglia
m_DynamicGrid.Children.Add(m_TopTrayV)
' aggiungo LeftTrayV alla griglia
m_DynamicGrid.Children.Add(m_LeftTrayV)
' aggiungo gridSplitter alla griglia
m_DynamicGrid.Children.Add(gridSplitter)
' aggiungo RightTrayV alla griglia
m_DynamicGrid.Children.Add(m_RightTrayV)
' aggiungo BottomTrayV alla griglia
m_DynamicGrid.Children.Add(m_BottomTrayV)
End If
m_PanelList.Add(New SceneContentControlV)
'm_PanelList.Add(New SceneContentControlV)
' aggiungo SceneContentControlV alla griglia
m_DynamicGrid.Children.Add(m_SceneContentControlV)
' Carico le dimensioni salvate su ini se presenti
AddHandler m_DynamicGrid.Loaded,
Sub()
DynamicGridModule.RestoreGridLayout(If(IsActivePlugin(), DynamicGridModule.PROJECT_EGTCAM5_PLUGIN, DynamicGridModule.PROJECT_EGTCAM5))
m_DynamicGrid.UpdateLayout()
End Sub
m_PanelList.Add(m_DynamicGrid)
End Sub
#End Region
@@ -223,14 +272,14 @@ Public Class ProjectVM
If IniFile.IsActiveTrimming() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sTrimmingDirPath, sVersion)
IniFile.GetSpecialLuaVersion(IniFile.m_sTrimmingDirPath, sVersion)
Dim sOut As String = "Trimming ver. " & sVersion & " " & IniFile.m_sTrimmingDirPath
EgtOutLog(sOut)
End If
If IniFile.IsActiveReversePost() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sReversePostDirPath, sVersion)
IniFile.GetSpecialLuaVersion(IniFile.m_sReversePostDirPath, sVersion)
Dim sOut As String = "ReversePost ver. " & sVersion & " " & IniFile.m_sReversePostDirPath
EgtOutLog(sOut)
End If
@@ -388,9 +437,9 @@ Public Class ProjectVM
Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0)
Map.refShowPanelVM.ShowCurveDir(nShowCurveDir)
' qualità di visualizzazione delle superfici
OptionModule.SetShowSurfQuality( False)
OptionModule.SetShowSurfQuality(False)
' tipo visualizzazione per Zmap
EgtSetShowZmap( OptionModule.m_nShowZmapType, False)
EgtSetShowZmap(OptionModule.m_nShowZmapType, False)
' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
@@ -1135,7 +1184,7 @@ Public Class ProjectVM
EgtGetPlaneSnapPoint(e.Location, Vector3d.Z_AX, TableRef.z, ptCurr)
DispositionUtility.VtHookFinder(nFixtureId, ptCurr)
Exit While
ElseIf DispositionUtility.VerifyTableAxis( nFixtureId) Then
ElseIf DispositionUtility.VerifyTableAxis(nFixtureId) Then
m_SelType = DispositionUtility.SelType.BARS
m_nIdToSel = nFixtureId
' Drag possibile
@@ -1233,7 +1282,7 @@ Public Class ProjectVM
m_nIdToDesel = GDB_ID.NULL
EgtDraw()
Return
' altrimenti verifico il tipo del primo oggetto selezionato
' altrimenti verifico il tipo del primo oggetto selezionato
Else
Dim nFirstSelId As Integer = EgtGetFirstSelectedObj()
' se è un riferimento resetto lo stato di selezione ed esco
+2 -1
View File
@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
DockPanel.Dock="Right">
DockPanel.Dock="Right"
Margin="1,0,0,0">
<local:OptionPanelV DataContext="{StaticResource OptionPanelViewModel}"/>
</Grid>
+12 -1
View File
@@ -1276,7 +1276,7 @@
<Style x:Key="SliderValue_Slider" TargetType="{x:Type Slider}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Width" Value="208"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="SmallChange" Value="1"/>
<Setter Property="TickPlacement" Value="TopLeft"/>
<Setter Property="Margin" Value="1,2,0,2"/>
@@ -1323,4 +1323,15 @@
<Setter Property="CornerRadius" Value="1"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- Style GridSplitter-->
<Style x:Key="General_GridSplitter" TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Height" Value="5"/>
</Style>
</ResourceDictionary>
+241
View File
@@ -0,0 +1,241 @@
Imports EgtWPFLib5
Module DynamicGridModule
Friend Const PROJECT_EGTCAM5 As String = "Project_EgtCAM5"
Friend Const PROJECT_EGTCAM5_PLUGIN As String = "Project_EgtCAM5_PlugIn"
Friend Const PROJECT_MACHINING As String = "Project_Machinig"
Friend Const PROJECT_MACHINING_PLUGIN As String = "Project_Machinig_PlugIn"
Friend Const PROJECT_DRAW As String = "Project_Draw"
Friend Const PROJECT_DRAW_PLUGIN As String = "Project_Draw_PlugIn"
''' <summary>
''' Funzione per popolare la griglia
''' </summary>
''' <param name="m_TopTrayV"></param>
''' <param name="m_LeftTrayV"></param>
''' <param name="m_RightTrayV"></param>
''' <param name="m_BottomTrayV"></param>
''' <param name="m_SceneContentControlV"></param>
''' <param name="gridSplitter"></param>
Friend Sub PopulateGrid(m_TopTrayV As TopTrayV, m_LeftTrayV As LeftTrayV, m_RightTrayV As RightTrayV, m_BottomTrayV As BottomTrayV, m_SceneContentControlV As SceneContentControlV, gridSplitter As GridSplitter)
' aggiungo TopTrayV
Grid.SetRow(m_TopTrayV, 0)
Grid.SetColumnSpan(m_TopTrayV, 3)
' aggiungo LeftTrayV
Grid.SetRow(m_LeftTrayV, 1)
Grid.SetColumn(m_LeftTrayV, 0)
Grid.SetRowSpan(m_LeftTrayV, 2)
' aggiungo RightTrayV
Grid.SetRow(m_RightTrayV, 1)
Grid.SetColumn(m_RightTrayV, 2)
Grid.SetRowSpan(m_RightTrayV, 2)
'aggiungo gridSplitter
Grid.SetRow(gridSplitter, 1)
Grid.SetColumn(gridSplitter, 2)
' aggiungo BottomTrayV
Grid.SetRow(m_BottomTrayV, 2)
Grid.SetColumn(m_BottomTrayV, 1)
' aggiungo Scena
Grid.SetRow(m_SceneContentControlV, 1)
Grid.SetColumn(m_SceneContentControlV, 1)
End Sub
''' <summary>
''' Funzione per popolare la griglia con PlugIn
''' </summary>
''' <param name="m_TopTrayV"></param>
''' <param name="m_RightTrayV"></param>
''' <param name="m_BottomTrayV"></param>
''' <param name="m_SceneContentControlV"></param>
''' <param name="gridSplitter"></param>
Friend Sub PopolateGridWithPlugIn(m_TopTrayV As TopTrayV, m_RightTrayV As RightTrayV, m_BottomTrayV As BottomTrayV, m_SceneContentControlV As SceneContentControlV, gridSplitter As GridSplitter)
' aggiungo TopTrayV
Grid.SetRow(m_TopTrayV, 0)
Grid.SetColumn(m_TopTrayV, 1)
' aggiungo RightTrayV
Grid.SetRow(m_RightTrayV, 0)
Grid.SetColumn(m_RightTrayV, 2)
Grid.SetRowSpan(m_RightTrayV, 2)
'aggiungo gridSplitter
Grid.SetRow(gridSplitter, 0)
Grid.SetColumn(gridSplitter, 2)
Grid.SetRowSpan(gridSplitter, 2)
' aggiungo BottomTrayV
Grid.SetRow(m_BottomTrayV, 2)
Grid.SetColumn(m_BottomTrayV, 1)
' aggiungo Scena
Grid.SetRow(m_SceneContentControlV, 1)
Grid.SetColumn(m_SceneContentControlV, 1)
End Sub
''' <summary>
''' Creazione GridSplitter
''' </summary>
''' <returns></returns>
Friend Function CreateGridSplitter() As GridSplitter
' creo gridsplitter
Dim gridSplitter As New GridSplitter With {
.Width = 30,
.HorizontalAlignment = HorizontalAlignment.Left,
.VerticalAlignment = VerticalAlignment.Stretch,
.Background = Brushes.Transparent
}
AddHandler gridSplitter.DragCompleted,
Sub()
SaveGridLayout(If(IsActivePlugin(), PROJECT_EGTCAM5_PLUGIN, PROJECT_EGTCAM5))
End Sub
Return gridSplitter
End Function
''' <summary>
''' Creazione Griglia Dinamica
''' </summary>
Friend Sub CreateDynamicGrid()
' creo colonne griglia dinamica
Dim gridCol1 As New ColumnDefinition With {
.Width = New GridLength(1, GridUnitType.Auto)
}
Dim gridCol2 As New ColumnDefinition With {
.Width = New GridLength(1, GridUnitType.Star)
}
Dim gridCol3 As New ColumnDefinition With {
.Width = New GridLength(250)
}
' aggiungo le colonne alla griglia
Map.refProjectVM.DynamicGrid.ColumnDefinitions.Add(gridCol1)
Map.refProjectVM.DynamicGrid.ColumnDefinitions.Add(gridCol2)
Map.refProjectVM.DynamicGrid.ColumnDefinitions.Add(gridCol3)
' creo righe griglia dinamica
Dim gridRow1 As New RowDefinition With {
.Height = New GridLength(1, GridUnitType.Auto)
}
Dim gridRow2 As New RowDefinition With {
.Height = New GridLength(1, GridUnitType.Star)
}
Dim gridRow3 As New RowDefinition With {
.Height = New GridLength(1, GridUnitType.Auto)
}
' aggiungo righe alla griglia
Map.refProjectVM.DynamicGrid.RowDefinitions.Add(gridRow1)
Map.refProjectVM.DynamicGrid.RowDefinitions.Add(gridRow2)
Map.refProjectVM.DynamicGrid.RowDefinitions.Add(gridRow3)
End Sub
Friend Sub SaveGridLayout(GridTitle As String)
Dim Index As Integer = 0
' Salvo colonna 2
Dim valueCol2 As String = 0 & "," & 0 & "," & Map.refProjectVM.DynamicGrid.ColumnDefinitions(2).ActualWidth.ToString()
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueCol2, Map.refMainWindowVM.DimensionDir)
Index = 1
For i As Integer = 1 To Map.refProjectVM.DynamicGrid.RowDefinitions.Count - 1
Dim row = Map.refProjectVM.DynamicGrid.RowDefinitions(i)
Dim value As String = i.ToString() & "," & 1 & "," & row.ActualHeight.ToString()
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), value, Map.refMainWindowVM.DimensionDir)
Index += 1
Next
End Sub
Friend Sub RestoreGridLayout(GridTitle As String)
Dim Index As Integer = 0
Dim IndexRow As Integer = 1
Dim sValue = String.Empty
While EgtUILib.GetPrivateProfileString(GridTitle, Index.ToString(), String.Empty, sValue, Map.refMainWindowVM.DimensionDir) > 0
Dim sValueParams() As String = sValue.Split(","c)
If sValueParams.Count >= 3 Then
' cancello spazi
For I As Integer = 0 To sValueParams.Count - 1
sValueParams(I) = sValueParams(I).Trim()
Next
' creo valore
Dim nDimType As Integer
Dim GridLenValue As Double
Integer.TryParse(sValueParams(1), nDimType)
StringToDoubleAdv(sValueParams(2), GridLenValue)
If nDimType = 0 Then
Map.refProjectVM.DynamicGrid.ColumnDefinitions(2).Width = New GridLength(GridLenValue)
Else
Map.refProjectVM.DynamicGrid.RowDefinitions(IndexRow).Height = If(GridLenValue = 0, New GridLength(1, GridUnitType.Auto), New GridLength(GridLenValue))
IndexRow += 1
End If
End If
Index += 1
End While
End Sub
Friend Sub SaveMachiningGridLayout(MachGrid As Grid, GridTitle As String)
Dim Index As Integer = 0
' Salvo riga 0
Dim valueRow As String = Index & "," & Index & "," & MachGrid.RowDefinitions(Index).ActualHeight.ToString()
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueRow, Map.refMainWindowVM.DimensionDir)
End Sub
Friend Sub RestoreMachiningGridLayout(MachGrid As Grid, GridTitle As String)
Dim Index As Integer = 0
Dim sValue = String.Empty
While EgtUILib.GetPrivateProfileString(GridTitle, Index.ToString(), String.Empty, sValue, Map.refMainWindowVM.DimensionDir) > 0
Dim sValueParams() As String = sValue.Split(","c)
If sValueParams.Count >= 3 Then
' cancello spazi
For I As Integer = 0 To sValueParams.Count - 1
sValueParams(I) = sValueParams(I).Trim()
Next
' creo valore
Dim GridLenValue As Double
StringToDoubleAdv(sValueParams(2), GridLenValue)
MachGrid.RowDefinitions(0).Height = New GridLength(GridLenValue)
End If
Index += 1
End While
End Sub
Friend Sub SaveDrawGridLayout(MachGrid As Grid, RowId As String, GridTitle As String)
Dim Index As Integer = 0
Dim valueRow As String = String.Empty
' Salvo riga 0
If RowId = "ManageLayer" Then
valueRow = Index & "," & Index & "," & MachGrid.RowDefinitions(Index).ActualHeight.ToString()
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueRow, Map.refMainWindowVM.DimensionDir)
Else
Index = 1
valueRow = Index & "," & 0 & "," & MachGrid.RowDefinitions(Index).ActualHeight.ToString()
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueRow, Map.refMainWindowVM.DimensionDir)
End If
End Sub
Friend Sub RestoreDrawGridLayout(MachGrid As Grid, RowId As String, Index As Integer, GridTitle As String)
Dim sValue = String.Empty
EgtUILib.GetPrivateProfileString(GridTitle, Index.ToString(), String.Empty, sValue, Map.refMainWindowVM.DimensionDir)
Dim sValueParams() As String = sValue.Split(","c)
If sValueParams.Count >= 3 Then
' cancello spazi
For I As Integer = 0 To sValueParams.Count - 1
sValueParams(I) = sValueParams(I).Trim()
Next
' creo valore
Dim GridLenValue As Double
StringToDoubleAdv(sValueParams(2), GridLenValue)
If RowId = "ManageLayer" Then
MachGrid.RowDefinitions(0).Height = New GridLength(GridLenValue)
Else
MachGrid.RowDefinitions(1).Height = New GridLength(GridLenValue)
End If
End If
End Sub
End Module