From bfd3f21e25b3f207f3fdb1ae0bbc176b88a5d826 Mon Sep 17 00:00:00 2001 From: Renzo Lanza Date: Thu, 1 Aug 2019 08:44:35 +0000 Subject: [PATCH] =?UTF-8?q?OmagCUT=202.1h1=20:=20-=20Aggiunti=20Dizionari?= =?UTF-8?q?=20per=20i=20temi=20e=20ComboBox=20in=20OptionsPageUC=20per=20i?= =?UTF-8?q?l=20cambio=20dei=20temi.=20Questa=20versione=20di=20OmagCUT=20f?= =?UTF-8?q?unziona=20esattamente=20come=20la=20precedente,=20come=20se=20n?= =?UTF-8?q?on=20ci=20fossero=20i=20temi,=20perch=C3=A9=20la=20scelta=20dei?= =?UTF-8?q?=20temi=20=C3=A8=20nascosta=20(ThemesGpBx.Visibility=20=3D=20Wi?= =?UTF-8?q?ndows.Visibility.Collapsed=20in=20OptionsPageUC.xaml.vb)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application.xaml | 18 +- Application.xaml.vb | 20 +- My Project/AssemblyInfo.vb | 4 +- OmagCUT.vbproj | 15 + OmagCUTAlternativeDictionary.xaml | 2524 ++++++++++++++++++++++++++ OmagCUTAlternativeDictionary.xaml.vb | 310 ++++ OmagCUTClassicDictionary.xaml | 22 + OmagCUTDictionary.xaml | 2 +- OmagCUTTestDictionary.xaml | 54 + OptionsPageUC.xaml | 41 +- OptionsPageUC.xaml.vb | 215 ++- 11 files changed, 3112 insertions(+), 113 deletions(-) create mode 100644 OmagCUTAlternativeDictionary.xaml create mode 100644 OmagCUTAlternativeDictionary.xaml.vb create mode 100644 OmagCUTClassicDictionary.xaml create mode 100644 OmagCUTTestDictionary.xaml diff --git a/Application.xaml b/Application.xaml index 20d2da6..a7df288 100644 --- a/Application.xaml +++ b/Application.xaml @@ -3,8 +3,20 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose" > - - - + + + + + + + + + + + + + + + diff --git a/Application.xaml.vb b/Application.xaml.vb index d019694..a1f5e8e 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -2,8 +2,8 @@ Class Application - ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException - ' can be handled in this file. + ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException + ' can be handled in this file. 'Protected Overrides Sub OnStartup(e As StartupEventArgs) ' MyBase.OnStartup(e) @@ -44,4 +44,20 @@ Class Application ' thisDpiHeightFactor = m.M22 'End Sub + Public Property ThemeDictionary As ResourceDictionary + ' You could probably get it via its name with some query logic as well. + Get + Return Resources.MergedDictionaries(0) + End Get + Set(value As ResourceDictionary) + End Set + End Property + + Public Sub ChangeTheme(uri As Uri) + ThemeDictionary.MergedDictionaries.Clear() + Dim rd As ResourceDictionary = New ResourceDictionary() + rd.Source = uri + ThemeDictionary.MergedDictionaries.Add(rd) ' New ResourceDictionary()) ' Source:=uri)) + End Sub + End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 2dd5e12..26513ec 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj index c7292af..b3bf9c9 100644 --- a/OmagCUT.vbproj +++ b/OmagCUT.vbproj @@ -226,6 +226,9 @@ FrameMachiningUC.xaml + + OmagCUTAlternativeDictionary.xaml + UnderDrillUC.xaml @@ -420,6 +423,18 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/OmagCUTAlternativeDictionary.xaml b/OmagCUTAlternativeDictionary.xaml new file mode 100644 index 0000000..4a91d7b --- /dev/null +++ b/OmagCUTAlternativeDictionary.xaml @@ -0,0 +1,2524 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 9.5 + 9.5 + 3.3 + 9.5 + 12.5 + 40 + 18.6 + 20 + 33.3 + 24 + 18.6 + 13.3 + 22 + 40 + 40 + 65 + 65 + 75 + 16 + 1 + 3,0,9,0 + 2,0,11,0 + 2,0,10,0 + 5,0,8,0 + 4,0,8,0 + 6,0,8,0 + 4,0,15,0 + 4,0,8,0 + 2,0,10,0 + 9.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 250 + 75 + 1.3* + 3* + + + + 11* + 1* + 0 + 1* + 8* + 1* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + M -5,-10.5 L 5,-10.5 L 5,10.5 L -5,10.5 Z + M 4.5,-8.5 L -4.5,-8.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z + M 4.5,-7.5 A 1 1 0 0 0 3.5,-8.5 L -3.5,-8.5 A 1 1 0 0 0 -4.5,-7.5 L -4.5,4.5 L -0.5,8.5 L 0.5,8.5 L 4.5,4.5 Z + + + + + + M 3.5,-7.5 L -3.5,-7.5 L -3.5,4.5 L 0,8 L 3.5,4.5 Z + + + + + + + + + + + + + + + + + + + + + + + + + + M -5,-9.5 A 1 1 0 0 1 -4,-10.5 L 4,-10.5 A 1 1 0 0 1 5,-9.5 L 5,9.5 A 1 1 0 0 1 4,10.5 L -4,10.5 A 1 1 0 0 1 -5,9.5 Z + M -4,-9.5 L 4,-9.5 L 4,9.5 L -4,9.5 Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OmagCUTAlternativeDictionary.xaml.vb b/OmagCUTAlternativeDictionary.xaml.vb new file mode 100644 index 0000000..3003308 --- /dev/null +++ b/OmagCUTAlternativeDictionary.xaml.vb @@ -0,0 +1,310 @@ +Imports System.Collections.ObjectModel +Imports System.ComponentModel + +Partial Class OmagCUTAlternativeDictionary + Inherits ResourceDictionary + + Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) + + ' Evento della TextBox con Style che permette di aprire in automatico la calcolatrice + 'Friend Sub NumericKeyboard_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + ' ' Recupero dati da sorgente + ' Dim sTitle As String = String.Empty + ' Dim sText As String = String.Empty + ' Dim TxBx As TextBox = CType(e.Source, TextBox) + ' If Not IsNothing(TxBx) Then + ' sText = TxBx.Text + ' Dim AssocLabel As Label = TxBx.Tag + ' If Not IsNothing(AssocLabel) Then + ' sTitle = AssocLabel.Content + ' End If + ' End If + ' ' Creo calcolatrice + ' Dim NumericKeyboardWD As New NumericKeyboardWD(sTitle, sText, e.Source) + ' ' La visualizzo + ' NumericKeyboardWD.ShowDialog() + 'End Sub + + ' Evento della TextBox con Style che permette di aggiornare in automatico il componente con il nuovo valore + 'Private Sub NumericKeyboard_TextChanged(sender As Object, e As TextChangedEventArgs) + ' Select Case m_MainWindow.m_ActivePage + ' Case MainWindow.Pages.Draw + ' If Not m_MainWindow.m_DrawPageUC.m_bShowVar Then + ' m_MainWindow.m_DrawPageUC.UpdateView() + ' End If + ' Case MainWindow.Pages.RawPart + ' If Not m_MainWindow.m_RawPartPage.m_bShowVar Then + ' m_MainWindow.m_RawPartPage.UpdateRawPart() + ' End If + ' End Select + 'End Sub + +End Class + +Namespace TreeViewItem + + Public Class AlternativeCathegoryItem + Inherits AlternativeTreeViewItemBase + + 'Private m_sTitle As String + Private m_sPictureString As String + Private m_nFType As Integer + Private m_Items As ObservableCollection(Of CustomItem) + + 'Public Property Name As String + ' Get + ' Return m_sTitle + ' End Get + ' Set(value As String) + ' m_sTitle = value + ' End Set + 'End Property + + Public ReadOnly Property PictureString As String + Get + Return "/Resources/ToolsTreeViewImages/Folder.png" + End Get + End Property + + Public ReadOnly Property nFType As Integer + Get + Return m_nFType + End Get + End Property + + Public Property Items As ObservableCollection(Of CustomItem) + Get + Return m_Items + End Get + Set(value As ObservableCollection(Of CustomItem)) + m_Items = value + End Set + End Property + + Sub New(sName As String, nType As Integer) + Name = sName + m_nFType = nType + Me.Items = New ObservableCollection(Of CustomItem) + End Sub + + End Class + + Public Class ALternativeCustomItem + Inherits AlternativeTreeViewItemBase + + 'Private m_sTitle As String + Private m_nType As Integer + + 'Public Property Name As String + ' Get + ' Return m_sTitle + ' End Get + ' Set(value As String) + ' m_sTitle = value + ' End Set + 'End Property + + Public ReadOnly Property nType As Integer + Get + Return m_nType + End Get + End Property + + Sub New(Title As String, nType As Integer) + Me.Name = Title + m_nType = nType + End Sub + + End Class + + Public Class AlternativePartCathegoryItem + Inherits AlternativeTreeViewItemBase + + Private m_nFType As Integer + Private m_Items As ObservableCollection(Of PartCustomItem) + + Public ReadOnly Property PictureString As String + Get + Return "/Resources/ToolsTreeViewImages/Folder.png" + End Get + End Property + + Public ReadOnly Property nFType As Integer + Get + Return m_nFType + End Get + End Property + + Public Property Items As ObservableCollection(Of PartCustomItem) + Get + Return m_Items + End Get + Set(value As ObservableCollection(Of PartCustomItem)) + m_Items = value + End Set + End Property + + Sub New(sName As String, nType As Integer) + Name = sName + m_nFType = nType + Me.Items = New ObservableCollection(Of PartCustomItem) + End Sub + + End Class + + Public Class AlternativePartCustomItem + Inherits AlternativeTreeViewItemBase + + Private m_nType As Integer + Private m_bIsActive As Boolean + Private m_sText1 As String + Private m_sText2 As String + + Public Property sText1 As String + Get + Return m_sText1 + End Get + Set(value As String) + m_sText1 = value + NotifyPropertyChanged("sText1") + End Set + End Property + + Public Property sText2 As String + Get + Return m_sText2 + End Get + Set(value As String) + m_sText2 = value + NotifyPropertyChanged("sText2") + End Set + End Property + + Public ReadOnly Property nType As Integer + Get + Return m_nType + End Get + End Property + + Public Property bIsActive As Boolean + Get + Return m_bIsActive + End Get + Set(value As Boolean) + If value <> m_bIsActive Then + m_bIsActive = value + NotifyPropertyChanged("bIsActive") + End If + End Set + End Property + + Sub New(Title As String, nType As Integer, sText1 As String, sText2 As String) + Me.Name = Title + m_nType = nType + m_sText1 = sText1 + m_sText2 = sText2 + m_bIsActive = True + End Sub + + Sub New(Title As String, nType As Integer, sText1 As String, sText2 As String, bIsActive As Boolean) + Me.Name = Title + m_nType = nType + m_sText1 = sText1 + m_sText2 = sText2 + m_bIsActive = bIsActive + End Sub + + End Class + + Public Class AlternativeTreeViewItemBase + Implements INotifyPropertyChanged + + Private m_Name As String + Public Property Name As String + Get + Return m_Name + End Get + Set(value As String) + If (value <> m_Name) Then + m_Name = value + NotifyPropertyChanged("Name") + End If + End Set + End Property + + Private m_isSelected As Boolean + Public Property IsSelected As Boolean + Get + Return m_isSelected + End Get + Set(value As Boolean) + If (value <> m_isSelected) Then + m_isSelected = value + NotifyPropertyChanged("IsSelected") + End If + End Set + End Property + + Private m_isExpanded As Boolean + Public Property IsExpanded As Boolean + Get + Return m_isExpanded + End Get + Set(value As Boolean) + If (value <> m_isExpanded) Then + m_isExpanded = value + NotifyPropertyChanged("IsExpanded") + End If + End Set + End Property + + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged + + + Public Sub NotifyPropertyChanged(propName As String) + RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) + End Sub + + End Class + +End Namespace + + +Namespace ArithmeticConverterNameSpace + + Public Class AlternativeCheckboxConverter + Implements IMultiValueConverter + + Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert + If values.Length <> 2 Then + Throw New ArgumentException("There should be three values.") + End If + + If String.IsNullOrEmpty(values(0).ToString) Then + values(0) = "0" + End If + + If String.IsNullOrEmpty(values(1).ToString()) Then + values(2) = "0" + End If + + Dim x As Double + If Not Double.TryParse(values(0).ToString(), x) Then + Throw New ArgumentException("values[0] must parse to double") + End If + + Dim y As Double + If Not Double.TryParse(values(1).ToString(), y) Then + Throw New ArgumentException("values[0] must parse to double") + End If + + Return (x / y) - 1 + + End Function + + Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack + Throw New NotImplementedException() + End Function + End Class + +End Namespace diff --git a/OmagCUTClassicDictionary.xaml b/OmagCUTClassicDictionary.xaml new file mode 100644 index 0000000..a1c0b92 --- /dev/null +++ b/OmagCUTClassicDictionary.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/OmagCUTDictionary.xaml b/OmagCUTDictionary.xaml index 0b3e661..2437d81 100644 --- a/OmagCUTDictionary.xaml +++ b/OmagCUTDictionary.xaml @@ -563,7 +563,7 @@ - + + + diff --git a/OptionsPageUC.xaml b/OptionsPageUC.xaml index 60c24f4..c2775de 100644 --- a/OptionsPageUC.xaml +++ b/OptionsPageUC.xaml @@ -353,6 +353,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -362,13 +391,13 @@ - - - - - + + + + + -