diff --git a/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb b/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb index ea87e2f1..923258ec 100644 --- a/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb +++ b/EgtBEAMWALL.Core/EgtMessageBox/EgtMessageBoxV.xaml.vb @@ -1,5 +1,6 @@ -Imports EgtWPFLib5 -Imports System.Windows +Imports System.Windows +Imports System.Windows.Threading +Imports EgtWPFLib5 Public Class EgtMessageBoxV @@ -25,6 +26,18 @@ Public Class EgtMessageBoxV #Region "METHODS" + Protected Overrides Sub OnSourceInitialized(e As EventArgs) + MyBase.OnSourceInitialized(e) + Me.WindowStartupLocation = WindowStartupLocation.CenterScreen + End Sub + + Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded + Dispatcher.BeginInvoke(Sub() + Me.Topmost = True + Me.Activate() + End Sub, DispatcherPriority.ContextIdle) + End Sub + ''' ''' Apre una EgtMessageBox con un messaggio che ritorna un risultato ''' diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb index a7df1fac..3a6f6d5a 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..50978371 100644 --- a/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb +++ b/EgtBEAMWALL.Optimizer/ItemParamList/FeatureInPartInRawPartListV.xaml.vb @@ -1,7 +1,118 @@ -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 + FeatureVMList_TableView.ShowGroupFooters = False + 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..961b3160 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,118 +26,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + Style="{StaticResource EditTableViewStyle}"> @@ -40,7 +41,9 @@ - + + Style="{StaticResource EditTableViewStyle}"> + AllowColumnFiltering="False" + AllowEditing="False"> @@ -98,11 +104,13 @@ Header="{Binding NAM_Msg}" AllowSorting="False" FilterPopupMode="CheckedList" + AllowEditing="False" Style="{StaticResource ColumnInfoStyle}"/> @@ -127,6 +136,7 @@ Style="{StaticResource Rotate_TextBlock}"/>