diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb index fa4ddbd..1544e08 100644 --- a/MainWindow/MainWindowVM.vb +++ b/MainWindow/MainWindowVM.vb @@ -362,9 +362,8 @@ Public Class MainWindowVM ' imposto dir font Nfe e font default Dim sNfeDir As String = String.Empty GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir) - Dim sDefFont As String = String.Empty - GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont) - EgtSetFont(sNfeDir, sDefFont) + GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", OptionModule.m_sFontText) + EgtSetFont(sNfeDir, OptionModule.m_sFontText) ' imposto dir di default per libreria Lua e lancio libreria di base Dim sLuaLibsDir As String = String.Empty GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir) diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 5df874a..45cc21c 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -29,6 +29,9 @@ Friend Module OptionModule Friend m_nImgWidth As Integer Friend m_nImgHeight As Integer + ' Font di testo + Friend m_sFontText As String + ' Parametri per le quotature Friend m_dExtLineLen As Double Friend m_dArrowLen As Double diff --git a/OptionsWindow/OptionWindowV.xaml b/OptionsWindow/OptionWindowV.xaml index d7ed1c0..eb7c743 100644 --- a/OptionsWindow/OptionWindowV.xaml +++ b/OptionsWindow/OptionWindowV.xaml @@ -62,12 +62,19 @@ + Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/> + Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/> + + + + @@ -125,21 +132,60 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OptionsWindow/OptionWindowVM.vb b/OptionsWindow/OptionWindowVM.vb index 9477fb3..0c21dbb 100644 --- a/OptionsWindow/OptionWindowVM.vb +++ b/OptionsWindow/OptionWindowVM.vb @@ -43,6 +43,27 @@ Public Class OptionWindowVM End Get End Property + Private m_ScaleDXFList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 46)}) + Public ReadOnly Property ScaleDXFList As List(Of String) + Get + Return m_ScaleDXFList + End Get + End Property + + Private m_ScaleSTLList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 46)}) + Public ReadOnly Property ScaleSTLList As List(Of String) + Get + Return m_ScaleSTLList + End Get + End Property + + Private m_ScaleImageList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 46)}) + Public ReadOnly Property ScaleImageList As List(Of String) + Get + Return m_ScaleImageList + End Get + End Property + Public Property SelectedLanguage As Language Get Return OptionModule.m_SelectedLanguage @@ -208,6 +229,19 @@ Public Class OptionWindowVM End Set End Property + Public Property SelectedTextFont As String + Get + Return m_FontList(m_FontList.IndexOf(OptionModule.m_sFontText)) + End Get + Set(value As String) + OptionModule.m_sFontText = value + Dim sNfeDir As String = String.Empty + GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir) + EgtSetFont(sNfeDir, OptionModule.m_sFontText) + WritePrivateProfileString(S_GEOMDB, K_DEFAULTFONT, OptionModule.m_sFontText) + End Set + End Property + Public Property DxfScaleFactor As String Get Return LenToString(OptionModule.m_dDxfScaleFactor, 5) @@ -218,6 +252,7 @@ Public Class OptionWindowVM OptionModule.m_dDxfScaleFactor = dVal WritePrivateProfileString(S_IMPORT, K_DXFSCALE, DoubleToString(OptionModule.m_dDxfScaleFactor, 5)) Map.refProjectVM.GetController().SetScaleForDxfImport(OptionModule.m_dDxfScaleFactor) + NotifyPropertyChanged("DxfScaleFactor") End If End Set End Property @@ -232,6 +267,7 @@ Public Class OptionWindowVM OptionModule.m_dStlScaleFactor = dVal WritePrivateProfileString(S_IMPORT, K_STLSCALE, DoubleToString(OptionModule.m_dStlScaleFactor, 5)) Map.refProjectVM.GetController().SetScaleForStlImport(OptionModule.m_dStlScaleFactor) + NotifyPropertyChanged("StlScaleFactor") End If End Set End Property @@ -246,6 +282,7 @@ Public Class OptionWindowVM OptionModule.m_dImgScaleFactor = dVal WritePrivateProfileString(S_IMPORT, K_IMGSCALE, DoubleToString(OptionModule.m_dImgScaleFactor, 5)) Map.refProjectVM.GetController().SetScaleForImageImport(OptionModule.m_dImgScaleFactor) + NotifyPropertyChanged("ImageScaleFactor") End If End Set End Property @@ -360,7 +397,6 @@ Public Class OptionWindowVM Public Property SelectedFont As String Get Return m_FontList(m_FontList.IndexOf(OptionModule.m_sFont)) - 'Return OptionModule.m_sFont End Get Set(value As String) OptionModule.m_sFont = value @@ -383,6 +419,115 @@ Public Class OptionWindowVM End Set End Property + Private m_DXFScaleEnable As Boolean = False + Public Property DXFScaleEnable As Boolean + Get + Return m_DXFScaleEnable + End Get + Set(value As Boolean) + m_DXFScaleEnable = value + NotifyPropertyChanged("DXFScaleEnable") + End Set + End Property + + Private m_STLScaleEnable As Boolean = False + Public Property STLScaleEnable As Boolean + Get + Return m_STLScaleEnable + End Get + Set(value As Boolean) + m_STLScaleEnable = value + NotifyPropertyChanged("STLScaleEnable") + End Set + End Property + + Private m_ImageScaleEnable As Boolean = False + Public Property ImageScaleEnable As Boolean + Get + Return m_ImageScaleEnable + End Get + Set(value As Boolean) + m_ImageScaleEnable = value + NotifyPropertyChanged("ImageScaleEnable") + End Set + End Property + + Public Property SelectedDXFScale As String + Get + If Math.Abs(OptionModule.m_dDxfScaleFactor - ONEMM) < EPS_SMALL * 10 Then + Return ScaleDXFList(ScaleDXFList.IndexOf("mm")) + ElseIf Math.Abs(OptionModule.m_dDxfScaleFactor - ONEINCH) < EPS_SMALL * 10 Then + Return ScaleDXFList(ScaleDXFList.IndexOf("inch")) + Else + DXFScaleEnable = True + Return ScaleDXFList(ScaleDXFList.IndexOf(EgtMsg(MSG_OPTIONPAGE + 46))) + End If + End Get + Set(value As String) + If value = "mm" Then + DxfScaleFactor = LenToString(ONEMM, 3) + DXFScaleEnable = False + ElseIf value = "inch" Then + DxfScaleFactor = LenToString(ONEINCH, 4) + DXFScaleEnable = False + Else + DXFScaleEnable = True + DxfScaleFactor = LenToString(OptionModule.m_dDxfScaleFactor, 4) + End If + End Set + End Property + + Public Property SelectedSTLScale As String + Get + If Math.Abs(OptionModule.m_dStlScaleFactor - ONEMM) < EPS_SMALL * 10 Then + Return ScaleSTLList(ScaleSTLList.IndexOf("mm")) + ElseIf Math.Abs(OptionModule.m_dStlScaleFactor - ONEINCH) < EPS_SMALL * 10 Then + Return ScaleSTLList(ScaleSTLList.IndexOf("inch")) + Else + STLScaleEnable = True + Return ScaleSTLList(ScaleSTLList.IndexOf(EgtMsg(MSG_OPTIONPAGE + 46))) + End If + End Get + Set(value As String) + If value = "mm" Then + StlScaleFactor = LenToString(ONEMM, 3) + STLScaleEnable = False + ElseIf value = "inch" Then + StlScaleFactor = LenToString(ONEINCH, 4) + STLScaleEnable = False + Else + StlScaleFactor = LenToString(OptionModule.m_dStlScaleFactor, 4) + STLScaleEnable = True + End If + End Set + End Property + + Public Property SelectedImageScale As String + Get + If Math.Abs(OptionModule.m_dImgScaleFactor - ONEMM) < EPS_SMALL * 10 Then + Return ScaleImageList(ScaleImageList.IndexOf("mm")) + ElseIf Math.Abs(OptionModule.m_dImgScaleFactor - ONEINCH) < EPS_SMALL * 10 Then + Return ScaleImageList(ScaleImageList.IndexOf("inch")) + Else + ImageScaleEnable = True + Return ScaleImageList(ScaleImageList.IndexOf(EgtMsg(MSG_OPTIONPAGE + 46))) + ImageScaleEnable = True + End If + End Get + Set(value As String) + If value = "mm" Then + ImageScaleFactor = LenToString(ONEMM, 3) + ImageScaleEnable = False + ElseIf value = "inch" Then + ImageScaleFactor = LenToString(ONEINCH, 4) + ImageScaleEnable = False + Else + ImageScaleFactor = LenToString(OptionModule.m_dImgScaleFactor, 4) + ImageScaleEnable = True + End If + End Set + End Property + ' Definizione comandi Private m_cmdCloseOptions As ICommand Private m_cmdTopSceneBackground As ICommand @@ -483,6 +628,16 @@ Public Class OptionWindowVM Return EgtMsg(MSG_OPTIONPAGE + 23) End Get End Property + Public ReadOnly Property UnitScaleMsg As String + Get + Return EgtMsg(MSG_OPTIONPAGE + 47) ' Unità di scala + End Get + End Property + Public ReadOnly Property FactorScaleMsg As String + Get + Return EgtMsg(MSG_OPTIONPAGE + 48) ' Fattore di scala + End Get + End Property Public ReadOnly Property ImageMsg As String Get Return EgtMsg(MSG_OPTIONPAGE + 24) @@ -597,7 +752,6 @@ Public Class OptionWindowVM End Get End Property - #End Region #Region "COMMANDS"