diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
index b221569..de96c14 100644
--- a/OptionsWindow/OptionModule.vb
+++ b/OptionsWindow/OptionModule.vb
@@ -34,6 +34,7 @@ Friend Module OptionModule
Friend m_TopSceneBackground As Color3d
Friend m_BotSceneBackground As Color3d
+ Friend m_GridColor As Color3d
Friend m_DefMaterialColor As Color3d
' inizializzazione lettura variabili ad inizio programma
@@ -67,15 +68,18 @@ Friend Module OptionModule
m_bNewMachiningIsLastOne = If(GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0, True, False)
' Inizializzo variabile che indica se usare script di disposizione
m_bUseDispositionScript = If(GetPrivateProfileInt(S_OPTIONS, K_USEDISPOSITIONSCRIPT, 0) <> 0, True, False)
- ' Inizializzo variabili colori di sfondo scena e materiale default
- Dim DefColor As New Color3d(0, 0, 0)
- GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ ' Inizializzo variabili colori di sfondo scena, griglia e materiale default
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ Dim DefColor As New Color3d(0, 0, 0)
+ GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ Dim GridColor As New Color3d(0, 0, 0)
+ GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
m_TopSceneBackground = BackTopColor
m_BotSceneBackground = BackBotColor
+ m_GridColor = GridColor
m_DefMaterialColor = DefColor
End Sub
diff --git a/OptionsWindow/OptionWindowV.xaml b/OptionsWindow/OptionWindowV.xaml
index 39dff6f..1020df4 100644
--- a/OptionsWindow/OptionWindowV.xaml
+++ b/OptionsWindow/OptionWindowV.xaml
@@ -43,6 +43,13 @@
Command="{Binding BotSceneBackground_Command}"
Style="{StaticResource EgtCAM5_InputButton}"/>
+
+
+
+
@@ -130,7 +137,7 @@
-
+
diff --git a/OptionsWindow/OptionWindowVM.vb b/OptionsWindow/OptionWindowVM.vb
index 1b8baed..b3b4151 100644
--- a/OptionsWindow/OptionWindowVM.vb
+++ b/OptionsWindow/OptionWindowVM.vb
@@ -136,18 +136,27 @@ Public Class OptionWindowVM
Public ReadOnly Property BotSceneBackground As Brush
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
- CByte(m_BotSceneBackground.R),
- CByte(m_BotSceneBackground.G),
- CByte(m_BotSceneBackground.B)))
+ CByte(OptionModule.m_BotSceneBackground.R),
+ CByte(OptionModule.m_BotSceneBackground.G),
+ CByte(OptionModule.m_BotSceneBackground.B)))
+ End Get
+ End Property
+
+ Public ReadOnly Property GridColor As Brush
+ Get
+ Return New SolidColorBrush(Color.FromArgb(CByte(255),
+ CByte(OptionModule.m_GridColor.R),
+ CByte(OptionModule.m_GridColor.G),
+ CByte(OptionModule.m_GridColor.B)))
End Get
End Property
Public ReadOnly Property DefMaterialColor As Brush
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
- CByte(m_DefMaterialColor.R),
- CByte(m_DefMaterialColor.G),
- CByte(m_DefMaterialColor.B)))
+ CByte(OptionModule.m_DefMaterialColor.R),
+ CByte(OptionModule.m_DefMaterialColor.G),
+ CByte(OptionModule.m_DefMaterialColor.B)))
End Get
End Property
@@ -155,6 +164,7 @@ Public Class OptionWindowVM
Private m_cmdCloseOptions As ICommand
Private m_cmdTopSceneBackground As ICommand
Private m_cmdBotSceneBackground As ICommand
+ Private m_cmdGridColor As ICommand
Private m_cmdDefMaterialColor As ICommand
#Region "Messages"
@@ -256,6 +266,12 @@ Public Class OptionWindowVM
End Get
End Property
+ Public ReadOnly Property GridColorMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 17)
+ End Get
+ End Property
+
Public ReadOnly Property DefMaterialColorMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 12)
@@ -330,6 +346,42 @@ Public Class OptionWindowVM
#End Region ' BotSceneBackground
+#Region "GridColor"
+
+ '''
+ ''' Returns a command that remove the current selected machining.
+ '''
+ Public ReadOnly Property GridColor_Command() As ICommand
+ Get
+ If m_cmdGridColor Is Nothing Then
+ m_cmdGridColor = New RelayCommand(AddressOf GridColorCmd)
+ End If
+ Return m_cmdGridColor
+ End Get
+ End Property
+
+ '''
+ ''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
+ '''
+ Public Sub GridColorCmd()
+ ' Recupero colore da Ini
+ Dim GridColor As New Color3d(192, 192, 192)
+ GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
+ ' Eseguo modifica con dialogo
+ If SelectColor(GridColor, GridColor) Then
+ OptionModule.m_GridColor = GridColor
+ IniFile.MinLnColor = GridColor
+ IniFile.MajLnColor = GridColor
+ EgtSetGridColor(IniFile.MinLnColor, IniFile.MajLnColor)
+ WritePrivateProfileColor(S_GRID, K_MINLNCOLOR, OptionModule.m_GridColor)
+ WritePrivateProfileColor(S_GRID, K_MAJLNCOLOR, OptionModule.m_GridColor)
+ EgtDraw()
+ NotifyPropertyChanged("GridColor")
+ End If
+ End Sub
+
+#End Region ' GridColor
+
#Region "DefMaterialColor"
'''