From 06429829738beed0c3516b51ef6b6de9b04fac9b Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 9 Jun 2026 08:35:04 +0200 Subject: [PATCH 1/8] EgtBEAMWALL 3.1.6.1: -cambio versione -cambiate le tabelle con devexpress --- EgtBEAMWALL.Core/My Project/AssemblyInfo.vb | 6 +- EgtBEAMWALL.Core/Themes/Generic.xaml | 1 + .../Properties/AssemblyInfo.cs | 4 +- .../GeneralParametersStrategyVM.vb | 1 + .../ItemParamList/BTLPartListV.xaml.vb | 24 +- .../FeatureInPartInRawPartListV.xaml | 202 ++++++++-------- .../FeatureInPartInRawPartListV.xaml.vb | 112 ++++++++- .../FeatureInPartInRawPartListVM.vb | 2 + .../ItemParamList/PParameterListV.xaml | 97 +++++++- .../ItemParamList/PParameterListV.xaml.vb | 114 ++++++++- .../ItemParamList/PParameterListVM.vb | 2 + .../ItemParamList/RawPartListV.xaml | 14 +- .../ItemParamList/RawPartListV.xaml.vb | 32 +-- .../MachGroupPanel/MyMachGroupPanelVM.vb | 7 + .../MainWindow/MainWindowM.vb | 4 +- .../My Project/AssemblyInfo.vb | 4 +- EgtBEAMWALL.Optimizer/Project/ProjectVM.vb | 2 + .../Statistics/OptimizerStatisticsV.xaml | 64 ++++- .../Statistics/OptimizerStatisticsV.xaml.vb | 125 +++++++++- .../Statistics/StatisticsV.xaml | 226 +++++++----------- .../Statistics/StatisticsV.xaml.vb | 146 ++++++++++- .../Statistics/StatisticsVM.vb | 7 + .../Comms/SIEMENSSharp7Comm.vb | 1 + .../MainWindow/MainWindowM.vb | 4 +- .../My Project/AssemblyInfo.vb | 4 +- 25 files changed, 903 insertions(+), 302 deletions(-) diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index a7df1fac..d32dd49b 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -17,7 +17,7 @@ Imports System.Windows - + @@ -38,5 +38,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.Core/Themes/Generic.xaml b/EgtBEAMWALL.Core/Themes/Generic.xaml index 28080654..cfab2853 100644 --- a/EgtBEAMWALL.Core/Themes/Generic.xaml +++ b/EgtBEAMWALL.Core/Themes/Generic.xaml @@ -1925,6 +1925,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb index 2a9b46da..222816b8 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb @@ -1,7 +1,117 @@ -Imports EgtBEAMWALL.Core +Imports System.IO +Imports DevExpress.Xpf.Bars +Imports DevExpress.Xpf.Core.Serialization +Imports DevExpress.Xpf.Grid +Imports EgtBEAMWALL.Core Public Class FeatureInPartInRawPartListV + Private m_FeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM + Private m_sDataGridLayoutPath As String = "" + + Sub New() + + ' This call is required by the designer. + InitializeComponent() + + ' Add any initialization after the InitializeComponent() call. + m_sDataGridLayoutPath = Path.GetDirectoryName(DataGridColumnsIniFile.m_sDataGridColumnsIniFile) & "\NewDataGridLayoutFile3.json" + + For Each Column In FeatureVMList_GridControl.Columns + Column.[AddHandler](DXSerializer.AllowPropertyEvent, + New AllowPropertyEventHandler(AddressOf OnAllowProperty)) + Next + + FeatureVMList_GridControl.Columns("sPriority").Visible = False + + DXSerializer.AddAllowPropertyHandler(FeatureVMList_GridControl, AddressOf OnAddAllowProperty) + End Sub + + ' imposto parametri da aggiungere o togliere in Json tabella per i parametri di colonna + Private Sub OnAllowProperty(sender As Object, e As AllowPropertyEventArgs) + If e.DependencyProperty Is GridColumn.AllowResizingProperty Then + e.Allow = True + End If + End Sub + + ' imposto parametri da aggiungere o togliere in Json tabella per i parametri generali + Private Sub OnAddAllowProperty(sender As Object, e As AllowPropertyEventArgs) + If e.Property.Name = "FilterString" Then + e.Allow = False + ElseIf e.Property.Name = "MRUFilters" Then + e.Allow = False + ElseIf e.Property.Name = "MRUFilterList" Then + e.Allow = False + ElseIf e.Property.Name = "GroupSummarySortInfo" Then + e.Allow = False + End If + End Sub + + ' salvataggio del layout colonne + Public Sub SaveStatisticGridControlLayout() + FeatureVMList_GridControl.SaveLayoutToJson(m_sDataGridLayoutPath) + End Sub + + Public Sub Me_Loaded() Handles Me.Loaded + ' imposto DataContext + m_FeatureInPartInRawPartListVM = Me.DataContext + ' imposto riferimento ad action per salvataggio layout tabella + m_FeatureInPartInRawPartListVM.refFeatureInPartInRawPartListGridControlLayout = AddressOf SaveStatisticGridControlLayout + ' rispristino layout tabella + If Not IsNothing(m_sDataGridLayoutPath) AndAlso File.Exists(m_sDataGridLayoutPath) Then + FeatureVMList_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath) + End If + ' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo + End Sub + + Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) + If e.MenuType = GridMenuType.Column Then + ' rimozione bottoni + e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupBox}) + e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.GroupColumn}) + e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.ColumnChooser}) + e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFit}) + e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNames.BestFitColumns}) + e.Customizations.Add(New RemoveAction() With {.ElementName = DefaultColumnMenuItemNamesBase.FilterEditor}) + + Dim info As GridColumnMenuInfo = CType(e.MenuInfo, GridColumnMenuInfo) + Dim item As ColumnBase = CType(info.Column, ColumnBase) + ' aggiunta separatore + Dim separator As BarItemLinkSeparator = New BarItemLinkSeparator() + e.Customizations.Add(separator) + ' aggiunta bottone AllowResize e Auto Fit + Dim AllowResize As BarCheckItem = New BarCheckItem() With {.Content = "Allow Resize", .IsChecked = (FeatureVMList_TableView.AllowResizing AndAlso (item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default))} + AddHandler AllowResize.CheckedChanged, AddressOf AllowResize_CheckedChanged + e.Customizations.Add(AllowResize) + If item.AllowResizing = DevExpress.Utils.DefaultBoolean.True OrElse item.AllowResizing = DevExpress.Utils.DefaultBoolean.Default Then + Dim FixAuto As BarButtonItem = New BarCheckItem() With {.Content = "Auto Fit"} + AddHandler FixAuto.ItemClick, AddressOf FixAuto_ItemClick + e.Customizations.Add(FixAuto) + End If + End If + End Sub + + ' gestore evento Allow Resize + Private Sub AllowResize_CheckedChanged(sender As Object, e As ItemClickEventArgs) + Dim info As GridColumnMenuInfo = TryCast(FeatureVMList_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) + Dim item As ColumnBase = CType(info.Column, ColumnBase) + If item.AllowResizing = DevExpress.Utils.DefaultBoolean.False Then + item.AllowResizing = DevExpress.Utils.DefaultBoolean.True + Else + item.AllowResizing = DevExpress.Utils.DefaultBoolean.False + End If + End Sub + + ' gestore evento Auto Fit + Private Sub FixAuto_ItemClick(sender As Object, e As ItemClickEventArgs) + Dim info As GridColumnMenuInfo = TryCast(FeatureVMList_TableView.GridMenu.MenuInfo, GridColumnMenuInfo) + Dim item As ColumnBase = CType(info.Column, ColumnBase) + item.Width = New GridColumnWidth(1, GridColumnUnitType.Auto) + FeatureVMList_TableView.UpdateLayout() + item.Width = item.ActualWidth + item.AllowResizing = DevExpress.Utils.DefaultBoolean.False + End Sub + ' funzione che impedisce di editare le righe che sono gia' in produzione Private Sub FeatureInPartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs) If IsNothing(e.Row) Then Return diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb index ad13c556..bc7a1730 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListVM.vb @@ -8,6 +8,8 @@ Public Class FeatureInPartInRawPartListVM #Region "FIELDS & PROPERTIES" + Public refFeatureInPartInRawPartListGridControlLayout As Action + Private m_colFeatureInPartInRawPart_Do As EgwWPFBaseLib.ColumnLayout Public ReadOnly Property colFeatureInPartInRawPart_Do As EgwWPFBaseLib.ColumnLayout Get diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml index 5302a5dc..cdcf65f2 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/PParameterListV.xaml @@ -2,9 +2,22 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer" - xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"> + xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib" + xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" + xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" + xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" + xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" + xmlns:dxeh="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal" + xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys" + xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" + xmlns:dxfui="http://schemas.devexpress.com/winfx/2008/xaml/core/filteringui" + xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal" + xmlns:i="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"> + + + @@ -13,7 +26,73 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom @@ -48,7 +127,7 @@ - + Nome @@ -56,7 +135,7 @@ - + Descrizione @@ -92,7 +171,7 @@ - + Valore @@ -107,7 +186,7 @@ - + Minimo @@ -115,7 +194,7 @@ - + Massimo @@ -124,7 +203,7 @@ - + --> - + diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb index 222816b8..50978371 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb @@ -62,6 +62,7 @@ Public Class FeatureInPartInRawPartListV FeatureVMList_GridControl.RestoreLayoutFromJson(m_sDataGridLayoutPath) End If ' da gestire chiamandolo quando viene aperto un progetto o aggiunto/rimosso un btl, per evitare che ci sia il GroupSummary se c'e' un solo gruppo + FeatureVMList_TableView.ShowGroupFooters = False End Sub Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml index eaf4fdd3..a1eb411e 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/RawPartListV.xaml @@ -295,11 +295,14 @@ + Style="{StaticResource ColumnInfoStyle}"> + + + + Y!3-oN%d?Gu6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(Kwg8_H*Z=?j1DT-L15RjOeSEA?V8lqsTXQ*drB+Teu0#vjkHNrE^(^HFq1IS@z zkYZ$IU<9&2hDt-(Am?f@GK0mLfNVoXCI+BI3{gOw+0FtM&jGSQKwpxP;RVoFFdE%f z1_q$y1a<}%pjrbXV*|zo5OYCxvMzv_H4VrH0VbfyOkkBkmKH!3RF|QF0Z6vXkTZ1= zSEUD#S?1~D7-Hdn_kuTHg8~mrz@Gn0ec!0REjhNqC7p5W9)?Zp*6QSZsA*iwv8H;D z?{)9XTy1X}R-C?Z`JF=K{#8jIoSPbjctq2k1Izopr05IoyivR!s literal 0 HcmV?d00001 diff --git a/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml.vb b/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml.vb index d094be67..04e6243d 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/OptimizerStatisticsV.xaml.vb @@ -98,6 +98,11 @@ Public Class OptimizerStatisticsV Private Sub PrintBtn_Click(sender As Object, e As RoutedEventArgs) Handles CopyToClipboardBtn.Click m_StatisticsVM = Me.DataContext() 'CopyToClipboard(dgOptimizerStatistics, dgRawPartStatistics, m_StatisticsVM) + If Map.refStatisticsVM.bRawPart_IsChecked Then + dgRawPartStatistics_GridControl.CopyToClipboard() + Else + dgOptimizerStatistics_GridControl.CopyToClipboard() + End If End Sub Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) diff --git a/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb b/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb index 8b6932c8..1d491573 100644 --- a/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Statistics/StatisticsV.xaml.vb @@ -99,6 +99,7 @@ Public Class StatisticsV Private Sub PrintBtn_Click(sender As Object, e As RoutedEventArgs) Handles CopyToClipboardBtn.Click m_StatisticsVM = Me.DataContext() 'ExportToExcelAndCsv(dgStatistics, m_StatisticsVM) + dgStatistics_GridControl.CopyToClipboard() End Sub Private Sub OnShowGridMenu(sender As Object, e As DevExpress.Xpf.Grid.GridMenuEventArgs) From 6d7b141042fbe2f758bfdb4bb99035fa8fa5ab80 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 11 Jun 2026 10:24:36 +0200 Subject: [PATCH 5/8] -aggiunto immagine --- EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml b/EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml index 51969070..a0d71cf9 100644 --- a/EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml +++ b/EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml @@ -70,6 +70,7 @@ + From 096b9a5933f9aec869a5ebd248523709dcf6637f Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 15 Jun 2026 15:42:53 +0200 Subject: [PATCH 6/8] EgtBEAMWALL 3.1.6.2: -sistemato canc in btlpartlistv --- EgtBEAMWALL.Core/My Project/AssemblyInfo.vb | 4 +- .../Properties/AssemblyInfo.cs | 4 +- .../AboutBoxWindow/AboutBoxV.xaml.vb | 1 - .../ItemParamList/BTLPartListV.xaml | 48 ++++--- .../ItemParamList/BTLPartListV.xaml.vb | 55 +++++--- .../LeftPanel/LeftPanelV.xaml | 133 +----------------- .../LeftPanel/LeftPanelV.xaml.vb | 4 + .../MainWindow/MainWindowV.xaml | 2 +- .../MainWindow/MainWindowV.xaml.vb | 8 ++ .../My Project/AssemblyInfo.vb | 4 +- .../Panel/LeftPanelTopV.xaml | 2 +- .../Panel/LeftPanelTopV.xaml.vb | 4 + EgtBEAMWALL.Optimizer/Project/ProjectV.xaml | 2 +- .../Project/ProjectV.xaml.vb | 4 + EgtBEAMWALL.Optimizer/Utility/Dictionary.xaml | 2 +- .../My Project/AssemblyInfo.vb | 4 +- 16 files changed, 94 insertions(+), 187 deletions(-) diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index d32dd49b..3a6f6d5a 100644 --- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb @@ -38,5 +38,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs index 17cbe859..f8a2648d 100644 --- a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs +++ b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.6.1")] -[assembly: AssemblyFileVersion("3.1.6.1")] +[assembly: AssemblyVersion("3.1.6.2")] +[assembly: AssemblyFileVersion("3.1.6.2")] diff --git a/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb b/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb index b94be8ed..71fe6687 100644 --- a/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/AboutBoxWindow/AboutBoxV.xaml.vb @@ -1,5 +1,4 @@ Imports EgtUILib -Imports EgtBEAMWALL.Core Public Class AboutBoxV diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml index ef7e82a9..deacc72e 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml @@ -1,21 +1,21 @@ - - + + @@ -26,7 +26,7 @@ - + @@ -97,10 +97,12 @@ SelectionMode="Row" SelectedItems="{Binding Tag.SelBTLParts, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:BTLPartListV}}}" - MasterRowExpanding="GridControl_MasterRowExpanding"> + MasterRowExpanding="GridControl_MasterRowExpanding" + CurrentItemChanged="BTLPart_GridControl_CurrentItemChanged"> @@ -558,5 +561,4 @@ - - + diff --git a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb index 5c9e4dc0..3b41ed8d 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/BTLPartListV.xaml.vb @@ -18,6 +18,8 @@ Public Class BTLPartListV Private _lastExpanded As Integer = -1 + Private bSelOnFeature As Boolean = False + Sub New() ' This call is required by the designer. InitializeComponent() @@ -160,25 +162,6 @@ Public Class BTLPartListV End If End Sub - Private Sub PartList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) - If e.ChangedButton = MouseButton.Left Then - If TypeOf sender Is DataGridRow Then - If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count <> 1 Then Return - Dim Row As DataGridRow = DirectCast(sender, DataGridRow) - If TypeOf Row.DataContext IsNot BTLPartVM Then Return - Dim BTLPartVM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM) - Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource) - If Not IsNothing(DataGridDetailsPresenter) Then Return - If Map.refProjectVM.BTLStructureVM.SelBTLParts.Contains(BTLPartVM) Then - BTLPartVM.SetOpenFeatureList(Not BTLPartVM.bOpenFeatureList) - End If - If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLPart.Equals(BTLPartVM) Then - Map.refProjectVM.BTLStructureVM.SelectBTLPart(BTLPartVM, True) - End If - End If - End If - End Sub - Private Sub ListBox_PreviewMouseWheel(ByVal sender As Object, ByVal e As MouseWheelEventArgs) ' gestione dello scroll, per permetterlo anche quando mouse su RowDetails e.Handled = True @@ -261,6 +244,40 @@ Public Class BTLPartListV _lastExpanded = e.RowHandle End Sub + Private Sub BTLPart_TableView_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + bSelOnFeature = False + End Sub + + Private Sub ListBox_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + bSelOnFeature = True + End Sub + + Public Sub HandleDelete(e As KeyEventArgs) + Dim BTLStructureVM As BTLStructureVM = TryCast(Me.Tag, BTLStructureVM) + If IsNothing(BTLStructureVM) Then Return + + Dim SelBTLPart As BTLPartVM = BTLStructureVM.SelBTLPart + Dim SelBTLFeatureVM As BTLFeatureVM = SelBTLPart?.SelBTLFeatureVM + + If bSelOnFeature AndAlso Not IsNothing(SelBTLFeatureVM) Then + If SelBTLFeatureVM.DeleteFeature_Command.CanExecute(Nothing) Then + SelBTLFeatureVM.DeleteFeature_Command.Execute(Nothing) + e.Handled = True + End If + Return + End If + + If BTLStructureVM.DeletePart_Command.CanExecute(Nothing) Then + BTLStructureVM.DeletePart_Command.Execute(Nothing) + e.Handled = True + End If + + End Sub + + Private Sub BTLPart_GridControl_CurrentItemChanged(sender As Object, e As CurrentItemChangedEventArgs) + CType(e.Source, GridControl).View.FocusedRowHandle = -1 + End Sub + End Class Public Class SettingsBtnVerticalOffsetMultiConverter diff --git a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml index c545f707..05ef648d 100644 --- a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml +++ b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml @@ -18,139 +18,8 @@ Grid.ColumnSpan="2" Style="{StaticResource Optimizer_Border}"/> - - diff --git a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb index 919aa0c7..6a4b9662 100644 --- a/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/LeftPanel/LeftPanelV.xaml.vb @@ -1,3 +1,7 @@ Public Class LeftPanelV + Public Sub ForwardDelete(e As KeyEventArgs) + PartList.HandleDelete(e) + End Sub + End Class diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml index 4822daa3..c6a4030a 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml @@ -26,7 +26,7 @@ - + diff --git a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb index f1dcb384..e7a484d1 100644 --- a/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/MainWindow/MainWindowV.xaml.vb @@ -22,12 +22,20 @@ Public Class MainWindowV Me.SetPlacementAppName(S_GENERAL) Me.SetPlacementKeyName(K_WINPLACE) Me.SetPlacementFileName(IniFile.m_sIniFile) + + Me.AddHandler(Keyboard.KeyDownEvent, New KeyEventHandler(AddressOf Global_KeyDown), True) End Sub #End Region ' CONSTRUCTOR #Region "EVENTS" + Private Sub Global_KeyDown(sender As Object, e As KeyEventArgs) + If e.Key = Key.Delete Then + ProjectView.ForwardDelete(e) + End If + End Sub + Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) ' Carico e imposto posizione finestra WinPosFromIniToWindow(S_GENERAL, K_VIEWOPTIMWINPLACE, Me) diff --git a/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb index a984e93b..9bec1b8f 100644 --- a/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb +++ b/EgtBEAMWALL.Optimizer/My Project/AssemblyInfo.vb @@ -67,5 +67,5 @@ Imports System.Windows ' Revision ' - - + + diff --git a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml index a076e010..5017063d 100644 --- a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml +++ b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml @@ -7,7 +7,7 @@ - diff --git a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb index 31d1f74a..99bd386b 100644 --- a/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/Panel/LeftPanelTopV.xaml.vb @@ -1,3 +1,7 @@ Public Class LeftPanelTopV + Public Sub ForwardDelete(e As KeyEventArgs) + LeftPanel.ForwardDelete(e) + End Sub + End Class diff --git a/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml b/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml index c8bb442f..8051d7aa 100644 --- a/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml +++ b/EgtBEAMWALL.Optimizer/Project/ProjectV.xaml @@ -18,7 +18,7 @@ - + - +