diff --git a/Application.xaml.vb b/Application.xaml.vb
index 469afc7..9da270f 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -26,12 +26,12 @@ Class Application
Friend Const PROJECTPAGE_DESELECTED As String = "ProjectPage_Deselected"
' ProjectPage messages
- Friend Const NOTIFYCURRPOSCHANGED As String = "ProjectPage_CurrPosChanged"
+ Friend Const NOTIFYCURRPOS As String = "NotifyCurrPos"
Friend Const NOTIFYINPUTTEXT As String = "NotifyInputText"
- Friend Const REGISTERINPUTTEXT As String = "Register_InputText_Text"
Friend Const NOTIFYSTATUSOUTPUT As String = "NotifyStatusOutput"
Friend Const NOTIFYSTATUSPROGRESS As String = "NotifyStatusProgress"
- Friend Const NOTIFYSTATUSSTOP_ISENABLED As String = "NotifyStatusStop_IsEnabled"
+ Friend Const NOTIFYSTATUSSTOP As String = "NotifyStatusStop"
+ Friend Const UPDATESTATUSGRID As String = "UpdateStatusGrid"
' GridViewPanel messages
Friend Const WIREFRAME As String = "Wireframe"
@@ -65,6 +65,8 @@ Class Application
Friend Const CPLANE3P As String = "CPlane3P"
Friend Const CPLANEPERPOBJ As String = "CPlanePerpObj"
Friend Const CPLANEOBJ As String = "CPlaneObj"
+
+ ' DrawPanel messages
Friend Const POINT As String = "Point"
Friend Const LINE2P As String = "Line2P"
Friend Const LINEPDL As String = "LinePDL"
@@ -100,6 +102,22 @@ Class Application
Friend Const SCALE As String = "Scale"
Friend Const OFFSET As String = "Offset"
+ ' Controller messages
+ Friend Const SETLASTBOOLEAN As String = "SetLastBoolean"
+ Friend Const SETLASTINTEGER As String = "SetLastInteger"
+ Friend Const SHOW As String = "Show"
+ Friend Const DONE As String = "Done"
+
+ ' DrawOptionPanel messages
+ Friend Const PREPAREINPUTBOX As String = "PrepareInputBox"
+ Friend Const SETINPUTBOXTEXT As String = "SetInputBoxText"
+ Friend Const SETINPUTBOXCHECK As String = "SetInputBoxCheck"
+ Friend Const ADDINPUTBOXCOMBO As String = "AddInputBoxCombo"
+ Friend Const RESETINPUTBOX As String = "ResetInputBox"
+
+ ' StatusBar messages
+ Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
+
' ToolsDbPage messages
Friend Const REMOVETOOL As String = "RemoveTool"
Friend Const ERRORONTOOL As String = "ErrorOnTool"
diff --git a/Base/BaseWindow/BaseWindowView.xaml.vb b/Base/BaseWindow/BaseWindowView.xaml.vb
index 517ea67..61ebd3b 100644
--- a/Base/BaseWindow/BaseWindowView.xaml.vb
+++ b/Base/BaseWindow/BaseWindowView.xaml.vb
@@ -11,6 +11,7 @@ Public Class BaseWindowView
' Set this as owned by MainWindow, when this one is rendered
Application.Msn.Register(Application.MAINWINDOW_CONTENTRENDERED, Sub()
Me.Owner = Application.Current.MainWindow
+ Me.Focus()
End Sub)
Application.Msn.Register(Application.MAINWINDOW_ACTIVATED, Sub()
'Me.Topmost = True
diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb
index 9b7db7c..1949213 100644
--- a/Constants/ConstMsg.vb
+++ b/Constants/ConstMsg.vb
@@ -6,8 +6,10 @@
Public Const MSG_EGTCAM5 As Integer = 5000
Public Const MSG_MAINWINDOW As Integer = MSG_EGTCAM5
Public Const MSG_TOOLSDBPAGE As Integer = MSG_EGTCAM5 + 1000
+ Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1085
Public Const MSG_MACHININGSDBPAGE As Integer = MSG_EGTCAM5 + 1100
- 'Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220
+ Public Const MSG_MACHININGSERRORS As Integer = MSG_EGTCAM5 + 1220
+ 'Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220
'Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300
'Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330
'Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index 339e4e0..723532f 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -158,6 +158,7 @@
+ ToolsDbView.xaml
diff --git a/EgtCAM5Resources.xaml b/EgtCAM5Resources.xaml
index 5d26a7f..f9799d6 100644
--- a/EgtCAM5Resources.xaml
+++ b/EgtCAM5Resources.xaml
@@ -4,6 +4,8 @@
xmlns:local="clr-namespace:EgtCAM5"
xmlns:ViewModel="clr-namespace:EgtCAM5.EgtCAM5">
+
+
-
-
-
-
-
-
+
+
-
-
-
+
+
+
-
-
+
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/InputExpander/InputExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/InputExpander/InputExpanderViewModel.vb
index b572c85..d18e6fb 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/InputExpander/InputExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/InputExpander/InputExpanderViewModel.vb
@@ -1,6 +1,292 @@
-Namespace EgtCAM5
+Imports System.Collections.ObjectModel
+
+Namespace EgtCAM5
Public Class InputExpanderViewModel
+ Inherits ViewModelBase
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Expander fields
+ Private m_IsExpanded As Boolean
+ Public Property IsExpanded As Boolean
+ Get
+ Return m_IsExpanded
+ End Get
+ Set(value As Boolean)
+ m_IsExpanded = value
+ OnPropertyChanged("IsExpanded")
+ End Set
+ End Property
+
+ Private m_IsEnabled As Boolean
+ Public Property IsEnabled As Boolean
+ Get
+ Return m_IsEnabled
+ End Get
+ Set(value As Boolean)
+ m_IsEnabled = value
+ OnPropertyChanged("IsEnabled")
+ End Set
+ End Property
+
+ Private m_Title As String
+ Public Property Title As String
+ Get
+ Return m_Title
+ End Get
+ Set(value As String)
+ m_Title = value
+ OnPropertyChanged("Title")
+ End Set
+ End Property
+
+ ' TextBlock fields
+ Private m_TextBlock As String
+ Public Property TextBlock As String
+ Get
+ Return m_TextBlock
+ End Get
+ Set(value As String)
+ m_TextBlock = value
+ OnPropertyChanged("TextBlock")
+ End Set
+ End Property
+
+ ' TextBox fields
+ Private m_TextBox As String
+ Public Property TextBox As String
+ Get
+ Return m_TextBox
+ End Get
+ Set(value As String)
+ m_TextBox = value
+ OnPropertyChanged("TextBox")
+ End Set
+ End Property
+
+ Private m_FocusTextBox As Boolean
+ Public Property FocusTextBox As Boolean
+ Get
+ Return m_FocusTextBox
+ End Get
+ Set(value As Boolean)
+ m_FocusTextBox = value
+ OnPropertyChanged("FocusTextBox")
+ End Set
+ End Property
+
+ 'CheckBox fields
+ Private m_CheckBoxText As String
+ Public Property CheckBoxText As String
+ Get
+ Return m_CheckBoxText
+ End Get
+ Set(value As String)
+ m_CheckBoxText = value
+ OnPropertyChanged("CheckBoxText")
+ End Set
+ End Property
+
+ Private m_IsChecked As Boolean
+ Public Property IsChecked As Boolean
+ Get
+ Return m_IsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_IsChecked Then
+ Application.Msn.NotifyColleagues(Application.SETLASTBOOLEAN, IsChecked)
+ m_IsChecked = value
+ OnPropertyChanged("IsChecked")
+ End If
+ End Set
+ End Property
+
+ ' ComboBox fields
+ Private m_ComboItemsList As ObservableCollection(Of String)
+ Public Property ComboItemsList As ObservableCollection(Of String)
+ Get
+ Return m_ComboItemsList
+ End Get
+ Set(value As ObservableCollection(Of String))
+ m_ComboItemsList = value
+ OnPropertyChanged("ComboItemsList")
+ End Set
+ End Property
+
+ Private m_ComboSelectedIndex As Integer
+ Public Property ComboSelectedIndex As Integer
+ Get
+ Return m_ComboSelectedIndex
+ End Get
+ Set(value As Integer)
+ If value <> m_ComboSelectedIndex Then
+ Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, ComboSelectedIndex)
+ m_ComboSelectedIndex = value
+ OnPropertyChanged("ComboSelectedIndex")
+ End If
+ End Set
+ End Property
+
+ ' Buttons fields
+ Private m_ShowBtnVisibility As Boolean
+ Public Property ShowBtnVisibility As Boolean
+ Get
+ Return m_ShowBtnVisibility
+ End Get
+ Set(value As Boolean)
+ m_ShowBtnVisibility = value
+ OnPropertyChanged("ShowBtnVisibility")
+ End Set
+ End Property
+
+ ' Commands definition
+ Private m_cmdShow As ICommand
+ Private m_cmdDone As ICommand
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ Application.Msn.NotifyColleagues(Application.NOTIFYINPUTTEXT, TextBox)
+ RegisterMethodsCall()
+ End Sub
+
+#End Region ' Constructor
+
+#Region "COMMANDS"
+
+#Region "ShowCommand"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property ShowCommand As ICommand
+ Get
+ If m_cmdShow Is Nothing Then
+ m_cmdShow = New RelayCommand(AddressOf Show, AddressOf CanShow)
+ End If
+ Return m_cmdShow
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub Show(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.SHOW, TextBox)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanShow(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ShowCommand
+
+#Region "DoneCommand"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property DoneCommand As ICommand
+ Get
+ If m_cmdDone Is Nothing Then
+ m_cmdDone = New RelayCommand(AddressOf Done, AddressOf CanDone)
+ End If
+ Return m_cmdDone
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub Done(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.DONE, TextBox)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanDone(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' DoneCommand
+
+#End Region
+
+#Region "METHODS"
+
+ Sub RegisterMethodsCall()
+ Application.Msn.Register(Application.PREPAREINPUTBOX, Sub(PrepareInputBoxParam As PrepareInputBoxParam)
+ PrepareInputBox(PrepareInputBoxParam)
+ End Sub)
+ Application.Msn.Register(Application.SETINPUTBOXTEXT, Sub(sString As String)
+ SetInputBoxText(sString)
+ End Sub)
+ Application.Msn.Register(Application.SETINPUTBOXCHECK, Sub(bBoolean As Boolean)
+ SetInputBoxCheck(bBoolean)
+ End Sub)
+ Application.Msn.Register(Application.ADDINPUTBOXCOMBO, Sub(AddInputBoxComboParam As AddInputBoxComboParam)
+ AddInputBoxCombo(AddInputBoxComboParam.sText, AddInputBoxComboParam.bSelected)
+ End Sub)
+ End Sub
+
+ Private Sub PrepareInputBox(PrepareInputBoxParam As PrepareInputBoxParam)
+ Title = PrepareInputBoxParam.sTitle
+ TextBlock = PrepareInputBoxParam.sLabel
+ TextBox = ""
+ If PrepareInputBoxParam.sCheckLabel <> "" Then
+ CheckBoxText = PrepareInputBoxParam.sCheckLabel
+ End If
+ If PrepareInputBoxParam.bShowCombo Then
+ ComboItemsList.Clear()
+ End If
+ If PrepareInputBoxParam.bShowBtn Then
+ ShowBtnVisibility = True
+ End If
+ FocusTextBox = True
+ End Sub
+
+
+ Private Sub ResetInputBox()
+ Title = "Drawing Parameters"
+ IsExpanded = False
+ IsEnabled = False
+ End Sub
+
+ Private Function SetInputBoxText(ByVal sVal As String) As Boolean
+ TextBox = sVal
+ FocusTextBox = True
+ Return True
+ End Function
+
+ Private Function SetInputBoxCheck(ByVal bCheck As Boolean) As Boolean
+ IsChecked = bCheck
+ Application.Msn.NotifyColleagues(Application.SETLASTBOOLEAN, IsChecked)
+ Return True
+ End Function
+
+ Private Function AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) As Boolean
+ ComboItemsList.Add(sText)
+ If bSelected Then
+ ComboSelectedIndex = ComboItemsList.Count - 1
+ End If
+ Return True
+ End Function
+
+ 'Private Sub InputText_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles InputText.KeyDown
+ ' ' Con RETURN avanzo di un passo
+ ' If e.KeyData = Keys.Return Then
+ ' m_Controller.Done(InputText.Text)
+ ' End If
+ 'End Sub
+
+#End Region ' Methods
End Class
diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb
index 5230a67..042ad03 100644
--- a/ProjectPage/ProjectViewModel.vb
+++ b/ProjectPage/ProjectViewModel.vb
@@ -31,6 +31,7 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATION)
End If
IniFile.m_ProjectSceneContext = m_ProjectScene.GetCtx
+ InitializeEgtProject()
' inizializzo gestore lavorazioni
EgtInitMachMgr(IniFile.m_sMachinesRoot)
EgtOpenFile("c:\EgtData\Varie\Temp\Fiera02.Nge")
@@ -47,7 +48,17 @@ Namespace EgtCAM5
#Region "EGTUILIB FIELDS"
+ Private m_bShowGrid As Boolean
+ Private m_bShowGridFrame As Boolean
+ 'Private m_bCPlaneTypePos As Boolean
+ Private m_bMmUnits As Boolean
+ 'Private WithEvents m_Controller As New Controller
+ 'Private m_MruFiles As New MruList
+ 'Private m_MruScripts As New MruList
Private m_bScriptRunning As Boolean = False
+ 'Private m_bStopExec As Boolean = False
+ 'Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
+ 'Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
' Variabile per implementazione eventi
Private m_InputText As String
@@ -66,8 +77,23 @@ Namespace EgtCAM5
m_DrawOptionPanel = New BaseWindowView
m_DrawOptionPanel.DataContext = New DrawOptionPanelViewModel
m_DrawOptionPanel.Show()
+ ' Funzione che contiene la registrazione alle funzioni che permettono di visualizzare e nascondere le finestre di disegno
ManagePanelVisibility()
+ ' Inizializza i parametri della scena
+ 'InitializeEgtProject()
+ ' Funzione che contiene la registrazione di tutti le funzioni del DrawPanel
RegisterDrawPanelCommands()
+ ' Funzione che contiene la registrazione di tutti i comandi del DrawOptionPanel
+ RegisterDrawOptionPanelCommands()
+ ' Funzione che contiene la registrazione di tutti i comandi della StatusBar
+ RegisterStatusBarCommands()
+ End Sub
+
+#End Region
+
+#Region "METHODS"
+
+ Private Sub InitializeEgtProject()
'Impostazioni Controller
m_Controller.SetScene(m_ProjectScene)
'Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0, m_sIniFile) <> 0)
@@ -79,18 +105,56 @@ Namespace EgtCAM5
' ' MessageBoxButtons.OK, MessageBoxIcon.Warning)
' 'End If
'End If
-
-
- ' MESSAGGI PER IL CONTROLLER
- Application.Msn.Register(Application.NOTIFYINPUTTEXT, Sub(sInputText As String)
- m_InputText = sInputText
- End Sub)
+ '' imposto unità di misura per interfaccia utente
+ 'm_bMmUnits = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1, m_sIniFile) <> 0)
+ 'UpdateStatusUnits()
+ '' imposto visualizzazione riferimento globale
+ 'Dim bShowGlobFrame As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWGFRAME, 1, m_sIniFile) <> 0)
+ 'EgtSetGlobFrameShow(bShowGlobFrame)
+ ' imposto i dati della griglia
+ LoadGridData()
+ ' imposto stato di visualizzazione della griglia
+ m_bShowGrid = (GetPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0)
+ m_bShowGridFrame = (GetPrivateProfileInt(S_GRID, K_SHOWFRAME, 1) <> 0)
+ Application.Msn.NotifyColleagues(Application.UPDATESTATUSGRID, New UpdateStatusGridParam(m_bShowGrid, m_bShowGridFrame))
+ '' imposto tipo coordinate
+ 'm_bCPlaneTypePos = True
+ 'Scene1.SetGridCursorPos(m_bCPlaneTypePos)
+ '' modo di visualizzazione
+ 'Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING, m_sIniFile)
+ 'If nShowMode = SM.WIREFRAME Then
+ ' btnWireFrame.Checked = True
+ 'ElseIf nShowMode = SM.HIDDENLINE Then
+ ' btnHiddenLine.Checked = True
+ 'Else
+ ' btnShading.Checked = True
+ 'End If
+ '' visualizzazione direzione curve
+ 'Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0, m_sIniFile)
+ 'chkCurveDir.Checked = (nShowCurveDir <> 0)
+ '' visualizzazione avanzata dei triangoli costituenti le superfici
+ 'Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_sIniFile) <> 0)
+ 'EgtSetShowTriaAdv(bShowTriaAdv)
+ '' ObjTree non selezionato
+ 'm_nObjTreeOldId = GDB_ID.NULL
+ '' nascondo input box
+ 'ResetInputBox()
End Sub
-#End Region
-
-#Region "METHODS"
+ Private Sub LoadGridData()
+ Dim dSnapStep As Double = GetPrivateProfileDouble(S_GRID, If(m_bMmUnits, K_SNAPSTEP, K_SNAPSTEPINCH), 10)
+ Dim nMinLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
+ Dim nMajLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10)
+ Dim nExtSStep As Integer = GetPrivateProfileInt(S_GRID, K_EXTSSTEP, 50)
+ Dim MinLnColor As New Color3d(160, 160, 160)
+ GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor)
+ Dim MajLnColor As New Color3d(160, 160, 160)
+ GetPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor)
+ EgtSetGridFrame(Frame3d.GLOB)
+ EgtSetGridGeo(dSnapStep, nMinLineSStep, nMajLineSStep, nExtSStep)
+ EgtSetGridColor(MinLnColor, MajLnColor)
+ End Sub
'''
''' Method that manage the visibility of the ProjectPage's Panels
@@ -392,12 +456,35 @@ Namespace EgtCAM5
End Sub
+ Sub RegisterDrawOptionPanelCommands()
+ Application.Msn.Register(Application.NOTIFYINPUTTEXT, Sub(sInputText As String)
+ m_InputText = sInputText
+ End Sub)
+ Application.Msn.Register(Application.SETLASTBOOLEAN, Sub(bBoolean As Boolean)
+ m_Controller.SetLastBoolean(bBoolean)
+ End Sub)
+ Application.Msn.Register(Application.SHOW, Sub(sString As String)
+ m_Controller.Show(sString)
+ End Sub)
+ Application.Msn.Register(Application.DONE, Sub(sString As String)
+ m_Controller.Done(sString)
+ End Sub)
+ End Sub
+
+ Sub RegisterStatusBarCommands()
+ Application.Msn.Register(Application.STATUSGRIDCOMMAND, Sub()
+ m_bShowGrid = Not m_bShowGrid
+ Application.Msn.NotifyColleagues(Application.UPDATESTATUSGRID, New UpdateStatusGridParam(m_bShowGrid, m_bShowGridFrame))
+ EgtDraw()
+ End Sub)
+ End Sub
+
#End Region
#Region "SCENE EVENTS"
Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String) Handles m_ProjectScene.OnCursorPos
- Application.Msn.NotifyColleagues(Application.NOTIFYCURRPOSCHANGED, sCursorPos)
+ Application.Msn.NotifyColleagues(Application.NOTIFYCURRPOS, sCursorPos)
End Sub
Private Sub OnMouseSelectedAll(ByVal sender As Object) Handles m_ProjectScene.OnMouseSelectedAll
@@ -538,7 +625,7 @@ Namespace EgtCAM5
'ClearObjTree()
'Abilito progress e bottone stop
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSPROGRESS, 0)
- Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP_ISENABLED, True)
+ Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP, True)
' Dichiaro script in esecuzione
m_bScriptRunning = True
End Sub
@@ -554,49 +641,49 @@ Namespace EgtCAM5
'End If
' Disabilito progress e bottone stop
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSPROGRESS, 0)
- Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP_ISENABLED, False)
+ Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP, False)
'' Dichiaro terminata esecuzione script
m_bScriptRunning = False
End Sub
Private Sub OnPrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean) Handles m_Controller.PrepareInputBox
- 'PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
+ Application.Msn.NotifyColleagues(Application.PREPAREINPUTBOX, New PrepareInputBoxParam(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn))
End Sub
- ' Private Sub OnSetInputBoxText(ByVal sText As String) Handles m_Controller.SetInputBoxText
- ' SetInputBoxText(sText)
- ' End Sub
+ Private Sub OnSetInputBoxText(ByVal sText As String) Handles m_Controller.SetInputBoxText
+ Application.Msn.NotifyColleagues(Application.SETINPUTBOXTEXT, sText)
+ End Sub
- ' Private Sub OnSetInputBoxCheck(ByVal bCheck As Boolean) Handles m_Controller.SetInputBoxCheck
- ' SetInputBoxCheck(bCheck)
- ' End Sub
+ Private Sub OnSetInputBoxCheck(ByVal bCheck As Boolean) Handles m_Controller.SetInputBoxCheck
+ Application.Msn.NotifyColleagues(Application.SETINPUTBOXCHECK, bCheck)
+ End Sub
- ' Private Sub OnAddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) Handles m_Controller.AddInputBoxCombo
- ' AddInputBoxCombo(sText, bSelected)
- ' End Sub
+ Private Sub OnAddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) Handles m_Controller.AddInputBoxCombo
+ Application.Msn.NotifyColleagues(Application.ADDINPUTBOXCOMBO, New AddInputBoxComboParam(sText, bSelected))
+ End Sub
- ' Private Sub OnUpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean) Handles m_Controller.UpdateUI
- ' ' pulisco input e relativi messaggi
- ' ResetInputBox()
- ' If m_Controller.GetContinue() Then
- ' EmitStripStatusOutput(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
- ' Else
- ' EmitStripStatusOutput("")
- ' End If
- ' ' aggiorno dati correnti
- ' EmitTitle()
- ' EmitCurrPartLayer()
- ' If bReloadUI Then
- ' LoadObjTree()
- ' Else
- ' UpdateObjTree()
- ' End If
- ' End Sub
+ Private Sub OnUpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean) Handles m_Controller.UpdateUI
+ ' pulisco input e relativi messaggi
+ Application.Msn.NotifyColleagues(Application.RESETINPUTBOX)
+ If m_Controller.GetContinue() Then
+ Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, (EgtMsg(399))) ' Continue : 'L' with line, 'A' with arc
+ Else
+ Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, (""))
+ End If
+ ' aggiorno dati correnti
+ 'EmitTitle()
+ 'EmitCurrPartLayer()
+ 'If bReloadUI Then
+ ' LoadObjTree()
+ 'Else
+ ' UpdateObjTree()
+ 'End If
+ End Sub
- ' Private Sub OutputInfo(ByVal sender As Object, ByVal sText As String) Handles m_Controller.OutputInfo
- ' EmitStripStatusOutput(sText)
- ' End Sub
+ Private Sub OutputInfo(ByVal sender As Object, ByVal sText As String) Handles m_Controller.OutputInfo
+ Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, sText)
+ End Sub
#End Region
diff --git a/StatusBar/StatusBarView.xaml b/StatusBar/StatusBarView.xaml
index 307d4b3..707bb03 100644
--- a/StatusBar/StatusBarView.xaml
+++ b/StatusBar/StatusBarView.xaml
@@ -7,7 +7,7 @@
d:DesignHeight="20" d:DesignWidth="1366">
-
+
@@ -34,7 +34,7 @@
-
+
@@ -43,7 +43,7 @@
-
+
diff --git a/StatusBar/StatusBarViewModel.vb b/StatusBar/StatusBarViewModel.vb
index 91332a8..cb67ba2 100644
--- a/StatusBar/StatusBarViewModel.vb
+++ b/StatusBar/StatusBarViewModel.vb
@@ -1,8 +1,12 @@
-Namespace EgtCAM5
+Imports EgtUILib
+
+Namespace EgtCAM5
Public Class StatusBarViewModel
Inherits ViewModelBase
+#Region "FIELDS & PROPERTIES"
+
' GRAPHICAL ELEMENTS
Private m_StatusOutput As String
Public Property StatusOutput As String
@@ -37,32 +41,165 @@
End Set
End Property
- Private m_StatusStop_IsEnabled As Boolean
- Public Property StatusStop_IsEnabled As Boolean
+ Private m_StatusStop As Boolean
+ Public Property StatusStop As Boolean
Get
- Return m_StatusStop_IsEnabled
+ Return m_StatusStop
End Get
Set(value As Boolean)
- m_StatusStop_IsEnabled = value
- OnPropertyChanged("StatusStop_IsEnabled")
+ 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.NOTIFYCURRPOSCHANGED, Sub(sCursorPos As String)
- StatusCurrPos = sCursorPos
- End Sub)
+ 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_ISENABLED, Sub(sStatusStop As Boolean)
- StatusStop_IsEnabled = sStatusStop
- 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"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ 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
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub StatusGrid(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.STATUSGRIDCOMMAND)
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ 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
\ No newline at end of file
diff --git a/StructureDataForMessenger.vb b/StructureDataForMessenger.vb
new file mode 100644
index 0000000..9bbb25d
--- /dev/null
+++ b/StructureDataForMessenger.vb
@@ -0,0 +1,43 @@
+Namespace EgtCAM5
+
+ Public Class PrepareInputBoxParam
+ Friend sTitle As String
+ Friend sLabel As String
+ Friend sCheckLabel As String
+ Friend bShowCombo As Boolean
+ Friend bShowBtn As Boolean
+
+ Sub New(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
+ ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean)
+ Me.sTitle = sTitle
+ Me.sLabel = sLabel
+ Me.sCheckLabel = sCheckLabel
+ Me.bShowCombo = bShowCombo
+ Me.bShowBtn = bShowBtn
+ End Sub
+
+ End Class
+
+ Public Class AddInputBoxComboParam
+ Friend sText As String
+ Friend bSelected As Boolean
+
+ Sub New(ByVal sText As String, ByVal bSelected As Boolean)
+ Me.sText = sText
+ Me.bSelected = bSelected
+ End Sub
+
+ End Class
+
+ Public Class UpdateStatusGridParam
+ Friend m_bShowGrid As Boolean
+ Friend m_bShowGridFrame As Boolean
+
+ Sub New(ByVal bShowGrid As Boolean, bShowGridFrame As Boolean)
+ Me.m_bShowGrid = bShowGrid
+ Me.m_bShowGridFrame = bShowGridFrame
+ End Sub
+
+ End Class
+
+End Namespace
diff --git a/ToolsDbPage/ToolTreeView.vb b/ToolsDbPage/ToolTreeView.vb
index 4d8ccfe..71a1f86 100644
--- a/ToolsDbPage/ToolTreeView.vb
+++ b/ToolsDbPage/ToolTreeView.vb
@@ -115,7 +115,7 @@ Public Class ToolTreeViewItem
Else
If EgtTdbIsCurrToolModified() And Me.IsValid Then
- Select Case MsgBox("Save the modified tool?", MsgBoxStyle.YesNo, "SAVE")
+ Select Case MsgBox(EgtMsg(MSG_TOOLSERRORS), MsgBoxStyle.YesNo, EgtMsg(MSG_TOOLSERRORS + 1))
Case MsgBoxResult.Yes
m_NewTool = False
EgtTdbSaveCurrTool()
@@ -920,16 +920,16 @@ Public Class ToolTreeViewItem
Private Function ValidateDraw() As String
If bDrawNameError Then
- Return "Il file deve essere di tipo .nge"
+ Return EgtMsg(MSG_TOOLSERRORS + 2)
End If
If bDrawNameExistError Then
- Return "Il file non esiste"
+ Return EgtMsg(MSG_TOOLSERRORS + 3)
End If
If bToolMakerError Then
- Return "Non esiste il ToolMaker per questo tipo di utensile"
+ Return EgtMsg(MSG_TOOLSERRORS + 4)
End If
If bDrawingError Then
- Return "Impossibile creare l'utensile con questi parametri"
+ Return EgtMsg(MSG_TOOLSERRORS + 5)
End If
Return Nothing
End Function
@@ -937,10 +937,10 @@ Public Class ToolTreeViewItem
Private Function ValidateMaxMat() As String
If m_Draw = String.Empty Then
If m_MaxMat < EPS_SMALL Then
- Return "Il valore di MaxMat deve essere maggiore di 0"
+ Return EgtMsg(MSG_TOOLSERRORS + 6)
End If
If m_MaxMat > m_Len Then
- Return "Il valore di MaxMat non può essere maggiore di quello di Len"
+ Return EgtMsg(MSG_TOOLSERRORS + 7)
End If
End If
Return Nothing
@@ -948,35 +948,35 @@ Public Class ToolTreeViewItem
Private Function ValidateThick() As String
If (m_Type = MCH_TY.SAW_FLAT Or m_Type = MCH_TY.SAW_STD Or m_Type = MCH_TY.MORTISE_STD) And m_Draw = String.Empty And m_Thick < EPS_SMALL Then
- Return "Il valore di Thick deve essere maggiore di 0"
+ Return EgtMsg(MSG_TOOLSERRORS + 8)
End If
Return Nothing
End Function
Private Function ValidateDiam() As String
If m_Draw = String.Empty And m_Diam < EPS_SMALL Then
- Return "Il valore di Diam deve essere maggiore di 0"
+ Return EgtMsg(MSG_TOOLSERRORS + 9)
End If
Return Nothing
End Function
Private Function ValidateLen() As String
If m_Draw = String.Empty And m_Len < EPS_SMALL Then
- Return "Il valore di Len deve essere maggiore di 0"
+ Return EgtMsg(MSG_TOOLSERRORS + 10)
End If
Return Nothing
End Function
Private Function ValidateSpeed() As String
If m_Speed > m_MaxSpeed Then
- Return "Il valore di Speed non può essere maggiore di quello di MaxSpeed"
+ Return EgtMsg(MSG_TOOLSERRORS + 11)
End If
Return Nothing
End Function
Private Function ValidateName() As String
If bErrorToolName Then
- Return "Nome non valido"
+ Return EgtMsg(MSG_TOOLSERRORS + 12)
End If
Return Nothing
End Function