EgtCAM5 :

- Implementato uso della EgtSaveFileDialog da EgtWPFLib5.
- Abbozzata gestione dei file per GunStock.
- Aggiunta virtualizzazione dell'albero dei layer.
- Corretta visualizzazione pallini colorati nell'albero dei layer.
- Miglioramenti nel salvataggio delle MTable e selezione di quella corrente.
- Aggiunto colore Egaltech1 in IniFile per poterlo usare da codice.
This commit is contained in:
Emmanuele Sassi
2016-10-25 18:05:06 +00:00
parent e3a00c0933
commit 0851ba19d0
17 changed files with 198 additions and 79 deletions
+28 -17
View File
@@ -2,7 +2,6 @@
Imports System.IO
Imports EgtUILib
Imports System.Text.RegularExpressions
Imports Microsoft.Win32
Namespace EgtCAM5
@@ -188,6 +187,7 @@ Namespace EgtCAM5
Sub New()
EgtGetCurrMachineName(m_sPreviousActiveMachine)
MTableListBoxItem.NewMTableIndex = 0
UpdateTables()
SetActiveTable()
If m_TablesList.Count > 0 Then
@@ -304,15 +304,13 @@ Namespace EgtCAM5
Public Sub SaveTable(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) Then Return
Dim sFile As String = String.Empty
'Dim sFile As String = String.Empty
If String.IsNullOrEmpty(SelectedMTable.TableNamePath) Then
If Not SaveTableAsDialog(sFile, SelectedMTable.TableName) Then Return
SelectedMTable.m_TableNamePath = sFile
SelectedMTable.TableName = Path.GetFileNameWithoutExtension(sFile)
VerifyNewName(SelectedMTable.TableName)
SaveTableAs(SelectedMTable)
Else
TableUtility.WriteDoorTable(SelectedMTable, SelectedMTable.TableNamePath)
SelectedMTable.IsModifiedReset()
End If
TableUtility.WriteDoorTable(SelectedMTable, SelectedMTable.TableNamePath)
SelectedMTable.IsModifiedReset()
End Sub
#End Region ' SaveTableCommand
@@ -340,7 +338,7 @@ Namespace EgtCAM5
Dim sFile As String = String.Empty
If SaveTableAsDialog(sFile, SelectedMTable.TableName) Then
SelectedMTable.IsModifiedReset()
VerifyNewName(SelectedMTable.TableName)
VerifyNewName(Path.GetFileNameWithoutExtension(sFile))
TableUtility.WriteDoorTable(SelectedMTable, sFile)
UpdateTables()
' seleziono la tabella appena salvata
@@ -356,16 +354,15 @@ Namespace EgtCAM5
' Direttorio corrente per MTable
Dim sDir As String = IniFile.m_sTablesRoot
' Apertura dialogo di scelta file DDF
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.Title = EgtMsg(MSG_DOORS + 5)
SaveFileDialog.Filter = "MTable script(*.mtl)|*.mtl"
SaveFileDialog.FilterIndex = 1
SaveFileDialog.InitialDirectory = sDir
SaveFileDialog.FileName = sTableName
If SaveFileDialog.ShowDialog <> True Then
Dim SaveFileDialogView As New EgtWPFLib5.EgtSaveFileDialog
SaveFileDialogView.Title = EgtMsg(MSG_DOORS + 5)
SaveFileDialogView.Extension = ".mtl"
SaveFileDialogView.Directory = sDir
SaveFileDialogView.FileName = sTableName
If SaveFileDialogView.ShowDialog <> True Then
Return False
End If
sPath = SaveFileDialog.FileName
sPath = SaveFileDialogView.FileName
Return True
End Function
@@ -391,6 +388,20 @@ Namespace EgtCAM5
Public Sub RemoveTable(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) Then Return
' cancello tutte le tavole nella lista impostate su non visibili (quelle rimaste quando viene creata una nuova tabella e passando ad un altra non la si salva)
Dim Index As Integer = m_TablesList.Count - 1
While Index >= 0
If m_TablesList(Index).Visibility <> Visibility.Visible Then
m_TablesList.RemoveAt(Index)
End If
Index -= 1
End While
' verifico se la tabella selezionata è quella attiva
If SelectedMTable.ActiveTable Then
MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 8) & vbCrLf & EgtMsg(MSG_DOORSERRORS + 9), "", MessageBoxButton.OK, MessageBoxImage.Stop)
Exit Sub
End If
' chiedo conferma prima di cancellare la tabella
If MessageBox.Show(EgtMsg(MSG_DOORS + 6), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If Not String.IsNullOrEmpty(SelectedMTable.TableNamePath) Then
File.Delete(SelectedMTable.TableNamePath)