Files
EgtCAM5/StatusBar/StatusBarViewModel.vb
T
Emmanuele Sassi 550057bf06 EgtCAM5 :
- modifiche varie.
2016-07-06 18:33:16 +00:00

205 lines
7.3 KiB
VB.net

Imports EgtUILib
Namespace EgtCAM5
Public Class StatusBarViewModel
Inherits ViewModelBase
#Region "FIELDS & PROPERTIES"
' GRAPHICAL ELEMENTS
Private m_StatusOutput As String
Public Property StatusOutput As String
Get
Return m_StatusOutput
End Get
Set(value As String)
m_StatusOutput = value
OnPropertyChanged("StatusOutput")
End Set
End Property
Private m_StatusCurrPos As String
Public Property StatusCurrPos As String
Get
Return m_StatusCurrPos
End Get
Set(value As String)
m_StatusCurrPos = value
OnPropertyChanged("StatusCurrPos")
End Set
End Property
Private m_StatusProgress As Integer
Public Property StatusProgress As Integer
Get
Return m_StatusProgress
End Get
Set(value As Integer)
m_StatusProgress = value
OnPropertyChanged("StatusProgress")
End Set
End Property
Private m_StatusStop As Boolean
Public Property StatusStop As Boolean
Get
Return m_StatusStop
End Get
Set(value As Boolean)
m_StatusStop = value
OnPropertyChanged("StatusStop")
End Set
End Property
Private m_StatusGridText As String
Public Property StatusGridText As String
Get
Return m_StatusGridText
End Get
Set(value As String)
m_StatusGridText = value
OnPropertyChanged("StatusGridText")
End Set
End Property
' Commands definition
Private m_cmdStatusGrid As ICommand
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
Application.Msn.Register(Application.NOTIFYCURRPOS, Sub(sCursorPos As String)
StatusCurrPos = sCursorPos
End Sub)
Application.Msn.Register(Application.NOTIFYSTATUSOUTPUT, Sub(sStatusOutput As String)
StatusOutput = sStatusOutput
End Sub)
Application.Msn.Register(Application.NOTIFYSTATUSPROGRESS, Sub(sStatusProgress As Integer)
StatusProgress = sStatusProgress
End Sub)
Application.Msn.Register(Application.NOTIFYSTATUSSTOP, Sub(sStatusStop As Boolean)
StatusStop = sStatusStop
End Sub)
Application.Msn.Register(Application.UPDATESTATUSGRID, Sub(UpdateStatusGridParam As UpdateStatusGridParam)
UpdateStatusGrid(UpdateStatusGridParam.m_bShowGrid, UpdateStatusGridParam.m_bShowGridFrame)
End Sub)
End Sub
#End Region ' Constructor
#Region "COMMANDS"
#Region "StatusGridCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property StatusGridCommand As ICommand
Get
If m_cmdStatusGrid Is Nothing Then
m_cmdStatusGrid = New RelayCommand(AddressOf StatusGrid, AddressOf CanStatusGrid)
End If
Return m_cmdStatusGrid
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub StatusGrid(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.STATUSGRIDCOMMAND)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanStatusGrid(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' DoneCommand
#End Region ' Commands
#Region "METHODS"
'Private Sub ToolStripStatusSnapPointType_Changed(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean) Handles Scene1.OnChangedSnapPointType
' If bUser Then
' tsStatusSnapPointType.BackColor = SystemColors.Control
' Else
' tsStatusSnapPointType.BackColor = Color.Bisque
' End If
' Select Case nSpType
' Case SP.PT_SKETCH
' tsStatusSnapPointType.Text = EgtMsg(1102) 'Sketch Point
' Case SP.PT_GRID
' tsStatusSnapPointType.Text = EgtMsg(1104) 'Grid Point
' Case SP.PT_END
' tsStatusSnapPointType.Text = EgtMsg(1106) 'End Point
' Case SP.PT_MID
' tsStatusSnapPointType.Text = EgtMsg(1108) 'Mid Point
' Case SP.CENTER
' tsStatusSnapPointType.Text = EgtMsg(1110) 'Center
' Case SP.CENTROID
' tsStatusSnapPointType.Text = EgtMsg(1112) 'Centroid
' Case SP.PT_NEAR
' tsStatusSnapPointType.Text = EgtMsg(1114) 'Near Point"
' Case SP.PT_INTERS
' tsStatusSnapPointType.Text = EgtMsg(1116) 'Inters Point
' Case SP.PT_TANGENT
' tsStatusSnapPointType.Text = EgtMsg(1118) 'Tang Point
' Case SP.PT_PERPENDICULAR
' tsStatusSnapPointType.Text = EgtMsg(1120) 'Perp Point
' Case SP.PT_MINDIST
' tsStatusSnapPointType.Text = EgtMsg(1122) 'MinDist Point"
' Case Else
' tsStatusSnapPointType.Text = "---"
' End Select
'End Sub
'Private Sub ToolStripStatusGrid_Click() Handles tsStatusGrid.Click
' m_bShowGrid = Not m_bShowGrid
' UpdateStatusGrid()
' EgtDraw()
'End Sub
Private Sub UpdateStatusGrid(bShowGrid As Boolean, bShowGridFrame As Boolean)
'tsStatusGrid.ForeColor = If(m_bShowGrid, Color.Black, Color.Gray)
StatusGridText = If(bShowGrid, "GRID ON ", "GRID OFF")
EgtSetGridShow(bShowGrid, bShowGrid And bShowGridFrame)
End Sub
'Private Sub ToolStripStatusTypePos_Click() Handles tsStatusCurPosType.Click
' m_bCPlaneTypePos = Not m_bCPlaneTypePos
' If m_bCPlaneTypePos Then
' tsStatusCurPosType.Text = "CPLANE"
' Else
' tsStatusCurPosType.Text = "WORLD "
' End If
' Scene1.SetGridCursorPos(m_bCPlaneTypePos)
'End Sub
'Private Sub ToolStripStatusUnits_Click() Handles tsStatusUnits.Click
' m_bMmUnits = Not m_bMmUnits
' UpdateStatusUnits()
' LoadGridData()
' EgtDraw()
'End Sub
'Private Sub UpdateStatusUnits()
' tsStatusUnits.Text = If(m_bMmUnits, "mm", "in")
' EgtSetUiUnits(m_bMmUnits)
'End Sub
'Private Sub ToolStripStatusStop_Click() Handles tsStatusStop.Click
' m_bStopScript = True
'End Sub
#End Region ' Methods
End Class
End Namespace