diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb
index e68b058..fb43a0a 100644
--- a/Constants/ConstGen.vb
+++ b/Constants/ConstGen.vb
@@ -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
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index a02b479..7fb7837 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -322,6 +322,7 @@
+
diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb
index fc92104..ec23db5 100644
--- a/MainWindow/MainWindowVM.vb
+++ b/MainWindow/MainWindowVM.vb
@@ -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
diff --git a/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderV.xaml b/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderV.xaml
index 723305f..67cb498 100644
--- a/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderV.xaml
+++ b/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderV.xaml
@@ -8,7 +8,7 @@
-
diff --git a/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderVM.vb b/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderVM.vb
index 4d7d69a..8e7c725 100644
--- a/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderVM.vb
+++ b/OptionPanel/DrawOptionPanel/InfoExpander/InfoExpanderVM.vb
@@ -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
diff --git a/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb b/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb
index 19480e3..1fe2e5d 100644
--- a/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb
+++ b/OptionPanel/DrawOptionPanel/ManageLayerExpander/LayerTreeView.vb
@@ -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)
diff --git a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml
index 29e5dce..663f881 100644
--- a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml
+++ b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderV.xaml
@@ -5,7 +5,7 @@
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:local="clr-namespace:EgtCAM5">
-
+
@@ -13,7 +13,11 @@
-
+
+
+
+
+
@@ -21,7 +25,7 @@
-
@@ -116,6 +120,6 @@
-
+
diff --git a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb
index 9748c8e..7dd752d 100644
--- a/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb
+++ b/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderVM.vb
@@ -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
diff --git a/OptionPanel/DrawOptionPanelV.xaml b/OptionPanel/DrawOptionPanelV.xaml
index 8072f0c..b32bf3a 100644
--- a/OptionPanel/DrawOptionPanelV.xaml
+++ b/OptionPanel/DrawOptionPanelV.xaml
@@ -1,15 +1,27 @@
-
+
+
+
+
+
+
-
+
+
-
+
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/OptionPanel/DrawOptionPanelV.xaml.vb b/OptionPanel/DrawOptionPanelV.xaml.vb
index da226b1..22e893c 100644
--- a/OptionPanel/DrawOptionPanelV.xaml.vb
+++ b/OptionPanel/DrawOptionPanelV.xaml.vb
@@ -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
diff --git a/OptionPanel/DrawOptionPanelVM.vb b/OptionPanel/DrawOptionPanelVM.vb
index 56dbea7..3f3cd9f 100644
--- a/OptionPanel/DrawOptionPanelVM.vb
+++ b/OptionPanel/DrawOptionPanelVM.vb
@@ -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
\ No newline at end of file
diff --git a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderV.xaml
index 830a1cf..99df5a6 100644
--- a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderV.xaml
+++ b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderV.xaml
@@ -1,177 +1,176 @@
+ 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">
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
diff --git a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
index 74c9652..bc6cb3a 100644
--- a/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
+++ b/OptionPanel/MachiningOptionPanel/OperationsListExpander/OperationsListExpanderVM.vb
@@ -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
diff --git a/OptionPanel/MachiningOptionPanelV.xaml b/OptionPanel/MachiningOptionPanelV.xaml
index 28b98ea..6e8e10c 100644
--- a/OptionPanel/MachiningOptionPanelV.xaml
+++ b/OptionPanel/MachiningOptionPanelV.xaml
@@ -1,24 +1,35 @@
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
-
+
diff --git a/OptionPanel/MachiningOptionPanelV.xaml.vb b/OptionPanel/MachiningOptionPanelV.xaml.vb
index 7e54d5c..1be084a 100644
--- a/OptionPanel/MachiningOptionPanelV.xaml.vb
+++ b/OptionPanel/MachiningOptionPanelV.xaml.vb
@@ -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
diff --git a/OptionPanel/MachiningOptionPanelVM.vb b/OptionPanel/MachiningOptionPanelVM.vb
index 6c2889d..7a4cb27 100644
--- a/OptionPanel/MachiningOptionPanelVM.vb
+++ b/OptionPanel/MachiningOptionPanelVM.vb
@@ -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
\ No newline at end of file
diff --git a/OptionPanel/OptionPanelV.xaml b/OptionPanel/OptionPanelV.xaml
index 4ec1a1c..c593a21 100644
--- a/OptionPanel/OptionPanelV.xaml
+++ b/OptionPanel/OptionPanelV.xaml
@@ -1,6 +1,6 @@
diff --git a/OptionPanel/OptionPanelVM.vb b/OptionPanel/OptionPanelVM.vb
index fb804aa..8f3f5b2 100644
--- a/OptionPanel/OptionPanelVM.vb
+++ b/OptionPanel/OptionPanelVM.vb
@@ -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
diff --git a/Project/ProjectV.xaml b/Project/ProjectV.xaml
index 234c847..b71960a 100644
--- a/Project/ProjectV.xaml
+++ b/Project/ProjectV.xaml
@@ -13,7 +13,7 @@
diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb
index a19aee8..d4166e7 100644
--- a/Project/ProjectVM.vb
+++ b/Project/ProjectVM.vb
@@ -1,7 +1,7 @@
-Imports System.Windows.Forms.Integration
-Imports System.Windows.Interop
+Imports System.Globalization
Imports System.IO
-Imports System.Globalization
+Imports System.Windows.Forms.Integration
+Imports System.Windows.Interop
Imports EgtUILib
Imports EgtWPFLib5
@@ -57,9 +57,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
@@ -79,6 +85,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 = {}
@@ -105,12 +122,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
@@ -118,17 +140,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
@@ -222,14 +271,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
@@ -387,9 +436,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)
@@ -1134,7 +1183,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
@@ -1232,7 +1281,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
diff --git a/RightTray/RightTrayV.xaml b/RightTray/RightTrayV.xaml
index 2562feb..9fea2f9 100644
--- a/RightTray/RightTrayV.xaml
+++ b/RightTray/RightTrayV.xaml
@@ -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">
diff --git a/Utility/Dictionary.xaml b/Utility/Dictionary.xaml
index 900630b..21795ce 100644
--- a/Utility/Dictionary.xaml
+++ b/Utility/Dictionary.xaml
@@ -1276,7 +1276,7 @@
+
+
+
+
+
+
diff --git a/Utility/DynamicGridModule.vb b/Utility/DynamicGridModule.vb
new file mode 100644
index 0000000..2f8690a
--- /dev/null
+++ b/Utility/DynamicGridModule.vb
@@ -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"
+
+ '''
+ ''' Funzione per popolare la griglia
+ '''
+ '''
+ '''
+ '''
+ '''
+ '''
+ '''
+ 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
+
+ '''
+ ''' Funzione per popolare la griglia con PlugIn
+ '''
+ '''
+ '''
+ '''
+ '''
+ '''
+ 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
+
+ '''
+ ''' Creazione GridSplitter
+ '''
+ '''
+ 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
+
+ '''
+ ''' Creazione Griglia Dinamica
+ '''
+ 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