From 187394102ee6e9b24a30e7789baf5fe766c35588 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 14 May 2026 14:37:42 +0200 Subject: [PATCH] -ripristinato finestre dialog e messagebox --- Icarus/ChooseMachineWnd/ChooseMachineWndVM.vb | 3 +- .../ImportExportMachiningPanelVM.vb | 36 +--- Icarus/InstrumentPanel/MyInstrumentPanelVM.vb | 5 +- Icarus/MachSaveInDbWnd/MachSaveInDbWndVM.vb | 3 +- Icarus/MachiningDb/Machining.vb | 22 +-- Icarus/MachiningDb/MachiningDbVM.vb | 23 +-- Icarus/MainWindow/MainWindowVM.vb | 3 +- Icarus/ManagePartPanel/ManagePartPanelVM.vb | 3 +- Icarus/ManagePartPanel/ManagePartUtility.vb | 6 +- Icarus/MaterialDb/Material.vb | 3 +- Icarus/MaterialDb/MaterialDbVM.vb | 39 ++-- Icarus/OptionsWindow/OptionWindowVM.vb | 56 ++---- Icarus/ProjManager/ProjManagerVM.vb | 26 +-- Icarus/RibParamPanel/CopyFromWndVM.vb | 3 +- Icarus/SceneHost/MySceneHostVM.vb | 171 ++++++------------ Icarus/SecondaryWindow/SecondaryWindowVM.vb | 3 +- Icarus/SimulationPanel/SimulationPanelVM.vb | 16 +- Icarus/SliceManager/SliceManagerVM.vb | 53 ++---- Icarus/TopPanel/TopPanelVM.vb | 3 +- Icarus/Utility/Dictionary.xaml | 21 ++- 20 files changed, 176 insertions(+), 322 deletions(-) diff --git a/Icarus/ChooseMachineWnd/ChooseMachineWndVM.vb b/Icarus/ChooseMachineWnd/ChooseMachineWndVM.vb index 677c8cc..851e7fe 100644 --- a/Icarus/ChooseMachineWnd/ChooseMachineWndVM.vb +++ b/Icarus/ChooseMachineWnd/ChooseMachineWndVM.vb @@ -64,8 +64,7 @@ Public Class ChooseMachineWndVM RaiseEvent m_CloseWindow(True) Else ' se non seleziono nessuna macchina lo segnalo con un MessageBox - ' MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error) End If End Sub diff --git a/Icarus/ImportExportMachiningPanel/ImportExportMachiningPanelVM.vb b/Icarus/ImportExportMachiningPanel/ImportExportMachiningPanelVM.vb index 7732854..aae9c55 100644 --- a/Icarus/ImportExportMachiningPanel/ImportExportMachiningPanelVM.vb +++ b/Icarus/ImportExportMachiningPanel/ImportExportMachiningPanelVM.vb @@ -157,8 +157,7 @@ Public Class ImportExportMachiningPanelVM nIndex += 1 End While If bIsOriginal AndAlso bIsCustom Then - 'MessageBox.Show("Corrupted file! Impossible to import it!") - EgtMessageBoxV.Show(Application.Current.MainWindow, "Corrupted file! Impossible to import it!") + MessageBox.Show("Corrupted file! Impossible to import it!") ElseIf bIsOriginal Then LoadOriginalMaterial() End If @@ -302,12 +301,9 @@ Public Class ImportExportMachiningPanelVM sDuplicatedMaterialList &= " - " & m_MachiningList(Index).sName & Environment.NewLine End If Next - 'MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine & - ' sDuplicatedMaterialList & Environment.NewLine & - ' "Please modify the names of these machining and then retry to import the materials.") - EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible to import the package because materials named:" & Environment.NewLine & - sDuplicatedMaterialList & Environment.NewLine & - "Please modify the names of these machining and then retry to import the materials.") + MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine & + sDuplicatedMaterialList & Environment.NewLine & + "Please modify the names of these machining and then retry to import the materials.") Return End If ' aggiorno/aggiungo materiali @@ -357,10 +353,7 @@ Public Class ImportExportMachiningPanelVM For Index = 0 To ImportedMaterialList.Count - 1 sMaterialList &= " - " & m_MachiningList(Index).sName & " (" & If(ImportedMaterialList(Index) = MaterialState.NOTFOUND, "New", "Updated") & ")" & Environment.NewLine Next - 'MessageBox.Show("List of the materials:" & Environment.NewLine & - ' sMaterialList & Environment.NewLine & - ' "Import successfully completed.") - EgtMessageBoxV.Show(Application.Current.MainWindow, "List of the materials:" & Environment.NewLine & + MessageBox.Show("List of the materials:" & Environment.NewLine & sMaterialList & Environment.NewLine & "Import successfully completed.") Return @@ -488,12 +481,7 @@ Public Class ImportExportMachiningPanelVM Else sExtension = MachiningDataExtension End If - 'Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With { - ' .Title = EgtMsg(31451) & " " & EgtMsg(31452), - ' .Filter = "File data (*" & sExtension & ")|*" & sExtension, - ' .FileName = String.Empty - '} - Dim SaveFileDlg As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With { .Title = EgtMsg(31451) & " " & EgtMsg(31452), .Filter = "File data (*" & sExtension & ")|*" & sExtension, .FileName = String.Empty @@ -592,8 +580,7 @@ Public Class ImpExpMachiningItem If m_AlreadyExist Then Select Case m_WindowType Case WindowTypeEnum.MATERIAL - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) - 'System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel) + Select Case System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel) Case MessageBoxResult.Yes m_ChangeName = False m_Active = True @@ -607,8 +594,7 @@ Public Class ImpExpMachiningItem End While End If m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "") - 'System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) + System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK) NotifyPropertyChanged(NameOf(sName)) m_ChangeName = True m_Active = True @@ -616,8 +602,7 @@ Public Class ImpExpMachiningItem m_Active = False End Select Case WindowTypeEnum.MACHINING - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel) - 'System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel) + Select Case System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel) Case MessageBoxResult.Yes m_ChangeName = False m_Active = True @@ -631,8 +616,7 @@ Public Class ImpExpMachiningItem End While End If m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "") - 'System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK) + System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK) NotifyPropertyChanged(NameOf(sName)) m_ChangeName = True m_Active = True diff --git a/Icarus/InstrumentPanel/MyInstrumentPanelVM.vb b/Icarus/InstrumentPanel/MyInstrumentPanelVM.vb index af8f068..2aae8bd 100644 --- a/Icarus/InstrumentPanel/MyInstrumentPanelVM.vb +++ b/Icarus/InstrumentPanel/MyInstrumentPanelVM.vb @@ -96,9 +96,8 @@ Public Class MyInstrumentPanelVM EgtDraw() ' Ripristino stato segnalazione modifica DisableMgr.ReEnable() - 'MessageBox.Show(sResult) - EgtMessageBoxV.Show(Application.Current.MainWindow, sResult) - Else + MessageBox.Show(sResult) + Else ' Disabilito segnalazione modificato Dim DisableMgr As New DisableModifiedMgr ' cancello tutti i gruppi con i chunk diff --git a/Icarus/MachSaveInDbWnd/MachSaveInDbWndVM.vb b/Icarus/MachSaveInDbWnd/MachSaveInDbWndVM.vb index 688e2dc..be4eb59 100644 --- a/Icarus/MachSaveInDbWnd/MachSaveInDbWndVM.vb +++ b/Icarus/MachSaveInDbWnd/MachSaveInDbWndVM.vb @@ -48,8 +48,7 @@ Public Class MachSaveInDbWndVM Public Sub Ok() If Map.refTopPanelVM.MachiningList.Any(Function(x As MachiningIndex) x.sName = m_sName) Then - 'MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) + MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) Return End If RaiseEvent m_CloseWindow(True) diff --git a/Icarus/MachiningDb/Machining.vb b/Icarus/MachiningDb/Machining.vb index 21e4049..ffd83bf 100644 --- a/Icarus/MachiningDb/Machining.vb +++ b/Icarus/MachiningDb/Machining.vb @@ -464,7 +464,7 @@ Public Class MachiningCathegory Dim MachiningParam As CheckMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Param) MachiningParam.ManageDependencyParam(Me) Next - Case Cathegories.RIBS + Case Cathegories.RIBS For Each Param In {MachiningParam.Params.RIBSTYPE} Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param) MachiningParam.ManageDependencyParam() @@ -578,10 +578,10 @@ Public Class ToolTipDataMsg m_sNameDescriptionToolTip = ReadToolTipMsg(sDescription) End If If GetPrivateProfileString(Type, K_FIRST_ICON, "", m_sIconToolTip_First, CurrentMachine.sToolTipFilePath) > 0 Then - GetPrivateProfileString(Type, K_ORIENTATION_ICON, "", m_sIconOrientation, CurrentMachine.sToolTipFilePath) - m_nDimension_First = 200 - End If - If GetPrivateProfileString(Type, K_SECOND_ICON, "", m_sIconToolTip_Second, CurrentMachine.sToolTipFilePath) > 0 Then + GetPrivateProfileString(Type, K_ORIENTATION_ICON, "", m_sIconOrientation, CurrentMachine.sToolTipFilePath) + m_nDimension_First = 200 + End If + If GetPrivateProfileString(Type, K_SECOND_ICON, "", m_sIconToolTip_Second, CurrentMachine.sToolTipFilePath) > 0 Then GetPrivateProfileString(Type, K_ORIENTATION_ICON, "", m_sIconOrientation, CurrentMachine.sToolTipFilePath) m_nDimension_Second = 200 End If @@ -951,7 +951,7 @@ Public MustInherit Class MachiningParam End Sub Sub New(sName As String, Cathegory As MachiningCathegory) - m_Type = Params.MATERIALS + m_Type = Params.Materials m_Cathegory = Cathegory m_sName = sName End Sub @@ -1609,10 +1609,10 @@ Public Class ComboMachiningParam Case Params.SLICINGTYPE Dim nNewSlicingType As Integer = CurrentMachine.GetSlicingType() m_ValueList = New List(Of IdNameStruct) - If (nNewSlicingType And 1) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")) - If (nNewSlicingType And 2) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X")) - If (nNewSlicingType And 4) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y")) - If (nNewSlicingType And 8) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")) + If (nNewSlicingType And 1) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")) + If (nNewSlicingType And 2) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X")) + If (nNewSlicingType And 4) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y")) + If (nNewSlicingType And 8) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal")) If (nNewSlicingType And 16) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.MULTIPLANAR, "MultiPlanar")) If (nNewSlicingType And 32) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.MULTIPLANAR_DEG45, "MultiPlanar 45deg")) If (nNewSlicingType And 64) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.MULTIPLANAR_HORIZ, "MultiPlanar Horiz")) @@ -1884,7 +1884,7 @@ Public Class CheckMachiningParam ' gestisco dis/attivazione parametri dipendenti Select Case m_Type Case Params.SPIRALVASE - Dim ShellCathegory As MachiningCathegory = If(Not IsNothing(Cathegory), Cathegory, m_Cathegory.Machining.CathegoryList.FirstOrDefault(Function(z) z.Type= MachiningCathegory.Cathegories.LINK)) + Dim ShellCathegory As MachiningCathegory = If(Not IsNothing(Cathegory), Cathegory, m_Cathegory.Machining.CathegoryList.FirstOrDefault(Function(z) z.Type = MachiningCathegory.Cathegories.LINK)) Dim NumMachiningParam As NumericMachiningParam = ShellCathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Params.SPIRALVASELEN) NumMachiningParam.SetIsActive(m_bValue) End Select diff --git a/Icarus/MachiningDb/MachiningDbVM.vb b/Icarus/MachiningDb/MachiningDbVM.vb index 3d42c86..bb3c7ac 100644 --- a/Icarus/MachiningDb/MachiningDbVM.vb +++ b/Icarus/MachiningDb/MachiningDbVM.vb @@ -26,8 +26,7 @@ Public Class MachiningDbVM ' verifico se modificato If m_SelMachining.bIsModified Then ' chiedo se salvare - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) - 'MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) + Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Case MessageBoxResult.Yes m_SelMachining.Save() Case MessageBoxResult.No @@ -177,8 +176,7 @@ Public Class MachiningDbVM Public Sub Ok() If Not IsNothing(m_SelMachining) AndAlso m_SelMachining.bIsModified Then ' chiedo se salvare - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) - 'MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) + Select Case MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) Case MessageBoxResult.Yes m_SelMachining.Save() Case MessageBoxResult.No @@ -289,8 +287,7 @@ Public Class MachiningDbVM Public Sub Delete() If IsNothing(m_SelMachining) Then Return ' chiedo conferma - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) - 'MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) + Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Case MessageBoxResult.Yes m_MachiningList.Remove(m_SelMachining) SetIsModified(True) @@ -336,15 +333,9 @@ Public Class MachiningDbVM Public Sub Import() ' chiedo il nome del file .data da aprire - 'Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452), - ' .Filter = "File data (*" & ImportExportMachiningPanelVM.MachiningDataExtension & ")|*" & ImportExportMachiningPanelVM.MachiningDataExtension, - ' .FileName = String.Empty} - Dim OpenFileDlg As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = EgtMsg(31451) & " " & EgtMsg(31452), - .Filter = "File data (*" & ImportExportMachiningPanelVM.MachiningDataExtension & ")|*" & ImportExportMachiningPanelVM.MachiningDataExtension, - .FileName = String.Empty, - .Mode = 1 - } + Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452), + .Filter = "File data (*" & ImportExportMachiningPanelVM.MachiningDataExtension & ")|*" & ImportExportMachiningPanelVM.MachiningDataExtension, + .FileName = String.Empty} If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MACHINING, ImportExportMachiningPanelVM.WindowModeEnum.IMPORT, OpenFileDlg.FileName)) ImportWindow.ShowDialog() @@ -372,4 +363,4 @@ Public Class MachiningDbVM #End Region ' COMMANDS -End Class +End Class \ No newline at end of file diff --git a/Icarus/MainWindow/MainWindowVM.vb b/Icarus/MainWindow/MainWindowVM.vb index acc78cb..fd0d58f 100644 --- a/Icarus/MainWindow/MainWindowVM.vb +++ b/Icarus/MainWindow/MainWindowVM.vb @@ -224,8 +224,7 @@ Public Class MainWindowVM ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded. Public Sub CloseApplication(ByVal param As Object) If Map.refSliceManagerVM.bCalculating Then - 'MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) Return End If CloseApplication() diff --git a/Icarus/ManagePartPanel/ManagePartPanelVM.vb b/Icarus/ManagePartPanel/ManagePartPanelVM.vb index 82c58a2..5d7a8a8 100644 --- a/Icarus/ManagePartPanel/ManagePartPanelVM.vb +++ b/Icarus/ManagePartPanel/ManagePartPanelVM.vb @@ -286,8 +286,7 @@ Public Class ManagePartPanelVM Next Next If sErr.Count > 0 Then - 'MessageBox.Show(String.Concat(sErr), "Error") - EgtMessageBoxV.Show(Application.Current.MainWindow, String.Concat(sErr), "Error") + MessageBox.Show(String.Concat(sErr), "Error") Return Else ' Creo pezzi e layer necessari diff --git a/Icarus/ManagePartPanel/ManagePartUtility.vb b/Icarus/ManagePartPanel/ManagePartUtility.vb index 9e13d3c..a2677e3 100644 --- a/Icarus/ManagePartPanel/ManagePartUtility.vb +++ b/Icarus/ManagePartPanel/ManagePartUtility.vb @@ -629,8 +629,7 @@ Public Class GeomEntity_MenuItem Map.refManagePartPanelVM.SetIsEnabled(True) Return ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then - 'If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then - If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then EgtErase(m_OrigEntity.nId) ' se l'entita' e' gia' in lista pezzi If Not IsNothing(m_OrigEntity.OrigLayer) Then @@ -1038,8 +1037,7 @@ Public Class ManagerLayer_MenuItem Case Else ' PartMenuCmd.IMPORTPRINT Dim bDeleteOldPrint As Boolean = False If m_OrigLayer.EntityList.Count > 0 Then - 'If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then - If EgtMessageBoxV.Show(Application.Current.MainWindow, "Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then + If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then Return Else bDeleteOldPrint = True diff --git a/Icarus/MaterialDb/Material.vb b/Icarus/MaterialDb/Material.vb index 5792e8d..915a7fe 100644 --- a/Icarus/MaterialDb/Material.vb +++ b/Icarus/MaterialDb/Material.vb @@ -780,8 +780,7 @@ Public Class StringMaterialParam End Property Public Sub Original() - 'If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then - If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then m_sGUID = ORIG_MATERIAL m_sValue = ORIG_MATERIAL NotifyPropertyChanged(NameOf(sValue)) diff --git a/Icarus/MaterialDb/MaterialDbVM.vb b/Icarus/MaterialDb/MaterialDbVM.vb index 6da5a0f..6f82fbd 100644 --- a/Icarus/MaterialDb/MaterialDbVM.vb +++ b/Icarus/MaterialDb/MaterialDbVM.vb @@ -24,8 +24,7 @@ Public Class MaterialDbVM ' verifico se modificato If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then ' chiedo se salvare - 'Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) + Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Case MessageBoxResult.Yes m_SelMaterial.Save() Case MessageBoxResult.No @@ -237,8 +236,7 @@ Public Class MaterialDbVM Public Sub Ok() If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then ' chiedo se salvare - 'Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) + Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) Case MessageBoxResult.Yes m_SelMaterial.Save() Case MessageBoxResult.No @@ -369,20 +367,17 @@ Public Class MaterialDbVM ' se materiale originale, esco If SelMaterialIsOriginal() Then If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then - 'If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then - If EgtMessageBoxV.Show(Application.Current.MainWindow, "Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then + If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then Return End If sCheckMessage = "Trying to delete an Original Material! Are you ABSOLUTELY sure you want to delete it?" Else - 'MessageBox.Show("Original material impossible to delete!") - EgtMessageBoxV.Show(Application.Current.MainWindow, "Original material impossible to delete!") + MessageBox.Show("Original material impossible to delete!") Return End If End If ' chiedo conferma - Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) - 'MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) + Select Case MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) Case MessageBoxResult.Yes m_MaterialList.Remove(m_SelMaterial) SetIsModified(True) @@ -431,23 +426,13 @@ Public Class MaterialDbVM Public Sub Import() ' chiedo il nome del file .data da aprire - 'Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452), - ' .Filter = "Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.MaterialDataExtension & - ' "|Original Material file data (*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & - ' "|All Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & "," & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & - ' ImportExportMachiningPanelVM.MaterialDataExtension & ";*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension, - ' .FilterIndex = 3, - ' .FileName = String.Empty} - Dim OpenFileDlg As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = EgtMsg(31451) & " " & EgtMsg(31452), - .Filter = "Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.MaterialDataExtension & - "|Original Material file data (*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & - "|All Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & "," & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & - ImportExportMachiningPanelVM.MaterialDataExtension & ";*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension, - .FilterIndex = 3, - .FileName = String.Empty, - .Mode = 1 - } + Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {.Title = EgtMsg(31451) & " " & EgtMsg(31452), + .Filter = "Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.MaterialDataExtension & + "|Original Material file data (*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & + "|All Material file data (*" & ImportExportMachiningPanelVM.MaterialDataExtension & "," & ImportExportMachiningPanelVM.OriginalMaterialDataExtension & ")|*" & + ImportExportMachiningPanelVM.MaterialDataExtension & ";*" & ImportExportMachiningPanelVM.OriginalMaterialDataExtension, + .FilterIndex = 3, + .FileName = String.Empty} If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return Dim ImportWindowVM As New ImportExportMachiningPanelVM(ImportExportMachiningPanelVM.WindowTypeEnum.MATERIAL, ImportExportMachiningPanelVM.WindowModeEnum.IMPORT, OpenFileDlg.FileName) If ImportWindowVM.WindowMode <> ImportExportMachiningPanelVM.WindowModeEnum.IMPORT_ORIG Then diff --git a/Icarus/OptionsWindow/OptionWindowVM.vb b/Icarus/OptionsWindow/OptionWindowVM.vb index 4a01051..2797750 100644 --- a/Icarus/OptionsWindow/OptionWindowVM.vb +++ b/Icarus/OptionsWindow/OptionWindowVM.vb @@ -750,26 +750,15 @@ Public Class OptionWindowVM ''' Public Sub UpdateLicenceCmd() ' Apro dialogo per richiesta file licenza - 'Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { - ' .DefaultExt = ".lic", - ' .Filter = "Licences (.lic)|*.lic", - ' .CheckFileExists = True, - ' .ValidateNames = True - '} - Dim LicDlg As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Open", - .Filter = "Licences (*.lic)|*.lic", - .InitialDirectory = Map.refMainWindowVM.MainWindowM.sConfigDir, - .CheckFileExists = True, - .ValidateNames = True, - .FilterIndex = 1, - .Mode = 1 + Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { + .DefaultExt = ".lic", + .Filter = "Licences (.lic)|*.lic", + .CheckFileExists = True, + .ValidateNames = True } - If LicDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then - 'If LicDlg.ShowDialog() = True Then + If LicDlg.ShowDialog() = True Then ' Recupero il direttorio del file - 'Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName) - Dim sDir As String = LicDlg.FileName + Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName) ' Se il file non è già nel direttorio di configurazione lo copio If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(Map.refMainWindowVM.MainWindowM.sConfigDir), StringComparison.OrdinalIgnoreCase) Then Try @@ -804,23 +793,13 @@ Public Class OptionWindowVM ''' Public Sub AddMachineCmd() ' Apro dialogo per richiesta file zip di macchina - 'Dim MachDlg As New Microsoft.Win32.OpenFileDialog() With { - ' .DefaultExt = ".zip", - ' .Filter = "Machines (.zip)|*.zip", - ' .CheckFileExists = True, - ' .ValidateNames = True - '} - Dim MachDlg As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Open", - .Filter = "Machines (*.zip)|*.zip", - .InitialDirectory = Map.refMainWindowVM.MainWindowM.sMachinesRoot, - .CheckFileExists = True, - .ValidateNames = True, - .FilterIndex = 1, - .Mode = 1 + Dim MachDlg As New Microsoft.Win32.OpenFileDialog() With { + .DefaultExt = ".zip", + .Filter = "Machines (.zip)|*.zip", + .CheckFileExists = True, + .ValidateNames = True } - 'If MachDlg.ShowDialog() <> True Then Return - If MachDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return + If MachDlg.ShowDialog() <> True Then Return Dim sMachZip As String = MachDlg.FileName Dim sMachName As String = Path.GetFileNameWithoutExtension(sMachZip) Dim sMachDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, sMachName) @@ -839,8 +818,7 @@ Public Class OptionWindowVM Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".mlde")) Then ' Il file {0} non contiene una macchina - Avviso Dim sOut As String = String.Format(EgtMsg(6529), sMachZip) - 'MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning) - EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning) + MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning) ' Rimuovo il direttorio temporaneo ed esco My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents) Return @@ -982,14 +960,12 @@ Public Class OptionWindowVM ' L'esportazione della macchina "{0}" non è riuscita. Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName) EgtOutLog(sKo) - 'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK) - EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK) + MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK) End Try 'La macchina "{0}" è stata esportata con successo. Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName) EgtOutLog(sOk) - 'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK) - EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK) + MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK) End Sub #End Region ' ExportMachine diff --git a/Icarus/ProjManager/ProjManagerVM.vb b/Icarus/ProjManager/ProjManagerVM.vb index afa75a7..a0bdc1e 100644 --- a/Icarus/ProjManager/ProjManagerVM.vb +++ b/Icarus/ProjManager/ProjManagerVM.vb @@ -385,8 +385,7 @@ Public Class ProjManagerVM GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress) ' se vuoto do messaggio di errore ed esco If String.IsNullOrWhiteSpace(sSupportAddress) Then - 'MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) Return End If ' Recupero numero chiave @@ -397,20 +396,26 @@ Public Class ProjManagerVM EgtGetCurrFilePath(sCurrProject) ' se nome file vuoto o con estensione non valida, chiedo se si vuole salvare If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then - 'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then - If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then Map.refSceneHostVM.SaveProject() End If EgtGetCurrFilePath(sCurrProject) ' se modificato, chiedo se si vuole salvare Else If EgtGetModified() Then - 'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then - If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then Map.refSceneHostVM.SaveProject() End If End If End If + ' Verifico se il progetto corrente è una porta + Dim nPartId As Integer = EgtGetFirstPart() + If nPartId = GDB_ID.NULL Then + nPartId = EgtGetFirstPartInRawPart(EgtGetFirstRawPart()) + End If + Dim sPartName As String = String.Empty + EgtGetName(nPartId, sPartName) + Dim bPrjIsDoor As Boolean = (String.Compare(sPartName, "DOOR") = 0) ' Recupero macchine dei gruppi di lavoro del progetto Dim Machines As New List(Of String) Dim nMchGrpId As Integer = EgtGetFirstMachGroup() @@ -430,8 +435,8 @@ Public Class ProjManagerVM Dim sCurrProjName As String = Path.GetFileNameWithoutExtension(sCurrProject).ToUpper() Dim TempFiles() As String = Directory.GetFiles(sCurrProjectDir) For FileIndex = 0 To TempFiles.Count - 1 - If TempFiles(FileIndex) = sCurrProject Then Continue For - Dim sCurrFileName As String = Path.GetFileNameWithoutExtension( TempFiles(FileIndex)).ToUpper() + If TempFiles(FileIndex) = sCurrProject Then Continue For + Dim sCurrFileName As String = Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).ToUpper() If String.Compare(sCurrFileName, sCurrProjName) = 0 Then OtherFiles.Add(TempFiles(FileIndex)) End If @@ -451,7 +456,7 @@ Public Class ProjManagerVM For Each sMachineName As String In Machines Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName If Directory.Exists(sMachineDir) Then - zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sMachineName, True) + zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sMachineName, True) End If Next ' aggiungo progetto corrente @@ -490,8 +495,7 @@ Public Class ProjManagerVM bEx = True End Try If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then - 'MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information) - EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information) + MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information) Else Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14), 5) End If diff --git a/Icarus/RibParamPanel/CopyFromWndVM.vb b/Icarus/RibParamPanel/CopyFromWndVM.vb index 954804c..60dd1f5 100644 --- a/Icarus/RibParamPanel/CopyFromWndVM.vb +++ b/Icarus/RibParamPanel/CopyFromWndVM.vb @@ -51,8 +51,7 @@ Public Class CopyFromWndVM Public Sub Ok() If IsNothing(m_SelRib) Then - 'MessageBox.Show("Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) + MessageBox.Show("Please select the rib from which to copy the parameters!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) Return End If ' copio i parametri nella rib corrente diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb index 65e97ae..e765a08 100644 --- a/Icarus/SceneHost/MySceneHostVM.vb +++ b/Icarus/SceneHost/MySceneHostVM.vb @@ -72,7 +72,7 @@ Public Class MySceneHostVM If MainScene.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.BASE) Then PostInitializeScene() ' Non imposto automaticamente il focus sulla scena muovendo il mouse sopra di essa (necessario click) - MainScene.SetFocusOnMove( True, 0.3, 0.3, 0.1, 0.2) + MainScene.SetFocusOnMove(True, 0.3, 0.3, 0.1, 0.2) ' Imposto stato gestione mouse diretto della scena a nessuno MainScene.SetStatusNull() EgtSetCurrentContext(MainScene.GetCtx()) @@ -96,14 +96,14 @@ Public Class MySceneHostVM Dim sTitle As String = EgtMsg(10101) MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) End If - ' Se altrimenti manca il collegamento con la chiave di rete + ' Se altrimenti manca il collegamento con la chiave di rete ElseIf Map.refMainWindowVM.MainWindowM.nKeyLevel = -9 Then EgtOutLog("Missing Link with Net Dongle") ' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore" Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109) Dim sTitle As String = EgtMsg(10101) MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error) - ' Altrimenti manca la licenza + ' Altrimenti manca la licenza Else EgtOutLog("Problems with Licence") ' Box di avviso licenza con problemi : sKeyInfo \n "Programma senza licenza. \n Caricala e riavvia il programma." "Errore" @@ -112,26 +112,15 @@ Public Class MySceneHostVM Dim sTitle As String = EgtMsg(10101) If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then ' Apro dialogo per richiesta file licenza - ' Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { - ' .DefaultExt = ".lic", - ' .Filter = "Licences (.lic)|*.lic", - ' .CheckFileExists = True, - ' .ValidateNames = True - '} - Dim LicDlg As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Open", - .Filter = "Licences (*.lic)|*.lic", - .InitialDirectory = Map.refMainWindowVM.MainWindowM.sConfigDir, - .CheckFileExists = True, - .ValidateNames = True, - .FilterIndex = 1, - .Mode = 1 - } - 'If LicDlg.ShowDialog() = True Then - If LicDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then + Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With { + .DefaultExt = ".lic", + .Filter = "Licences (.lic)|*.lic", + .CheckFileExists = True, + .ValidateNames = True + } + If LicDlg.ShowDialog() = True Then ' Recupero il direttorio del file - 'Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName) - Dim sDir As String = LicDlg.FileName + Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName) ' Se il file non è già nel direttorio di configurazione lo copio If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(Map.refMainWindowVM.MainWindowM.sConfigDir), StringComparison.OrdinalIgnoreCase) Then Try @@ -229,7 +218,7 @@ Public Class MySceneHostVM Dim MajLnColor As Color3d = New Color3d(160, 160, 160) GetMainPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor) EgtSetGridFrame(Frame3d.GLOB) - EgtSetGridGeo( If( bMmUnits, OptionModule.m_dSnapStepMm, OptionModule.m_dSnapStepInch), + EgtSetGridGeo(If(bMmUnits, OptionModule.m_dSnapStepMm, OptionModule.m_dSnapStepInch), OptionModule.m_nMinLineSStep, OptionModule.m_nMajLineSStep, OptionModule.m_nExtSStep) EgtSetGridColor(MinLnColor, MajLnColor) EgtSetGridShow(OptionModule.m_bGridVisibility, OptionModule.m_bGridVisibility) @@ -281,20 +270,12 @@ Public Class MySceneHostVM If Not String.IsNullOrWhiteSpace(sDir) Then sDir = Path.GetDirectoryName(sDir) End If - 'Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With { - ' .Title = "Open", - ' .Filter = "Icarus project(*.icrs)|*.icrs" & - ' "|New geometry EgalTech(*.nge)|*.nge", - ' .FilterIndex = 1, - ' .InitialDirectory = sDir - '} - Dim OpenFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With { .Title = "Open", .Filter = "Icarus project(*.icrs)|*.icrs" & "|New geometry EgalTech(*.nge)|*.nge", .FilterIndex = 1, - .InitialDirectory = sDir, - .Mode = 1 + .InitialDirectory = sDir } If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return False sFilePath = OpenFileDialog.FileName @@ -313,10 +294,10 @@ Public Class MySceneHostVM If String.IsNullOrWhiteSpace(sCurrFile) Or EgtGetFileType(sCurrFile) <> FT.NGE Then bOk = SaveAsProject() Else - Dim bDeleteNgeFile As Boolean = ( Path.GetExtension(sCurrFile) = ".nge") + Dim bDeleteNgeFile As Boolean = (Path.GetExtension(sCurrFile) = ".nge") EgtSetCurrFilePath(Path.ChangeExtension(sCurrFile, "icrs")) ' Formato di salvataggio - Dim nSaveType As NGE = DirectCast( GetMainPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE) + Dim nSaveType As NGE = DirectCast(GetMainPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE) ' Salvataggio standard bOk = MainController.SaveProject(nSaveType) If bOk AndAlso bDeleteNgeFile AndAlso File.Exists(sCurrFile) Then @@ -349,26 +330,17 @@ Public Class MySceneHostVM sDir = Path.GetDirectoryName(sDir) End If ' Assegnazione nome file con dialogo - 'Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With { - ' .Title = "Save", - ' .Filter = "Icarus Project(*.icrs)|*.icrs", - ' .FileName = sFile, - ' .InitialDirectory = IO.Path.GetDirectoryName(sFile) - '} - Dim SaveFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With { .Title = "Save", - .Filter = "Icarus project(*.icrs)|*.icrs", + .Filter = "Icarus Project(*.icrs)|*.icrs", .FileName = sFile, - .InitialDirectory = sDir, - .ValidateNames = False, - .OverwritePrompt = True, - .Mode = 1 + .InitialDirectory = IO.Path.GetDirectoryName(sFile) } If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then Dim sFileName As String = SaveFileDialog.FileName EgtSetCurrFilePath(sFileName) ' Formato di salvataggio - Dim nSaveType As NGE = DirectCast( GetMainPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE) + Dim nSaveType As NGE = DirectCast(GetMainPrivateProfileInt(S_GEOMDB, K_SAVETYPE, NGE.CMPTEXT), NGE) ' Salvataggio standard bOk = MainController.SaveProject(nSaveType) End If @@ -476,7 +448,7 @@ Public Class MySceneHostVM Dim nNewPartId As Integer = EgtGetLastPart() Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId) Dim frLayer As New Frame3d - EgtGetGroupGlobFrame( nNewLayerId, frLayer) + EgtGetGroupGlobFrame(nNewLayerId, frLayer) Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewLayerId) While nNewEntityId <> GDB_ID.NULL Dim EntityType As GDB_TY = EgtGetType(nNewEntityId) @@ -485,14 +457,14 @@ Public Class MySceneHostVM Dim nNewRib As Integer = GDB_ID.NULL If EntityType = GDB_TY.CRV_LINE OrElse EntityType = GDB_TY.CRV_ARC Then nNewRib = EgtCreateCurveCompo(nNewLayerId, nNewEntityId, False) - EgtRelocate( nNewRib, Map.refRibPanelVM.nRibLayerId, GDB_POS.LAST_SON) + EgtRelocate(nNewRib, Map.refRibPanelVM.nRibLayerId, GDB_POS.LAST_SON) Else ' lo copio nel layer dei rib nNewRib = EgtCopy(nNewEntityId, Map.refRibPanelVM.nRibLayerId, GDB_POS.LAST_SON) End If EgtSetName(nNewRib, RIB_CURVE) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewRib, frLayer) + EgtTransform(nNewRib, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' lo aggiungo alla lista @@ -503,7 +475,7 @@ Public Class MySceneHostVM Dim nNewRib As Integer = EgtCopy(nNewEntityId, Map.refRibPanelVM.nRibLayerId, GDB_POS.LAST_SON) EgtSetName(nNewRib, RIB_EXTRUSION) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewRib, frLayer) + EgtTransform(nNewRib, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' lo aggiungo alla lista @@ -554,7 +526,7 @@ Public Class MySceneHostVM Dim nNewPartId As Integer = EgtGetLastPart() Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId) Dim frLayer As New Frame3d - EgtGetGroupGlobFrame( nNewLayerId, frLayer) + EgtGetGroupGlobFrame(nNewLayerId, frLayer) ' verifico che ci sia una sola entita' If EgtGetGroupObjs(nNewLayerId) <> 1 Then 'MessageBox.Show("Impossible importing file that contains more than one entity.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) @@ -565,7 +537,7 @@ Public Class MySceneHostVM Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewLayerId) EgtRelocate(nNewEntityId, MenuItem.OrigLayer.nLayerId, GDB_POS.LAST_SON) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewEntityId, frLayer) + EgtTransform(nNewEntityId, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' aggiorno riferimento pezzo @@ -619,7 +591,7 @@ Public Class MySceneHostVM Dim nNewPartId As Integer = EgtGetLastPart() Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId) Dim frLayer As New Frame3d - EgtGetGroupGlobFrame( nNewLayerId, frLayer) + EgtGetGroupGlobFrame(nNewLayerId, frLayer) Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewLayerId) While nNewEntityId <> GDB_ID.NULL Dim EntityType As GDB_TY = EgtGetType(nNewEntityId) @@ -628,14 +600,14 @@ Public Class MySceneHostVM Dim nNewShellNumberId As Integer = GDB_ID.NULL If EntityType = GDB_TY.CRV_LINE OrElse EntityType = GDB_TY.CRV_ARC Then nNewShellNumberId = EgtCreateCurveCompo(nNewLayerId, nNewEntityId, False) - EgtRelocate( nNewShellNumberId, Map.refShellNumberPanelVM.nShellNumberLayerId, GDB_POS.LAST_SON) + EgtRelocate(nNewShellNumberId, Map.refShellNumberPanelVM.nShellNumberLayerId, GDB_POS.LAST_SON) Else ' lo copio nel layer dei shellnumber nNewShellNumberId = EgtCopy(nNewEntityId, Map.refShellNumberPanelVM.nShellNumberLayerId, GDB_POS.LAST_SON) End If EgtSetName(nNewShellNumberId, RIB_CURVE) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewShellNumberId, frLayer) + EgtTransform(nNewShellNumberId, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' lo aggiungo alla lista @@ -646,7 +618,7 @@ Public Class MySceneHostVM Dim nNewShellNumberId As Integer = EgtCopy(nNewEntityId, Map.refShellNumberPanelVM.nShellNumberLayerId, GDB_POS.LAST_SON) EgtSetName(nNewShellNumberId, RIB_EXTRUSION) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewShellNumberId, frLayer) + EgtTransform(nNewShellNumberId, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' lo aggiungo alla lista @@ -698,7 +670,7 @@ Public Class MySceneHostVM Dim nNewPartId As Integer = EgtGetLastPart() Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId) Dim frLayer As New Frame3d - EgtGetGroupGlobFrame( nNewLayerId, frLayer) + EgtGetGroupGlobFrame(nNewLayerId, frLayer) Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewLayerId) While nNewEntityId <> GDB_ID.NULL Dim EntityType As GDB_TY = EgtGetType(nNewEntityId) @@ -707,14 +679,14 @@ Public Class MySceneHostVM Dim nNewFilledSolidId As Integer = GDB_ID.NULL If EntityType = GDB_TY.CRV_LINE OrElse EntityType = GDB_TY.CRV_ARC Then nNewFilledSolidId = EgtCreateCurveCompo(nNewLayerId, nNewEntityId, False) - EgtRelocate( nNewFilledSolidId, Map.refFilledSolidPanelVM.nFilledSolidLayerId, GDB_POS.LAST_SON) + EgtRelocate(nNewFilledSolidId, Map.refFilledSolidPanelVM.nFilledSolidLayerId, GDB_POS.LAST_SON) Else ' lo copio nel layer dei FilledSolid nNewFilledSolidId = EgtCopy(nNewEntityId, Map.refFilledSolidPanelVM.nFilledSolidLayerId, GDB_POS.LAST_SON) End If EgtSetName(nNewFilledSolidId, RIB_CURVE) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewFilledSolidId, frLayer) + EgtTransform(nNewFilledSolidId, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' lo aggiungo alla lista @@ -725,7 +697,7 @@ Public Class MySceneHostVM Dim nNewFilledSolidId As Integer = EgtCopy(nNewEntityId, Map.refFilledSolidPanelVM.nFilledSolidLayerId, GDB_POS.LAST_SON) EgtSetName(nNewFilledSolidId, RIB_EXTRUSION) ' elimino effetti di eventuale riferimento originale - EgtTransform( nNewFilledSolidId, frLayer) + EgtTransform(nNewFilledSolidId, frLayer) ' elimino colore entita' EgtResetColor(nNewEntityId) ' lo aggiungo alla lista @@ -748,22 +720,12 @@ Public Class MySceneHostVM ' Reset controller e scena MainController.ResetStatus() 'Assegnazione nome file con dialogo - 'Dim SaveFileDialog As New SaveFileDialog With { - ' .Title = "Export", - ' .Filter = "3D Manufacturing format (*.3mf)|*.3mf" & - ' "|Stereolithography (*.stl)|*.stl", - ' .FilterIndex = 1, - ' .FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c) - '} - Dim SaveFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "Export", - .Filter = "3D Manufacturing format (*.3mf)|*.3mf" & - "|Stereolithography (*.stl)|*.stl", - .FilterIndex = 1, - .FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c), - .ValidateNames = False, - .OverwritePrompt = True, - .Mode = 1 + Dim SaveFileDialog As New SaveFileDialog With { + .Title = "Export", + .Filter = "3D Manufacturing format (*.3mf)|*.3mf" & + "|Stereolithography (*.stl)|*.stl", + .FilterIndex = 1, + .FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c) } Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog If IsNothing(DialogResult) OrElse Not DialogResult Then Return False @@ -825,7 +787,7 @@ Public Class MySceneHostVM Else sMsg = "Save changes?" End If - Dim nRes = EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) + Dim nRes = MessageBox.Show(Application.Current.MainWindow, sMsg, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) Select Case nRes Case Windows.Forms.DialogResult.Yes SaveProject() @@ -1157,8 +1119,7 @@ Public Class MySceneHostVM EgtErase(EgtGetFirstPart()) CurrentMachine.CreateMachineTable() If Not bOk Then - 'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error - EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error End If Map.refTopPanelVM.PartList.Clear() @@ -1187,8 +1148,7 @@ Public Class MySceneHostVM Else sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file End If - 'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error - EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error End If ' leggo materiale e macchina Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE) @@ -1200,8 +1160,7 @@ Public Class MySceneHostVM ' imposto la macchina Map.refMachinePanelVM.SelectedMachine = ProjectMachine Else - 'MessageBox.Show("Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) Map.refProjManagerVM.NewProject(False) Return End If @@ -1224,15 +1183,13 @@ Public Class MySceneHostVM Else Dim sMaterialName As String = "" EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName) - 'MessageBox.Show("Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine & - ' "Please select another material!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine & + MessageBox.Show("Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine & "Please select another material!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning) End If End If ' aggiorno punto di vista e griglia - EgtSetView( CurrentMachine.nStandardView, False) - EgtSetGridGeoAdv( -1, -1, -1, 0, CurrentMachine.b3Tab.DimX(), 0, CurrentMachine.b3Tab.DimY()) + EgtSetView(CurrentMachine.nStandardView, False) + EgtSetGridGeoAdv(-1, -1, -1, 0, CurrentMachine.b3Tab.DimX(), 0, CurrentMachine.b3Tab.DimY()) EgtZoom(ZM.ALL, False) ' leggo pezzi Map.refTopPanelVM.PartList.Clear() @@ -1314,8 +1271,7 @@ Public Class MySceneHostVM Else Map.refProjManagerVM.MruFiles.Remove(sFile) Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file - 'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error - EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error End If End Sub @@ -1324,15 +1280,17 @@ Public Class MySceneHostVM nType = FT.PARASOLID Or nType = FT.JT Or nType = FT.VRML Or nType = FT.C3D Then nFlag = GetMainPrivateProfileInt(S_IMPORT, K_ADVFLAG, 0) Dim dToler As Double = GetMainPrivateProfileDouble(S_IMPORT, K_ADVTOLER, 0.1) - MainController.SetAdvImpTolerance( dToler) + MainController.SetAdvImpTolerance(dToler) Else nFlag = 0 + End If + End Sub + Private Sub OnInsertedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) ' Segnalo eventuale errore If Not bOk Then Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file - 'MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error - EgtMessageBoxV.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error End If Map.refProjManagerVM.MruImportFiles.Add(sFile) EgtSetInfo(EgtGetLastPart(), FILE_PATH, sFile) @@ -1350,23 +1308,10 @@ Public Class MySceneHostVM ' Abilito progress e bottone stop Map.refMyStatusBarVM.StartLoading("", True) Else - 'MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error - EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error + MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error End If End Sub - Private Sub OnInsertedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean) - ' Segnalo eventuale errore - If Not bOk Then - Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file - MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error - End If - Map.refProjManagerVM.MruImportFiles.Add(sFile) - EgtSetInfo(EgtGetLastPart(), FILE_PATH, sFile) - EgtDraw() - MainScene.SetStatusNull() - End Sub - Private Sub PrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String, ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean) Map.refControllerInputPanelVM.PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn) @@ -1640,7 +1585,7 @@ Public Class MySceneHostVM Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ) Map.refStartMachPanelVM.ResetCPlaneObjIsActive() ' imposto dimensioni griglia standard (non tavola) - EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep) + EgtSetGridGeo(-1, -1, -1, OptionModule.m_nExtSStep) ' ripristino selezioni precedenti For Each Id In Map.refStartMachPanelVM.PrevSelObjs EgtSelectObj(Id) @@ -1726,7 +1671,7 @@ Public Class MySceneHostVM Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ) Map.refRibPanelVM.ResetCPlaneObjIsActive() ' imposto dimensioni griglia standard (non tavola) - EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep) + EgtSetGridGeo(-1, -1, -1, OptionModule.m_nExtSStep) ' ripristino selezioni precedenti For Each Id In Map.refRibPanelVM.PrevSelObjs EgtSelectObj(Id) @@ -1813,7 +1758,7 @@ Public Class MySceneHostVM Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ) Map.refShellNumberPanelVM.ResetCPlaneObjIsActive() ' imposto dimensioni griglia standard (non tavola) - EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep) + EgtSetGridGeo(-1, -1, -1, OptionModule.m_nExtSStep) ' ripristino selezioni precedenti For Each Id In Map.refShellNumberPanelVM.PrevSelObjs EgtSelectObj(Id) @@ -1900,7 +1845,7 @@ Public Class MySceneHostVM Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ) Map.refFilledSolidPanelVM.ResetCPlaneObjIsActive() ' imposto dimensioni griglia standard (non tavola) - EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep) + EgtSetGridGeo(-1, -1, -1, OptionModule.m_nExtSStep) ' ripristino selezioni precedenti For Each Id In Map.refFilledSolidPanelVM.PrevSelObjs EgtSelectObj(Id) diff --git a/Icarus/SecondaryWindow/SecondaryWindowVM.vb b/Icarus/SecondaryWindow/SecondaryWindowVM.vb index 88667e7..4e68ece 100644 --- a/Icarus/SecondaryWindow/SecondaryWindowVM.vb +++ b/Icarus/SecondaryWindow/SecondaryWindowVM.vb @@ -183,8 +183,7 @@ Public Class SecondaryWindowVM ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded. Public Sub CloseApplication(ByVal param As Object) If Map.refSliceManagerVM.bCalculating Then - 'MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) Return End If Map.refMainWindowVM.CloseApplication() diff --git a/Icarus/SimulationPanel/SimulationPanelVM.vb b/Icarus/SimulationPanel/SimulationPanelVM.vb index 32598e7..462ad7e 100644 --- a/Icarus/SimulationPanel/SimulationPanelVM.vb +++ b/Icarus/SimulationPanel/SimulationPanelVM.vb @@ -97,12 +97,10 @@ Public Class SimulationPanelVM If Not EgtSimInit() OrElse Not EgtSimStart() Then If EgtGetLastMachMgrErrorId() <> 0 Then Dim sErr As String = EgtGetLastMachMgrErrorString() - 'MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) - EgtMessageBoxV.Show(Application.Current.MainWindow, sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) - Else - 'MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) - End If + MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) + Else + MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) + End If End If ' Imposto stato corrente MySimul.SetSimulationStatus(MCH_SIM_ST.UI_STOP) @@ -114,11 +112,11 @@ Public Class SimulationPanelVM MySimul.StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 14) ' Home ' Gestione check VMill If GetMainPrivateProfileInt(S_SIMUL, K_VIRTUALADDITIVE, 0) > 0 AndAlso - EgtUILib.GetPrivateProfileInt( S_VMILL, K_VM_ENABLE, 0, CurrentMachine.sMachIniFile) > 0 Then + EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, CurrentMachine.sMachIniFile) > 0 Then MySimul.VMill_Visibility = Visibility.Visible MySimul.VMill_IsEnabled = True Dim bVal As Boolean - MySimul.SetVMillActive( EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM, bVal) AndAlso bVal) + MySimul.SetVMillActive(EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM, bVal) AndAlso bVal) Else ' Disabilito Vmill, ma inibisco dichiarazione progetto modificato MySimul.VMill_Visibility = Visibility.Collapsed @@ -203,7 +201,7 @@ Public Class SimulationPanelVM Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True) End Sub - Friend Sub SimulationExpander_Update_CncData( nFlag As Integer) + Friend Sub SimulationExpander_Update_CncData(nFlag As Integer) MySimul.Update_CncData(nFlag) End Sub diff --git a/Icarus/SliceManager/SliceManagerVM.vb b/Icarus/SliceManager/SliceManagerVM.vb index 42dccb9..f1007b4 100644 --- a/Icarus/SliceManager/SliceManagerVM.vb +++ b/Icarus/SliceManager/SliceManagerVM.vb @@ -324,8 +324,7 @@ Public Class SliceManagerVM End If EgtGetCurrFilePath(sCurrProject) If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then - 'MessageBox.Show("Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("Save project before calculating slices!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) Return False End If ' mostro barre di caricamento @@ -399,8 +398,7 @@ Public Class SliceManagerVM Map.refTopPanelVM.SelPart.RefreshPrintLayers() ' in caso di errore, segnalazione If Not bOk Then - 'MessageBox.Show("Error in slicing! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Error in slicing! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("Error in slicing! See log file.", "Error", MessageBoxButton.OK, MessageBoxImage.Error) End If If bOk And m_bGenerate Then ' verifico esistenza e correttezza machgroup @@ -428,8 +426,7 @@ Public Class SliceManagerVM Else sOut &= sMsg End If - 'MessageBox.Show(sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(sOut, "Error", MessageBoxButton.OK, MessageBoxImage.Error) End If End If ' aggiorno tempo e massa @@ -487,8 +484,7 @@ Public Class SliceManagerVM EgtLuaCreateGlobTable("MACH") If Not EgtLuaExecFile(sInitMachScriptPath) Then EgtOutLog("Error executing Machining init script " & sInitMachScriptPath) - 'MessageBox.Show(EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error) Return False End If Dim nErr As Integer = 999 @@ -507,8 +503,7 @@ Public Class SliceManagerVM EgtLuaCreateGlobTable("MACH") If Not EgtLuaExecFile(sExitMachScriptPath) Then EgtOutLog("Error executing Machining exit script " & sExitMachScriptPath) - 'MessageBox.Show(EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error) Return False End If Dim nErr As Integer = 999 @@ -544,27 +539,23 @@ Public Class SliceManagerVM If m_bCalculating Then Return m_bCalculating = True If IsNothing(Map.refTopPanelVM.SelPart) Then - 'MessageBox.Show("No parts to slice!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "No parts to slice!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("No parts to slice!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) m_bCalculating = False Return End If If IsNothing(Map.refTopPanelVM.SelMaterial) Then - 'MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) m_bCalculating = False Return End If If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then - 'MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) m_bCalculating = False Return End If Dim b3Print As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) If Not String.IsNullOrWhiteSpace(CurrentMachine.sMachDataIniFile) AndAlso Not CurrentMachine.b3ExtrusionArea.EnclosesXY(b3Print) Then - 'MessageBox.Show("Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show("Part outside the extrusion area!", "Error", MessageBoxButton.OK, MessageBoxImage.Error) m_bCalculating = False Return End If @@ -687,24 +678,14 @@ Public Class SliceManagerVM If Not IsNothing(sCurrFilePath) Then sInitialDirectory = System.IO.Path.ChangeExtension(sCurrFilePath, sExtension) End If - 'Dim NewSaveFileDialog As New Windows.Forms.SaveFileDialog With {.Title = "ISO File Name", - ' .Filter = "|*" & sExtension, - ' .FilterIndex = 1, - ' .InitialDirectory = System.IO.Path.GetDirectoryName(sInitialDirectory), - ' .FileName = sInitialDirectory, - ' .CreatePrompt = True, - ' .OverwritePrompt = True, - ' .ValidateNames = False} - Dim NewSaveFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { - .Title = "ISO File Name", - .Filter = "MPF (*.mpf)|*" & sExtension, - .InitialDirectory = System.IO.Path.GetDirectoryName(sInitialDirectory), - .FileName = sInitialDirectory, - .ValidateNames = False, - .OverwritePrompt = True, - .FilterIndex = 1, - .Mode = 1 - } + Dim NewSaveFileDialog As New Windows.Forms.SaveFileDialog With {.Title = "ISO File Name", + .Filter = "|*" & sExtension, + .FilterIndex = 1, + .InitialDirectory = System.IO.Path.GetDirectoryName(sInitialDirectory), + .FileName = sInitialDirectory, + .CreatePrompt = True, + .OverwritePrompt = True, + .ValidateNames = False} Dim bResult As Boolean? = NewSaveFileDialog.ShowDialog() If IsNothing(bResult) OrElse Not bResult Then m_bCalculating = False diff --git a/Icarus/TopPanel/TopPanelVM.vb b/Icarus/TopPanel/TopPanelVM.vb index 1cb7313..ff2210d 100644 --- a/Icarus/TopPanel/TopPanelVM.vb +++ b/Icarus/TopPanel/TopPanelVM.vb @@ -746,8 +746,7 @@ Public Class TopPanelVM Public Sub Machining() If IsNothing(m_SelPart) OrElse IsNothing(CurrMachining) Then Return If IsNothing(m_SelMachining) Then - 'MessageBox.Show("Select current Db Machining first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation) - EgtMessageBoxV.Show(Application.Current.MainWindow, "Select current Db Machining first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation) + MessageBox.Show("Select current Db Machining first!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation) Return End If SelPage = Pages.CURRMACHINING diff --git a/Icarus/Utility/Dictionary.xaml b/Icarus/Utility/Dictionary.xaml index 276f5ae..47f658d 100644 --- a/Icarus/Utility/Dictionary.xaml +++ b/Icarus/Utility/Dictionary.xaml @@ -933,7 +933,7 @@ - + - +