diff --git a/Application.xaml b/Application.xaml index 791a280..283e15f 100644 --- a/Application.xaml +++ b/Application.xaml @@ -3,6 +3,12 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - + + + + + + + diff --git a/Application.xaml.vb b/Application.xaml.vb index 90921fa..c3e21bd 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -3,6 +3,10 @@ ' Gli eventi a livello di applicazione, ad esempio Startup, Exit e DispatcherUnhandledException, ' possono essere gestiti in questo file. +#Region "FIELDS & PROPERTIES" + +#End Region ' Fields & Properties + #Region "METHODS" Protected Overrides Sub OnStartup(e As StartupEventArgs) diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 67c50d9..619c835 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -14,4 +14,6 @@ Public Const S_COLORS As String = "Colors" + Public Const K_THEMA As String = "Thema" + End Module diff --git a/EgtColorPicker/EgtColorPickerV.xaml b/EgtColorPicker/EgtColorPickerV.xaml index 47b0caf..1a762ce 100644 --- a/EgtColorPicker/EgtColorPickerV.xaml +++ b/EgtColorPicker/EgtColorPickerV.xaml @@ -6,33 +6,31 @@ WindowStartupLocation="CenterOwner" Width="750" Height="450" Style="{StaticResource Dialog_Window}"> - - + + - + - + - + + Style="{StaticResource BasicColors_ListBox}"> @@ -40,12 +38,8 @@ - + @@ -61,17 +55,11 @@ @@ -86,15 +74,14 @@ - + + Style="{StaticResource BasicColorsTheme_ListBox}"> @@ -102,16 +89,12 @@ - + - @@ -122,15 +105,14 @@ + Style="{StaticResource CustomColor_Grid}"> + Style="{StaticResource CustomColor_TxBl}"/> @@ -138,8 +120,7 @@ + Style="{StaticResource BasicColors_ListBox}"> @@ -147,16 +128,12 @@ - + - @@ -164,25 +141,20 @@ + Style="{StaticResource CurrColor_Grid}"> - + - - + + - - + Style="{StaticResource SelPath_TxBl}"/> + Style="{StaticResource ViewMode_CmBx}"/> + Style="{StaticResource TopPanel_Grid}"> + Style="{StaticResource FileTree_TV}"> - + + Style="{StaticResource IconSource_Img}"/> + Style="{StaticResource DialogWindow_TxBl}"/> - + + Style="{StaticResource IconSource_Img}"/> + Style="{StaticResource DialogWindow_TxBl}"/> @@ -85,45 +70,39 @@ + SelectedIndex="{Binding nSelTab}" + Style="{StaticResource TreeView_TC}"> - + SelectedItem="{Binding ItemSelected, Mode=TwoWay}" + Margin="5,5,5,5" + BorderBrush="{StaticResource EgalwareWhite}" + IsSynchronizedWithCurrentItem="True"> - + + Style="{StaticResource IconSource_Img}"/> + Style="{StaticResource DialogWindow_TxBl}"/> - + @@ -132,26 +111,19 @@ Style="{StaticResource Button_Image}"/> - - - + Style="{StaticResource TemplateView_UniformGrid}"> + + + - + @@ -166,32 +138,23 @@ Style="{StaticResource Button_Image}"/> - - + Style="{StaticResource TemplateView_UniformGrid}"> + + - - + Style="{StaticResource TemplateView_UniformGrid}"> + + + Style="{StaticResource TemplateView_Border}"/> @@ -268,10 +231,7 @@ - @@ -280,7 +240,7 @@ + Style="{StaticResource DataGrid_TxBl}"/> @@ -291,66 +251,43 @@ + Style="{StaticResource Name_Image}"/> + Style="{StaticResource Name_TxBl}"/> + Width="2*" + ElementStyle="{StaticResource DataGridTextColumn_TxBl}"> + Style="{StaticResource DataGrid_TxBl}"/> - - - + Width="1*" + ElementStyle="{StaticResource DataGridTextColumn_TxBl}"> + Style="{StaticResource DataGrid_TxBl}"/> - - - + Width="1*" + ElementStyle="{StaticResource DataGridTextRColumn_TxBl}"> + Style="{StaticResource DataGrid_TxBl}"/> - - - @@ -361,47 +298,33 @@ + Style="{StaticResource TopPanel_Grid}"> - + + Style="{StaticResource ParameterList_TxBx}"/> + Style="{StaticResource Button_UniformGrid}"> - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/SceneButton/SceneButtonVM.vb b/SceneButton/SceneButtonVM.vb index 39a3a9b..8a975f5 100644 --- a/SceneButton/SceneButtonVM.vb +++ b/SceneButton/SceneButtonVM.vb @@ -3,7 +3,9 @@ Imports EgtUILib Imports EgtWPFLib5 Public Class SceneButtonVM + #Region "FIELDS & PROPERTIES" + Private m_TopListBtn As New List(Of SceneBtn) Public Property TopListBtn As List(Of SceneBtn) Get @@ -54,7 +56,15 @@ Public Class SceneButtonVM End Set End Property + Private m_TopPanelVM As TopPanelVM + Friend ReadOnly Property TopPanelVM As TopPanelVM + Get + Return m_TopPanelVM + End Get + End Property + #End Region ' Fields & Properties + #Region "CONSTRUCTOR" Sub New() SetButtonsLocation("TopListBtn", m_TopListBtn) @@ -64,6 +74,7 @@ Public Class SceneButtonVM SetButtonsLocation("BottomCenterListBtn", m_BottomCenterListBtn) End Sub #End Region ' Constructor + #Region "METHODS" Private Sub SetButtonsLocation(PositionList As String, ListBtn As List(Of SceneBtn)) Dim Index As Integer = 1 @@ -122,10 +133,12 @@ Public Class SceneButtonVM Return Btn End Function #End Region ' Methods + End Class Public Class SceneBtn Implements INotifyPropertyChanged + #Region "Fields & Properties" Private m_ResourcesDir As String = "C:\EgtData\EgtSTONE3D\Resources\" @@ -185,6 +198,7 @@ Public Class SceneBtn End Get End Property #End Region ' Fields & Properties + #Region "Methods" Private Sub MethodBtn() SceneCmd.Exec(m_Flag) @@ -211,6 +225,7 @@ End Class Public Class _ToggleButton Inherits SceneBtn + #Region "Fields & Properties" Private m_IsChecked As Boolean = False Public Property IsChecked As Boolean @@ -223,6 +238,7 @@ Public Class _ToggleButton End Set End Property #End Region 'Fields & Properties + #Region "Construcor" Sub New(_Name As String, _Img As String, _Flag As String) diff --git a/SceneHost/SceneHostV.xaml.vb b/SceneHost/SceneHostV.xaml.vb index e31e665..45f4b2c 100644 --- a/SceneHost/SceneHostV.xaml.vb +++ b/SceneHost/SceneHostV.xaml.vb @@ -8,8 +8,6 @@ Public Class SceneHostV Private m_MySceneHostVM As MySceneHostVM - Private m_SelType As Integer = GDB_TY.CRV_LINE - ' variabili per la selezione in over Public m_SelType As Integer = GDB_TY.CRV_LINE Private m_nIdMouseOverSel As Integer = 0 diff --git a/SecondaryWindow/SecondaryWindowV.xaml b/SecondaryWindow/SecondaryWindowV.xaml index 07874a1..39cb03c 100644 --- a/SecondaryWindow/SecondaryWindowV.xaml +++ b/SecondaryWindow/SecondaryWindowV.xaml @@ -17,7 +17,7 @@ - + diff --git a/ThemesDataService/ThemesDataServiceM.vb b/ThemesDataService/ThemesDataServiceM.vb new file mode 100644 index 0000000..77a239d --- /dev/null +++ b/ThemesDataService/ThemesDataServiceM.vb @@ -0,0 +1,6 @@ +Public Class ThemesDataServiceM + + Public Property Name As String + Public Property Path As String + +End Class diff --git a/ThemesDataService/ThemesDataServiceVM.vb b/ThemesDataService/ThemesDataServiceVM.vb new file mode 100644 index 0000000..5153960 --- /dev/null +++ b/ThemesDataService/ThemesDataServiceVM.vb @@ -0,0 +1,100 @@ +Imports System.Collections.ObjectModel +Imports System.IO +Imports System.Resources +Imports EgtUILib + +Public Class ThemesDataServiceVM + +#Region "FIELDS & PROPERTIES" + + Private ReadOnly m_Themes As New ObservableCollection(Of ThemesDataServiceM)() + +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + + Sub New() + ScanResources() + ScanDisk("Utility") + End Sub + +#End Region ' Constructor + +#Region "METHODS" + + ''' + ''' Restiusce il nome derivato dalla cartella + ''' + ''' + ''' + ''' + ''' + Private Function GetNameFromPath(ByVal path As String, ByVal Optional pathChar As Char = "/"c, ByVal Optional fileEnding As String = "Theme.xaml") As String + Dim name As String = path.Substring(path.LastIndexOf(pathChar) + 1) + name = name.Substring(0, name.Length - fileEnding.Length) + name = Char.ToUpper(name(0)) & If(name.Length > 1, name.Substring(1), "") + Return name + End Function + + ''' + ''' Ricerca i file dizionario contente il tema + ''' + ''' + Private Sub ScanResources(ByVal Optional fileEnding As String = "Dictionary.xaml") + Dim assembly = System.Reflection.Assembly.GetExecutingAssembly() + Dim resourceNames = assembly.GetManifestResourceNames() + + For Each resourceName In resourceNames + Dim [set] As New ResourceSet(assembly.GetManifestResourceStream(resourceName)) + + For Each item As DictionaryEntry In [set] + Dim fileName As String = item.Key.ToString() + + If fileName.ToLower().EndsWith(fileEnding.ToLower()) Then + m_Themes.Add(New ThemesDataServiceM() With { + .Name = GetNameFromPath(fileName), + .Path = "pack://application:,,,/WpfTheme;component/" & fileName + }) + End If + Next + Next + End Sub + + ''' + ''' Ricerca i temi presenti nel programma + ''' + ''' + Private Sub ScanDisk(ByVal relativePath As String) + If Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & relativePath) Then + Dim themeFiles = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory & relativePath, "*Dictionary.xaml", SearchOption.AllDirectories) + + For Each fileName In themeFiles + m_Themes.Add(New ThemesDataServiceM() With { + .Name = GetNameFromPath(fileName, "\"c), + .Path = fileName + }) + Next + End If + End Sub + + ''' + ''' Funzione che permette di selezionare e applicare il tema + ''' + ''' + Public Sub SetTheme(ByVal theme As ThemesDataServiceM) + If theme Is Nothing Then + EgtOutLog("Error setting theme: Attempting to set theme to null.") + Return + End If + + Try + Application.Current.Resources.MergedDictionaries(1).Source = New Uri(theme.Path, UriKind.RelativeOrAbsolute) + Catch ex As Exception + EgtUILib.EgtOutLog("Error setting theme: " & ex.Message) + End Try + End Sub + +#End Region ' Methods + + +End Class diff --git a/TopPanel/TopPanelV.xaml b/TopPanel/TopPanelV.xaml new file mode 100644 index 0000000..ade8c79 --- /dev/null +++ b/TopPanel/TopPanelV.xaml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TopPanel/TopPanelV.xaml.vb b/TopPanel/TopPanelV.xaml.vb new file mode 100644 index 0000000..566a343 --- /dev/null +++ b/TopPanel/TopPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class TopPanelV + +End Class diff --git a/TopPanel/TopPanelVM.vb b/TopPanel/TopPanelVM.vb new file mode 100644 index 0000000..97f789d --- /dev/null +++ b/TopPanel/TopPanelVM.vb @@ -0,0 +1,188 @@ +Imports EgtWPFLib5 +Imports EgtUILib + +Public Class TopPanelVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Friend Enum TopOption As Integer + OPTIONS = 0 + PARAMETRICO = 1 + End Enum + + Private m_SelTopOption As TopOption = TopOption.OPTIONS + Public Property SelTopOption As Integer + Get + Return m_SelTopOption + End Get + Set(value As Integer) + m_SelTopOption = value + End Set + End Property + Friend Sub SetSelTopOption(TopOtion As TopOption) + m_SelTopOption = TopOtion + NotifyPropertyChanged(NameOf(SelTopOption)) + End Sub + +#Region "Messages" + + Public ReadOnly Property HomeTab_Msg + Get + Return EgtMsg(110010).ToUpper() + End Get + End Property + + Public ReadOnly Property Parametrico_Msg + Get + Return EgtMsg(110010).ToUpper() + End Get + End Property + + Public ReadOnly Property NewFile_Msg + Get + Return EgtMsg(110012) + End Get + End Property + + Public ReadOnly Property Save_Msg + Get + Return EgtMsg(110013) + End Get + End Property + + Public ReadOnly Property SaveAs_Msg + Get + Return EgtMsg(110014) + End Get + End Property + + Public ReadOnly Property Open_Msg + Get + Return EgtMsg(110015) + End Get + End Property + + Public ReadOnly Property Options_Msg + Get + Return EgtMsg(110016) + End Get + End Property + +#End Region ' Messages + + ' Definizione Comandi + Private m_NewFileCmd As ICommand + Private m_SaveFileCmd As ICommand + Private m_OpenFileCmd As ICommand + Private m_cmdOptions As ICommand + +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + + Sub New() + Map.SetRefTopPanelVM(Me) + End Sub + +#End Region ' Constructor + +#Region "COMMANDS" + +#Region "NewFileCmd" + + Public ReadOnly Property NewFileCmd As ICommand + Get + If IsNothing(m_NewFileCmd) Then + m_NewFileCmd = New Command(AddressOf NewFile) + End If + Return m_NewFileCmd + End Get + End Property + + Private Sub NewFile() + + End Sub + +#End Region ' NewFileCmd + +#Region "OpenFileCmd" + + Public ReadOnly Property OpenFileCmd As ICommand + Get + If IsNothing(m_OpenFileCmd) Then + m_OpenFileCmd = New Command(AddressOf OpenFile) + End If + Return m_OpenFileCmd + End Get + End Property + + Private Sub OpenFile() + + Dim OpenFileDialog As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With { + .Title = "Open", + .Filter = "nge files (*.nge)|*.nge" & + "|vme files (*.vme)|*.vme", + .FilterIndex = 2, + .InitialDirectory = "C:\EgtData\EgtStone3D\Temp", + .Mode = 1 + } + + If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return + If String.IsNullOrEmpty(OpenFileDialog.FileName) Then Return + + Dim sFilePath As String = OpenFileDialog.FileName + EgtOpenFile(sFilePath) + SolidManagerM.CreatePartSolid() + EgtDraw() + End Sub + +#End Region ' OpenFileCmd + +#Region "SaveFileCmd" + + Public ReadOnly Property SaveFileCmd As ICommand + Get + If IsNothing(m_SaveFileCmd) Then + m_SaveFileCmd = New Command(AddressOf SaveFile) + End If + Return m_SaveFileCmd + End Get + End Property + + Private Sub SaveFile() + + End Sub + +#End Region ' SaveFileCmd + +#Region "OptionsCmd" + + ''' + ''' Returns a command that do Export. + ''' + Public ReadOnly Property OptionsCommand As ICommand + Get + If m_cmdOptions Is Nothing Then + m_cmdOptions = New Command(AddressOf Options) + End If + Return m_cmdOptions + End Get + End Property + + ''' + ''' Execute the Export. This method is invoked by the ExportCommand. + ''' + Public Sub Options(ByVal param As Object) + Dim OptionsWindow As New OptionWindowV With { + .DataContext = New OptionWindowVM, + .Owner = Application.Current.MainWindow + } + OptionsWindow.ShowDialog() + End Sub + +#End Region ' OptionsCmd + +#End Region ' Commands + +End Class diff --git a/Utility/EgtStone3DDarkDictionary.xaml b/Utility/EgtStone3DDarkDictionary.xaml new file mode 100644 index 0000000..db9008e --- /dev/null +++ b/Utility/EgtStone3DDarkDictionary.xaml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utility/EgtStone3DDefaultStyle.xaml b/Utility/EgtStone3DDefaultStyle.xaml new file mode 100644 index 0000000..e84616d --- /dev/null +++ b/Utility/EgtStone3DDefaultStyle.xaml @@ -0,0 +1,1589 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Transparent + #4D84C4 + #7096CE + #90ABD9 + #B2C3E4 + #FFFFFF + #585858 + #D3D3D3 + #F2F2F2 + #00FF00 + + #DDDDDD + #707070 + #AFCFE9 + #3C7FB1 + #B5B4B2 + #2C628B + #F4F4F4 + #ADB2B5 + #838383 + #F5DEB3 + #000000 + #EDC637 + #F0F0F0 + #E5E5E5 + #ACACAC + #ECF4FC + #DCECFC + #7EB4EA + + + + + + 30 + + + + + + 2 + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utility/EgtStone3DDictionary.xaml b/Utility/EgtStone3DDictionary.xaml index e098dda..e57c622 100644 --- a/Utility/EgtStone3DDictionary.xaml +++ b/Utility/EgtStone3DDictionary.xaml @@ -6,1263 +6,96 @@ xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"> - - - - - - - - - - - 30 - - - - - - 2 - - - - - - 2 - - + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Utility/Map.vb b/Utility/Map.vb index d775d35..7a5d11a 100644 --- a/Utility/Map.vb +++ b/Utility/Map.vb @@ -10,6 +10,7 @@ Module Map Private m_refSceneHostV As SceneHostV Private m_refSceneButtonV As SceneButtonV Private m_refSceneButtonVM As SceneButtonVM + Private m_refTopPanelVM As TopPanelVM #End Region ' Fields & Properties @@ -50,6 +51,12 @@ Module Map End Get End Property + Public ReadOnly Property refTopPanelVM As TopPanelVM + Get + Return m_refTopPanelVM + End Get + End Property + #End Region ' Get #Region "Set" @@ -73,6 +80,7 @@ Module Map m_refSceneButtonV = SceneButtonV Return Not IsNothing(m_refSceneButtonV) End Function + Friend Function SetRefSceneButtonVM(SceneButtonVM As SceneButtonVM) As Boolean m_refSceneButtonVM = SceneButtonVM Return Not IsNothing(m_refSceneButtonVM) @@ -83,6 +91,11 @@ Module Map Return Not IsNothing(LibMap.refSceneHostVM) End Function + Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean + m_refTopPanelVM = TopPanelVM + Return Not IsNothing(m_refTopPanelVM) + End Function + #End Region ' Set #Region "Init"