EgtCAM5 :

- Migliorie varie.
This commit is contained in:
Emmanuele Sassi
2016-07-13 11:25:56 +00:00
parent d436516bba
commit 6a62deb28b
4 changed files with 97 additions and 56 deletions
+77 -44
View File
@@ -5,6 +5,10 @@ Namespace EgtCAM5
Public Class DrawPanelViewModel
Inherits ViewModelBase
#Region "FIELDS & PROPERTIES"
#Region "ToolTip"
'Proprietà ToolTip
Public ReadOnly Property PointToolTip As String
Get
@@ -229,6 +233,22 @@ Namespace EgtCAM5
End Get
End Property
#End Region ' ToolTip
' Definizione layer corrente
Private m_CurrentLayer As Integer
Public ReadOnly Property bLayerOk As Boolean
Get
Return m_CurrentLayer <> GDB_ID.NULL
End Get
End Property
' Definizione layer corrente
Private m_bSelOk As Boolean = (EgtGetFirstSelectedObj() <> GDB_ID.NULL)
Public ReadOnly Property bSelOk As Boolean
Get
Return m_bSelOk
End Get
End Property
' Definizione comandi
Private m_cmdPoint As ICommand
Private m_cmdLine2P As ICommand
@@ -274,11 +294,20 @@ Namespace EgtCAM5
Private m_cmdScale3D As ICommand
Private m_cmdOffset As ICommand
#End Region ' Fileds & Properties
#Region "CONSTRUCTOR"
Sub New()
Application.Msn.Register(Application.SETCURRLAYER, Sub(CurrLayer As Integer)
m_CurrentLayer = CurrLayer
End Sub)
End Sub
#End Region ' Constructor
#Region "COMMANDS"
#Region "PointCommand"
''' <summary>
@@ -304,7 +333,8 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanPoint(ByVal param As Object) As Boolean
Return True
Application.Msn.NotifyColleagues(Application.GETCURRLAYER)
Return bLayerOk
End Function
#End Region ' PointCommand
@@ -334,7 +364,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanLine2P(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' Line2PCommand
@@ -364,7 +394,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanLinePDL(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' LinePDLCommand
@@ -394,7 +424,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanCircleCP(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' CircleCPCommand
@@ -424,7 +454,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanCircleCD(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' CircleCDCommand
@@ -454,7 +484,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanArcCSE(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' ArcCSECommand
@@ -484,7 +514,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanArc3P(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' Arc3PCommand
@@ -514,7 +544,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanArcPDP(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' ArcPDPCommand
@@ -544,7 +574,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanFillet(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' FilletCommand
@@ -574,7 +604,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanChamfer(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' ChamferCommand
@@ -604,7 +634,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanRectangle2P(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' Rectangle2PCommand
@@ -634,7 +664,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanPolygon(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' PolygonCommand
@@ -664,7 +694,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanPolygonSide(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' PolygonSideCommand
@@ -694,7 +724,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanText(ByVal param As Object) As Boolean
Return True
Return bLayerOk
End Function
#End Region ' TextCommand
@@ -724,7 +754,8 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanPlane(ByVal param As Object) As Boolean
Return True
m_bSelOk = EgtGetFirstSelectedObj() <> GDB_ID.NULL
Return bLayerOk And bSelOk
End Function
#End Region ' PlaneCommand
@@ -754,7 +785,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanExtrude(ByVal param As Object) As Boolean
Return True
Return bLayerOk And bSelOk
End Function
#End Region ' ExtrudeCommand
@@ -784,7 +815,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanRevolve(ByVal param As Object) As Boolean
Return True
Return bLayerOk And bSelOk
End Function
#End Region ' RevolveCommand
@@ -814,7 +845,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanScrew(ByVal param As Object) As Boolean
Return True
Return bLayerOk And bSelOk
End Function
#End Region ' ScrewCommand
@@ -844,7 +875,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanRuled(ByVal param As Object) As Boolean
Return True
Return bLayerOk And bSelOk
End Function
#End Region ' RuledCommand
@@ -874,7 +905,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanMergeSurf(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' MergeSurfCommand
@@ -904,7 +935,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanExplodeSurf(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ExplodeSurfCommand
@@ -934,7 +965,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanInvertSurf(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' InvertSurfCommand
@@ -964,7 +995,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanDelete(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' DeleteCommand
@@ -994,7 +1025,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanChangeLayer(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ChangeLayerCommand
@@ -1024,7 +1055,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanChangeAlpha(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ChangeAlphaCommand
@@ -1054,7 +1085,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanResetColor(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ResetColorCommand
@@ -1084,7 +1115,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanChangeColor(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ChangeColorCommand
@@ -1114,7 +1145,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanInvertCurve(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' InvertCurveCommand
@@ -1144,7 +1175,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanChangeStartCurve(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ChangeStartCurveCommand
@@ -1174,7 +1205,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanExtendCurve(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ExtendCurveCommand
@@ -1204,7 +1235,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanBreakCurve(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' BreakCurveCommand
@@ -1234,7 +1265,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanSplitCurve(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' SplitCurveCommand
@@ -1264,7 +1295,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanJoinCurve(ByVal param As Object) As Boolean
Return True
Return bLayerOk And bSelOk
End Function
#End Region ' JoinCurveCommand
@@ -1294,7 +1325,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanExplodeCurve(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ExplodeCurveCommand
@@ -1324,7 +1355,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanSetCurveTh(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' SetCurveThCommand
@@ -1354,7 +1385,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanMove(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' MoveCommand
@@ -1384,7 +1415,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanRotate(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' RotateCommand
@@ -1414,7 +1445,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanRotate3D(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' Rotate3DCommand
@@ -1444,7 +1475,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanMirror(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' MirrorCommand
@@ -1474,7 +1505,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanMirror3D(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' Mirror3DCommand
@@ -1504,7 +1535,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanScale(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' ScaleCommand
@@ -1534,7 +1565,7 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanScale3D(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' Scale3DCommand
@@ -1564,11 +1595,13 @@ Namespace EgtCAM5
''' Returns always true.
''' </summary>
Private Function CanOffset(ByVal param As Object) As Boolean
Return True
Return bSelOk
End Function
#End Region ' OffsetCommand
#End Region ' Commands
End Class
End Namespace