EgtCAM5 :

- Inizio lavoro di restauro per eliminare messenger e realizzare Map.
- Correzzione temporanea errore contextmenu dell'albero layer quando viene usato il comando relocate.
- Migliorie varie.
This commit is contained in:
Emmanuele Sassi
2017-03-23 18:14:29 +00:00
parent 76f912a348
commit 6b7ab02325
29 changed files with 500 additions and 597 deletions
@@ -59,7 +59,13 @@ Namespace EgtCAM5
End Set
End Property
'
Private m_IsRightClickedTreeItem As Boolean
Public ReadOnly Property IsRightClickedTreeItem As Integer
Get
Return m_RightClickedTreeItemId
End Get
End Property
Private m_RightClickedTreeItemId As Integer
Public ReadOnly Property RightClickedTreeItemId As Integer
Get
@@ -165,8 +171,12 @@ Namespace EgtCAM5
Me.m_nObjTreeOldId = ObjTreeOldId
End Sub)
Application.Msn.Register(Application.RIGHTCLICKEDLAYERTREEITEM, Sub(Id As Integer)
EgtResetMark(m_RightClickedTreeItemId)
m_RightClickedTreeItemId = Id
End Sub)
Application.Msn.Register(Application.ISRIGHTCLICKEDLAYERTREEITEM, Sub(Value As Boolean)
m_IsRightClickedTreeItem = Value
End Sub)
End Sub
@@ -182,7 +192,7 @@ Namespace EgtCAM5
Public ReadOnly Property NewPartCommand As ICommand
Get
If m_cmdNewPart Is Nothing Then
m_cmdNewPart = New RelayCommand(AddressOf NewPart, AddressOf CanNewPart)
m_cmdNewPart = New RelayCommand(AddressOf NewPart)
End If
Return m_cmdNewPart
End Get
@@ -197,13 +207,6 @@ Namespace EgtCAM5
SelectIdInObjTree(EgtGetCurrLayer(), False)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanNewPart(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewPartCommand
#Region "NewLayerCommand"
@@ -214,7 +217,7 @@ Namespace EgtCAM5
Public ReadOnly Property NewLayerCommand As ICommand
Get
If m_cmdNewLayer Is Nothing Then
m_cmdNewLayer = New RelayCommand(AddressOf NewLayer, AddressOf CanNewLayer)
m_cmdNewLayer = New RelayCommand(AddressOf NewLayer)
End If
Return m_cmdNewLayer
End Get
@@ -229,13 +232,6 @@ Namespace EgtCAM5
SelectIdInObjTree(EgtGetCurrLayer(), False)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanNewLayer(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NewLayerCommand
#Region "LayerColorCommand"
@@ -246,7 +242,7 @@ Namespace EgtCAM5
Public ReadOnly Property LayerColorCommand As ICommand
Get
If m_cmdLayerColor Is Nothing Then
m_cmdLayerColor = New RelayCommand(AddressOf LayerColor, AddressOf CanLayerColor)
m_cmdLayerColor = New RelayCommand(AddressOf LayerColor)
End If
Return m_cmdLayerColor
End Get
@@ -260,13 +256,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanLayerColor(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' LayerColorCommand
#Region "TreeViewDoubleClickCommand"
@@ -277,7 +266,7 @@ Namespace EgtCAM5
Public ReadOnly Property TreeViewDoubleClickCommand As ICommand
Get
If m_cmdTreeViewDoubleClick Is Nothing Then
m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick, AddressOf CanTreeViewDoubleClick)
m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick)
End If
Return m_cmdTreeViewDoubleClick
End Get
@@ -293,13 +282,6 @@ Namespace EgtCAM5
End If
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanTreeViewDoubleClick(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' TreeViewDoubleClickCommand
#Region "TreeViewMouseRightButtonCommand"
@@ -310,7 +292,7 @@ Namespace EgtCAM5
Public ReadOnly Property TreeViewMouseRightButtonCommand As ICommand
Get
If m_cmdTreeViewMouseRightButton Is Nothing Then
m_cmdTreeViewMouseRightButton = New RelayCommand(AddressOf TreeViewMouseRightButton, AddressOf CanTreeViewMouseRightButton)
m_cmdTreeViewMouseRightButton = New RelayCommand(AddressOf TreeViewMouseRightButton)
End If
Return m_cmdTreeViewMouseRightButton
End Get
@@ -326,13 +308,6 @@ Namespace EgtCAM5
End If
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanTreeViewMouseRightButton(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' TreeViewMouseRightButtonCommand
#Region "TreeViewMouseUpCommand"
@@ -355,13 +330,15 @@ Namespace EgtCAM5
Public Sub TreeViewMouseUp(ByVal param As Object)
' determino Id di eventuale item sotto il mouse
Dim nId As Integer = GDB_ID.NULL
Dim TNode As LayerTreeViewItem = DirectCast(param, LayerTreeViewItem)
If isNothing(TNode) Then Return
nId = TNode.Id
If m_IsRightClickedTreeItem Then
nId = m_RightClickedTreeItemId
Else
nId = m_nObjTreeOldId
End If
' se Id coincide con il corrente
If nId <> GDB_ID.NULL And nId = m_nObjTreeOldId Then
If nId <> GDB_ID.NULL Then 'And nId = m_nObjTreeOldId Then
' evidenzio
EgtSetMark(m_nObjTreeOldId)
EgtSetMark(nId)
EgtDraw()
' lancio timer per successiva de-evidenziazione
ObjTreeTimer.Stop()
@@ -395,7 +372,7 @@ Namespace EgtCAM5
Public ReadOnly Property SelectCommand As ICommand
Get
If m_cmdSelect Is Nothing Then
m_cmdSelect = New RelayCommand(AddressOf SelectCmd, AddressOf CanSelect)
m_cmdSelect = New RelayCommand(AddressOf SelectCmd)
End If
Return m_cmdSelect
End Get
@@ -409,13 +386,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SELECTPARTLAYEROBJ)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanSelect(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' SelectCommand
#Region "DeselectCommand"
@@ -426,7 +396,7 @@ Namespace EgtCAM5
Public ReadOnly Property DeselectCommand As ICommand
Get
If m_cmdDeselect Is Nothing Then
m_cmdDeselect = New RelayCommand(AddressOf Deselect, AddressOf CanDeselect)
m_cmdDeselect = New RelayCommand(AddressOf Deselect)
End If
Return m_cmdDeselect
End Get
@@ -440,13 +410,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.DESELECTPARTLAYEROBJ)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanDeselect(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' DeselectCommand
#Region "NameCommand"
@@ -457,7 +420,7 @@ Namespace EgtCAM5
Public ReadOnly Property NameCommand As ICommand
Get
If m_cmdName Is Nothing Then
m_cmdName = New RelayCommand(AddressOf Name, AddressOf CanName)
m_cmdName = New RelayCommand(AddressOf Name)
End If
Return m_cmdName
End Get
@@ -471,13 +434,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETNAME)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanName(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' NameCommand
#Region "InfoCommand"
@@ -488,7 +444,7 @@ Namespace EgtCAM5
Public ReadOnly Property InfoCommand As ICommand
Get
If m_cmdInfo Is Nothing Then
m_cmdInfo = New RelayCommand(AddressOf Info, AddressOf CanInfo)
m_cmdInfo = New RelayCommand(AddressOf Info)
End If
Return m_cmdInfo
End Get
@@ -502,13 +458,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETINFO)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanInfo(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' InfoCommand
#Region "RelocateCommand"
@@ -519,7 +468,7 @@ Namespace EgtCAM5
Public ReadOnly Property RelocateCommand As ICommand
Get
If m_cmdRelocate Is Nothing Then
m_cmdRelocate = New RelayCommand(AddressOf Relocate, AddressOf CanRelocate)
m_cmdRelocate = New RelayCommand(AddressOf Relocate)
End If
Return m_cmdRelocate
End Get
@@ -533,13 +482,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RELOCATEPARTLAYEROBJ)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanRelocate(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' RelocateCommand
#Region "CopyCommand"
@@ -550,7 +492,7 @@ Namespace EgtCAM5
Public ReadOnly Property CopyCommand As ICommand
Get
If m_cmdCopy Is Nothing Then
m_cmdCopy = New RelayCommand(AddressOf Copy, AddressOf CanCopy)
m_cmdCopy = New RelayCommand(AddressOf Copy)
End If
Return m_cmdCopy
End Get
@@ -564,13 +506,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.COPYPARTLAYEROBJ)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanCopy(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' CopyCommand
#Region "DeleteCommand"
@@ -581,7 +516,7 @@ Namespace EgtCAM5
Public ReadOnly Property DeleteCommand As ICommand
Get
If m_cmdDelete Is Nothing Then
m_cmdDelete = New RelayCommand(AddressOf Delete, AddressOf CanDelete)
m_cmdDelete = New RelayCommand(AddressOf Delete)
End If
Return m_cmdDelete
End Get
@@ -595,13 +530,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.DELETE)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanDelete(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' DeleteCommand
#Region "SaveCommand"
@@ -612,7 +540,7 @@ Namespace EgtCAM5
Public ReadOnly Property SaveCommand As ICommand
Get
If m_cmdSave Is Nothing Then
m_cmdSave = New RelayCommand(AddressOf Save, AddressOf CanSave)
m_cmdSave = New RelayCommand(AddressOf Save)
End If
Return m_cmdSave
End Get
@@ -628,13 +556,6 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.SAVEOBJECT, New SaveObjectParam(m_RightClickedTreeItemId, sDir, nType))
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanSave(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' SaveCommand
#End Region ' Commands
@@ -647,8 +568,14 @@ Namespace EgtCAM5
Private m_bEnableUpdateObjInObjTree As Boolean = True
Private Sub ObjTreeTickEvent(source As Object, e As EventArgs) Handles ObjTreeTimer.Tick
If m_nObjTreeOldId <> GDB_ID.NULL Then
EgtResetMark(m_nObjTreeOldId)
Dim nId As Integer = GDB_ID.NULL
If m_IsRightClickedTreeItem Then
nId = m_RightClickedTreeItemId
Else
nId = m_nObjTreeOldId
End If
If nId <> GDB_ID.NULL Then
EgtResetMark(nId)
EgtDraw()
End If
ObjTreeTimer.Stop()