diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb index ccfdf11..c8c9761 100644 --- a/Constants/ConstMsg.vb +++ b/Constants/ConstMsg.vb @@ -14,6 +14,7 @@ Public Const MSG_TOOLSDBPAGE As Integer = MSG_EGTCAM5 + 1000 Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1100 Public Const MSG_MACHININGSDBPAGE As Integer = MSG_EGTCAM5 + 1200 + Public Const MSG_MACHININGDB As Integer = MSG_EGTWPFLIB5 + 1200 Public Const MSG_MACHININGSERRORS As Integer = MSG_EGTCAM5 + 1370 Public Const MSG_MACHININGOPTIONPAGE As Integer = MSG_EGTCAM5 + 1400 Public Const MSG_SETUP As Integer = MSG_EGTCAM5 + 1450 diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index f4c49c0..10796fd 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -155,6 +155,45 @@ CurrSetUpV.xaml + + StoneMillingParameterExpanderV.xaml + + + ChiselingParameterExpanderV.xaml + + + StoneSawRoughingParameterExpanderV.xaml + + + StoneSawFinishingParameterExpanderV.xaml + + + StoneDrillingParameterExpanderV.xaml + + + WoodDrillingParameterExpanderV.xaml + + + PocketingParameterExpanderV.xaml + + + MortisingParameterExpanderV.xaml + + + BeamMillingParameterExpanderV.xaml + + + WaterjettingParameterExpanderV.xaml + + + WoodMillingParameterExpanderV.xaml + + + WoodSawingParameterExpanderV.xaml + + + StoneSawingParameterExpanderV.xaml + MachineBox.xaml @@ -374,6 +413,58 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile Designer diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 6120414..b55fcf3 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml new file mode 100644 index 0000000..b27474c --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml @@ -0,0 +1,322 @@ + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb new file mode 100644 index 0000000..bab97ca --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/BeamMillingParameterExpanderV.xaml.vb @@ -0,0 +1,83 @@ +Imports EgtWPFLib5 +Imports EgtWPFLib5.EgtFloating + +Public Class BeamMillingParameterExpanderV + + Private EgtFloatingTray As EgtFloatingTray + Private EgtFloatingPanel As EgtFloatingPanel + + Private m_bFirst As Boolean = True + + Private Sub OperationExpanderView_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded + If m_bFirst Then + EgtFloatingTray = FindAncestor(Of EgtFloatingTray)(Me) + EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me) + AddHandler EgtFloatingTray.SizeChanged, AddressOf EgtFloatingTray_SizeChanged + PanelHeight = EgtFloatingPanel.ActualHeight + Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight + m_bFirst = False + End If + CalculateOperationParametersStackPanelMaxHeight() + End Sub + + Dim m_bSizeChanging As Boolean = False + + Private Sub EgtFloatingTray_SizeChanged(sender As Object, e As System.Windows.SizeChangedEventArgs) + If m_bSizeChanging Then Return + m_bSizeChanging = True + CalculateOperationParametersStackPanelMaxHeight() + m_bSizeChanging = False + End Sub + + Dim PanelHeight As Double = 0 + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + + Private Sub CalculateOperationParametersStackPanelMaxHeight() + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + Dim OpenedExpanderList As New List(Of Boolean) + For Index = 0 To AutomaticCloseExpanderStackPanel.Children.Count - 1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If IndexedExpander.IsExpanded Then + OpenedExpanderList.Add(True) + IndexedExpander.IsExpanded = False + Dim CurrExpanderContent As FrameworkElement = DirectCast(IndexedExpander.Content, FrameworkElement) + CurrExpanderContent.Measure(New Size(Double.PositiveInfinity, Double.PositiveInfinity)) + AutomaticCloseExpanderStackPanelHeight -= CurrExpanderContent.DesiredSize.Height + ' Sottraggo anche i padding + AutomaticCloseExpanderStackPanelHeight -= (IndexedExpander.Padding.Top + IndexedExpander.Padding.Bottom) + Else + OpenedExpanderList.Add(False) + End If + Else + OpenedExpanderList.Add(False) + End If + Next + Dim RemainingHeight As Double = EgtFloatingTray.ActualHeight - PanelHeight + AutomaticCloseExpanderStackPanel.MaxHeight = Me.AutomaticCloseExpanderStackPanelHeight + RemainingHeight + For Index = AutomaticCloseExpanderStackPanel.Children.Count - 1 To 0 Step -1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If OpenedExpanderList(Index) Then + IndexedExpander.IsExpanded = True + End If + End If + Next + End Sub + + ' Funzione che permette di trovare il primo contenitore di tipo T di un elemento grafico dependencyObject + Public Function FindAncestor(Of T As Class)(dependencyObject As DependencyObject) As T + Dim target As DependencyObject = dependencyObject + Do + target = LogicalTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + If IsNothing(target) Then + target = dependencyObject + Do + target = VisualTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + End If + Return TryCast(target, T) + End Function + +End Class diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml new file mode 100644 index 0000000..f627324 --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml @@ -0,0 +1,232 @@ + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb new file mode 100644 index 0000000..a89818a --- /dev/null +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/ChiselingParameterExpanderV.xaml.vb @@ -0,0 +1,83 @@ +Imports EgtWPFLib5 +Imports EgtWPFLib5.EgtFloating + +Public Class ChiselingParameterExpanderV + + Private EgtFloatingTray As EgtFloatingTray + Private EgtFloatingPanel As EgtFloatingPanel + + Private m_bFirst As Boolean = True + + Private Sub OperationExpanderView_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded + If m_bFirst Then + EgtFloatingTray = FindAncestor(Of EgtFloatingTray)(Me) + EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me) + AddHandler EgtFloatingTray.SizeChanged, AddressOf EgtFloatingTray_SizeChanged + PanelHeight = EgtFloatingPanel.ActualHeight + Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight + m_bFirst = False + End If + CalculateOperationParametersStackPanelMaxHeight() + End Sub + + Dim m_bSizeChanging As Boolean = False + + Private Sub EgtFloatingTray_SizeChanged(sender As Object, e As System.Windows.SizeChangedEventArgs) + If m_bSizeChanging Then Return + m_bSizeChanging = True + CalculateOperationParametersStackPanelMaxHeight() + m_bSizeChanging = False + End Sub + + Dim PanelHeight As Double = 0 + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + + Private Sub CalculateOperationParametersStackPanelMaxHeight() + Dim AutomaticCloseExpanderStackPanelHeight As Double = 0 + Dim OpenedExpanderList As New List(Of Boolean) + For Index = 0 To AutomaticCloseExpanderStackPanel.Children.Count - 1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If IndexedExpander.IsExpanded Then + OpenedExpanderList.Add(True) + IndexedExpander.IsExpanded = False + Dim CurrExpanderContent As FrameworkElement = DirectCast(IndexedExpander.Content, FrameworkElement) + CurrExpanderContent.Measure(New Size(Double.PositiveInfinity, Double.PositiveInfinity)) + AutomaticCloseExpanderStackPanelHeight -= CurrExpanderContent.DesiredSize.Height + ' Sottraggo anche i padding + AutomaticCloseExpanderStackPanelHeight -= (IndexedExpander.Padding.Top + IndexedExpander.Padding.Bottom) + Else + OpenedExpanderList.Add(False) + End If + Else + OpenedExpanderList.Add(False) + End If + Next + Dim RemainingHeight As Double = EgtFloatingTray.ActualHeight - PanelHeight + AutomaticCloseExpanderStackPanel.MaxHeight = Me.AutomaticCloseExpanderStackPanelHeight + RemainingHeight + For Index = AutomaticCloseExpanderStackPanel.Children.Count - 1 To 0 Step -1 + If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then + Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander) + If OpenedExpanderList(Index) Then + IndexedExpander.IsExpanded = True + End If + End If + Next + End Sub + + ' Funzione che permette di trovare il primo contenitore di tipo T di un elemento grafico dependencyObject + Public Function FindAncestor(Of T As Class)(dependencyObject As DependencyObject) As T + Dim target As DependencyObject = dependencyObject + Do + target = LogicalTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + If IsNothing(target) Then + target = dependencyObject + Do + target = VisualTreeHelper.GetParent(target) + Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T) + End If + Return TryCast(target, T) + End Function + +End Class diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml index b027228..61333e7 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderV.xaml @@ -75,490 +75,24 @@ 63 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - +