diff --git a/AboutBoxWD.xaml b/AboutBoxWD.xaml
new file mode 100644
index 0000000..535472e
--- /dev/null
+++ b/AboutBoxWD.xaml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AboutBoxWD.xaml.vb b/AboutBoxWD.xaml.vb
new file mode 100644
index 0000000..934049f
--- /dev/null
+++ b/AboutBoxWD.xaml.vb
@@ -0,0 +1,44 @@
+Imports EgtUILib
+
+Public Class AboutBoxWD
+
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As MainWindow = Application.Current.MainWindow
+
+ Sub New(Owner As Window)
+
+ ' This call is required by the designer.
+ InitializeComponent()
+
+ ' Add any initialization after the InitializeComponent() call.
+ Me.Owner = Owner
+ Me.Top = Owner.Top + (Owner.Height / 2 - Me.Height / 2)
+ Me.Left = Owner.Left + (Owner.Width / 2 - Me.Width / 2)
+ Me.ShowDialog()
+
+ End Sub
+
+ Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+ DescriptionLbl.Text = My.Application.Info.Description.ToString()
+ VersionLbl.Text = "Version : " & My.Application.Info.Version.ToString()
+ Dim sKey As String = String.Empty
+ EgtGetKeyInfo(sKey)
+ Dim sOpts As String = m_MainWindow.GetKeyOptions().ToString()
+ KeyLbl.Text = sKey & " - " & sOpts
+ CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
+ Dim sMachine As String = String.Empty
+ If EgtGetCurrMachineName(sMachine) Then
+ MachineLbl.Text = "Machine : " & sMachine
+ Else
+ MachineLbl.Text = "Machine : ---"
+ End If
+ Dim sFile As String = String.Empty
+ If EgtGetCurrFilePath(sFile) Then
+ ProjectLbl.Text = "Project : " & sFile
+ Else
+ ProjectLbl.Text = "Project : ---"
+ End If
+ ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
+ End Sub
+
+End Class
diff --git a/Application.xaml b/Application.xaml
new file mode 100644
index 0000000..8f517fd
--- /dev/null
+++ b/Application.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/Application.xaml.vb b/Application.xaml.vb
new file mode 100644
index 0000000..29f7902
--- /dev/null
+++ b/Application.xaml.vb
@@ -0,0 +1,6 @@
+Class Application
+
+ ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
+ ' can be handled in this file.
+
+End Class
diff --git a/ConstGen.vb b/ConstGen.vb
new file mode 100644
index 0000000..29bd239
--- /dev/null
+++ b/ConstGen.vb
@@ -0,0 +1,42 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2015
+'----------------------------------------------------------------------------
+' File : ConstGen.vb Data : 12.02.15 Versione : 1.6b3
+' Contenuto : Modulo costanti generali.
+'
+'
+'
+' Modifiche : 12.02.15 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+Imports EgtUILib
+
+Module ConstGen
+
+ ' File con direttorio radice dei dati
+ Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
+ Public Const S_DATA As String = "Data"
+ Public Const K_DATAROOT As String = "DataRoot"
+
+ ' File con dati di licenza
+ Public Const LIC_FILE_NAME As String = "OmagVIEW.lic"
+ Public Const S_LICENCE As String = "Licence"
+ Public Const K_KEY As String = "Key"
+
+ ' File di log generale
+ Public Const GENLOG_FILE_NAME As String = "OmagVIEWLog.txt"
+
+ ' Sottodirettorio di configurazione
+ Public Const CONF_DIR As String = "Config"
+ ' Sottodirettorio temporaneo
+ Public Const TEMP_DIR As String = "Temp"
+ ' Sottodirettorio di default per le macchine
+ Public Const MACHINES_DFL_DIR As String = "Machines"
+
+ ' Costanti per lavorazioni
+ Public Const MACH_GROUP As String = "Mach01"
+ Public Const MAIN_TAB As String = "MainTab"
+ Public Const SECOND_TAB As String = "2ndTab"
+
+End Module
diff --git a/ConstIni.vb b/ConstIni.vb
new file mode 100644
index 0000000..639e43c
--- /dev/null
+++ b/ConstIni.vb
@@ -0,0 +1,71 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2015
+'----------------------------------------------------------------------------
+' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
+' Contenuto : Modulo costanti sezione e chiavi per file Ini.
+'
+'
+'
+' Modifiche : 12.02.15 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+
+Module ConstIni
+
+ Public Const INI_FILE_NAME As String = "OmagVIEW.ini"
+
+ Public Const S_GENERAL As String = "General"
+ Public Const K_DEBUG As String = "Debug"
+ Public Const K_LICENCE As String = "Licence"
+ Public Const K_MESSAGESDIR As String = "MessagesDir"
+ Public Const K_MESSAGES As String = "Messages"
+ Public Const K_WINPLACE As String = "WinPlace"
+ Public Const K_MMUNITS As String = "MmUnits"
+
+ Public Const S_LANGUAGES As String = "Languages"
+ Public Const K_LANGUAGE As String = "Language"
+
+ Public Const S_LUA As String = "Lua"
+ Public Const K_LIBSDIR As String = "LibsDir"
+ Public Const K_BASELIB As String = "BaseLib"
+
+ Public Const S_GEOMDB As String = "GeomDB"
+ Public Const K_DEFAULTFONT As String = "DefaultFont"
+ Public Const K_NFEFONTDIR As String = "NfeFontDir"
+ Public Const K_DEFAULTCOLOR As String = "DefaultColor"
+
+ Public Const S_OPENGL As String = "OpenGL"
+ Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
+ Public Const K_COLORBITS As String = "ColorBits"
+ Public Const K_DEPTHBITS As String = "DepthBits"
+ Public Const K_DRIVER As String = "Driver"
+
+ Public Const S_SCENE As String = "Scene"
+ Public Const K_BACKTOP As String = "BackTop"
+ Public Const K_BACKBOTTOM As String = "BackBottom"
+ Public Const K_SHOWGFRAME As String = "ShowGFrame"
+ Public Const K_MARK As String = "Mark"
+ Public Const K_SELSURF As String = "SelSurf"
+ Public Const K_SHOWMODE As String = "ShowMode"
+ Public Const K_CURVEDIR As String = "CurveDir"
+ Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
+ Public Const K_ZOOMWIN As String = "ZoomWin"
+ Public Const K_DISTLINE As String = "DistLine"
+
+ Public Const S_GRID As String = "Grid"
+ Public Const K_SHOWGRID As String = "ShowGrid"
+ Public Const K_SHOWFRAME As String = "ShowFrame"
+ Public Const K_SNAPSTEP As String = "SnapStep"
+ Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
+ Public Const K_MINLINESSTEP As String = "MinLineSStep"
+ Public Const K_MAJLINESSTEP As String = "MajLineSStep"
+ Public Const K_EXTSSTEP As String = "ExtSStep"
+ Public Const K_MINLNCOLOR As String = "MinLnColor"
+ Public Const K_MAJLNCOLOR As String = "MajLnColor"
+
+ Public Const S_MACH As String = "Mach"
+ Public Const K_MACHINESDIR As String = "MachinesDir"
+ Public Const K_CURRMACH As String = "CurrMach"
+
+End Module
diff --git a/ConstMsg.vb b/ConstMsg.vb
new file mode 100644
index 0000000..52f6ce5
--- /dev/null
+++ b/ConstMsg.vb
@@ -0,0 +1,33 @@
+Module ConstMsg
+
+ Public Const MSG_MISSINGKEYWD As Integer = 10100
+ Public Const MSG_NUMERICKEYBOARDWD As Integer = 10200
+
+ Public Const MSG_OMAGCUT As Integer = 90000
+ Public Const MSG_GENERAL As Integer = MSG_OMAGCUT
+ Public Const MSG_WORKINPROGRESSPAGEUC As Integer = MSG_OMAGCUT + 100
+ Public Const MSG_DIRECTCUTPAGEUC As Integer = MSG_OMAGCUT + 200
+ 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
+ Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360
+ Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
+ Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
+ Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
+ Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
+ Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
+ Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535
+ Public Const MSG_SIMULATIONPAGEUC As Integer = MSG_OMAGCUT + 550
+ Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600
+ Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700
+ Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720
+ Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
+ Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
+ Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
+ Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 930
+ Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 950
+ Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
+ Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200
+
+End Module
diff --git a/EgtDictionary.xaml b/EgtDictionary.xaml
new file mode 100644
index 0000000..99068ba
--- /dev/null
+++ b/EgtDictionary.xaml
@@ -0,0 +1,436 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtDictionary.xaml.vb b/EgtDictionary.xaml.vb
new file mode 100644
index 0000000..f22592c
--- /dev/null
+++ b/EgtDictionary.xaml.vb
@@ -0,0 +1,373 @@
+Imports System.Collections.ObjectModel
+Imports System.ComponentModel
+Imports System.Globalization
+
+Public Class EgtDictionary
+ Inherits ResourceDictionary
+
+End Class
+
+#Region ""
+
+Public Class ButtonExtensions
+
+ Public Shared ReadOnly CornerRadiusProperty As DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", GetType(Double), GetType(ButtonExtensions), New PropertyMetadata(0.0))
+
+ Public Shared Function GetCornerRadius(element As UIElement) As Double
+ Return CDbl(element.GetValue(CornerRadiusProperty))
+ End Function
+
+ Public Shared Sub SetCornerRadius(element As UIElement, value As Double)
+ element.SetValue(CornerRadiusProperty, value)
+ End Sub
+
+End Class
+
+#End Region
+
+Namespace ControlExtensions
+
+#Region ""
+
+ 'Converter che permette di ridimensionare la spunta
+ Public Class CheckboxConverter
+ 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
+ Return New Object() {Binding.DoNothing}
+ End Function
+ End Class
+
+#End Region
+
+#Region ""
+
+ Public Class GroupBoxExtensions
+
+ Public Shared ReadOnly CornerRadiusProperty As DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", GetType(Double), GetType(GroupBoxExtensions), New PropertyMetadata(0.0))
+
+ Public Shared Function GetCornerRadius(element As UIElement) As Double
+ Return CDbl(element.GetValue(CornerRadiusProperty))
+ End Function
+
+ Public Shared Sub SetCornerRadius(element As UIElement, value As Double)
+ element.SetValue(CornerRadiusProperty, value)
+ End Sub
+
+ Public Shared ReadOnly FirstColumnProperty As DependencyProperty = DependencyProperty.RegisterAttached("FirstColumn", GetType(Double), GetType(GroupBoxExtensions), New PropertyMetadata(0.0))
+
+ Public Shared Function GetFirstColumn(element As UIElement) As Double
+ Return CDbl(element.GetValue(CornerRadiusProperty))
+ End Function
+
+ Public Shared Sub SetFirstColumn(element As UIElement, value As Double)
+ element.SetValue(CornerRadiusProperty, value)
+ End Sub
+
+ End Class
+
+ 'Converter che permette di massimizzare l'area interna del GroupBox
+
+ Public Class GroupBoxConverter
+ Implements IMultiValueConverter
+
+ Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
+
+ ' Parameter Validation
+ Dim doubleType As Type = GetType(Double)
+
+ If values Is Nothing OrElse values.Length <> 3 OrElse values(0) Is Nothing OrElse values(1) Is Nothing OrElse values(2) Is Nothing Then
+ Return DependencyProperty.UnsetValue
+ End If
+
+ ' Conversion
+ Dim dBorderThickness As Double = 0
+ Dim dCornerRadius As Double = 0
+ Dim sItems(3) As String
+ Dim Val1 As Double
+ Dim Val2 As Double
+
+ sItems = values(0).ToString.Split(",".ToCharArray)
+ Double.TryParse(sItems(2), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val1)
+ Double.TryParse(sItems(3), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val2)
+ dBorderThickness = Math.Max(Val1, Val2)
+ sItems = values(1).ToString.Split(",".ToCharArray)
+ Double.TryParse(sItems(2), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val1)
+ Double.TryParse(sItems(3), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture.NumberFormat, Val2)
+ dCornerRadius = Math.Max(Val1, Val2)
+
+ ' Width of the line to the left of the header
+ ' to be used to set the width of the first column of the Grid
+ Dim GridLengthConverter As New GridLengthConverter
+ Dim lineWidth As Double = CDbl(GridLengthConverter.ConvertToString(values(2)))
+
+ ' Calcolo il Margin sottraendo alla larghezza della colonna (6) il massimo tra BorderThickness e CornerRadius
+ Dim dRightMargin = -6 + Math.Max(dBorderThickness, dCornerRadius)
+ Dim dLeftMargin = -lineWidth + Math.Max(dBorderThickness, dCornerRadius) - Math.Sqrt(2) / 2 * (dCornerRadius - dBorderThickness - 2)
+ ' Calcolo il minimo tra il valore ottenuto e 0 perchè BorderThickness non può spingere il Margin oltre lo 0
+ dRightMargin = Math.Min(0, dRightMargin)
+ dLeftMargin = Math.Min(0, dLeftMargin)
+ ' Creo Thickness con il valore ottenuto da ritornare
+ Dim ReturnValue As Thickness
+ ReturnValue.Top = 0
+ ReturnValue.Bottom = dRightMargin
+ ReturnValue.Left = dLeftMargin
+ ReturnValue.Right = dRightMargin
+ Return ReturnValue
+
+ End Function
+
+ Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
+ Return New Object() {Binding.DoNothing}
+ End Function
+ End Class
+
+ '''
+ ''' BorderGapMaskConverter class
+ '''
+ Public Class BorderGapMaskConverter
+ Implements IMultiValueConverter
+
+ '''
+ ''' Convert a value.
+ '''
+ ''' values as produced by source binding
+ ''' target type
+ ''' converter parameter
+ ''' culture information
+ '''
+ ''' Converted value.
+ ''' Visual Brush that is used as the opacity mask for the Border
+ ''' in the style for GroupBox.
+ '''
+ Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
+
+ ' Parameter Validation
+ Dim doubleType As Type = GetType(Double)
+
+ If values Is Nothing OrElse values.Length <> 4 OrElse values(0) Is Nothing OrElse values(1) Is Nothing OrElse values(2) Is Nothing OrElse values(3) Is Nothing OrElse Not doubleType.IsAssignableFrom(values(0).[GetType]()) OrElse Not doubleType.IsAssignableFrom(values(1).[GetType]()) OrElse Not doubleType.IsAssignableFrom(values(2).[GetType]()) Then
+ Return DependencyProperty.UnsetValue
+ End If
+
+ ' Conversion
+ Dim headerWidth As Double = CDbl(values(0))
+ Dim borderWidth As Double = CDbl(values(1))
+ Dim borderHeight As Double = CDbl(values(2))
+
+ ' Width of the line to the left of the header
+ ' to be used to set the width of the first column of the Grid
+ Dim GridLengthConverter As New GridLengthConverter
+ Dim lineWidth As Double = CDbl(GridLengthConverter.ConvertToString(values(3)))
+
+ ' Doesn't make sense to have a Grid
+ ' with 0 as width or height
+ If borderWidth = 0 OrElse borderHeight = 0 Then
+ Return Nothing
+ End If
+
+ Dim grid__1 As New Grid()
+ grid__1.Width = borderWidth
+ grid__1.Height = borderHeight
+ Dim colDef1 As New ColumnDefinition()
+ Dim colDef2 As New ColumnDefinition()
+ Dim colDef3 As New ColumnDefinition()
+ colDef1.Width = New GridLength(lineWidth)
+ colDef2.Width = New GridLength(headerWidth)
+ colDef3.Width = New GridLength(1, GridUnitType.Star)
+ grid__1.ColumnDefinitions.Add(colDef1)
+ grid__1.ColumnDefinitions.Add(colDef2)
+ grid__1.ColumnDefinitions.Add(colDef3)
+ Dim rowDef1 As New RowDefinition()
+ Dim rowDef2 As New RowDefinition()
+ rowDef1.Height = New GridLength(borderHeight / 2)
+ rowDef2.Height = New GridLength(1, GridUnitType.Star)
+ grid__1.RowDefinitions.Add(rowDef1)
+ grid__1.RowDefinitions.Add(rowDef2)
+
+ Dim rectColumn1 As New Rectangle()
+ Dim rectColumn2 As New Rectangle()
+ Dim rectColumn3 As New Rectangle()
+ rectColumn1.Fill = Brushes.Black
+ rectColumn2.Fill = Brushes.Black
+ rectColumn3.Fill = Brushes.Black
+
+ Grid.SetRowSpan(rectColumn1, 2)
+ Grid.SetRow(rectColumn1, 0)
+ Grid.SetColumn(rectColumn1, 0)
+
+ Grid.SetRow(rectColumn2, 1)
+ Grid.SetColumn(rectColumn2, 1)
+
+ Grid.SetRowSpan(rectColumn3, 2)
+ Grid.SetRow(rectColumn3, 0)
+ Grid.SetColumn(rectColumn3, 2)
+
+ grid__1.Children.Add(rectColumn1)
+ grid__1.Children.Add(rectColumn2)
+ grid__1.Children.Add(rectColumn3)
+
+ Return (New VisualBrush(grid__1))
+
+ End Function
+
+ '''
+ ''' Not Supported
+ '''
+ ''' value, as produced by target
+ ''' target types
+ ''' converter parameter
+ ''' culture information
+ ''' Nothing
+ Public Function ConvertBack(value As Object, targetTypes As Type(), parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
+ Return New Object() {Binding.DoNothing}
+ End Function
+
+
+
+ End Class
+
+#End Region
+
+#Region ""
+
+ Public Class CathegoryItem
+ Inherits TreeViewItemBase
+
+ Private m_sTitle As String
+ Private m_sPictureString As String
+ Private m_Items As ObservableCollection(Of CustomItem)
+
+ Sub New(Title As String)
+ Me.Title = Title
+ Me.Items = New ObservableCollection(Of CustomItem)
+ End Sub
+
+ Public Property Title 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/Lama.png"
+ 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
+
+ End Class
+
+ Public Class CustomItem
+ Inherits TreeViewItemBase
+
+ Private m_sTitle As String
+
+ Sub New(Title As String)
+ Me.Title = Title
+ End Sub
+
+ Public Property Title As String
+ Get
+ Return m_sTitle
+ End Get
+ Set(value As String)
+ m_sTitle = value
+ End Set
+ End Property
+
+ End Class
+
+ Public Class TreeViewItemBase
+ Implements INotifyPropertyChanged
+
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ 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 Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+
+ End Class
+
+#End Region
+
+ Public Class ToggleButtonExtensions
+
+ Public Shared ReadOnly CornerRadiusProperty As DependencyProperty = DependencyProperty.RegisterAttached("CornerRadius", GetType(Double), GetType(ToggleButtonExtensions), New PropertyMetadata(0.0))
+
+ Public Shared Function GetCornerRadius(element As UIElement) As Double
+ Return CDbl(element.GetValue(CornerRadiusProperty))
+ End Function
+
+ Public Shared Sub SetCornerRadius(element As UIElement, value As Double)
+ element.SetValue(CornerRadiusProperty, value)
+ End Sub
+
+ End Class
+
+End Namespace
diff --git a/MainWindow.xaml b/MainWindow.xaml
new file mode 100644
index 0000000..4db8e46
--- /dev/null
+++ b/MainWindow.xaml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb
new file mode 100644
index 0000000..cf3b3b4
--- /dev/null
+++ b/MainWindow.xaml.vb
@@ -0,0 +1,417 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib
+Imports System.ComponentModel
+Imports System.Threading
+Imports System.Windows.Threading
+
+Class MainWindow
+
+ ' Mutex per avere una sola istanza del programma in esecuzione
+ Private m_objMutex As New Mutex
+ Friend m_OptionsPageUC As OptionsPageUC
+
+ ' Dichiarazione variabili direttori
+ Private m_sDataRoot As String = String.Empty
+ Private m_sConfigDir As String = String.Empty
+ Private m_sTempDir As String = String.Empty
+ Private m_sMachinesRoot As String = String.Empty
+ Private m_sIniFile As String = String.Empty
+ Private m_nDebug As Integer = 0
+
+ 'Dichiarazione variabile contenente la lingua corrente
+ Friend m_CurrLanguage As Language
+ 'Dichiarazione lista delle lingue disponibili e lingua corrente
+ Friend m_LanguagesList As New List(Of Language)
+
+ ' Macchina corrente
+ Private m_sCurrMachine As String = String.Empty
+
+ ' Opzioni abilitate dalla licenza attiva associata alla chiave
+ Private m_nKeyOptions As UInteger
+ Friend Enum KEY_OPT As UInteger
+ BASE = 1
+ MAN_MANIP = 2
+ AUTO_MANIP = 4
+ MAN_PHOTO = 8
+ AUTO_PHOTO = 16
+ AUTO_NESTING = 32
+ ENABLE_MILL = 64
+ PROCUCTION_LINE = 128
+ End Enum
+
+ ' Dichiarazione Scene
+ Friend WithEvents CurrentProjectScene As New Scene
+ Private CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
+ Private m_bFirst As Boolean = True
+
+ ' Dichiarazione delle Page UserControl
+ Friend m_SceneButtons As SceneButtonsUC
+
+ ' Timer per aggiornamento interfaccia
+ Private m_IdleTimer As New DispatcherTimer(DispatcherPriority.ApplicationIdle)
+
+ Public Function GetIniFile() As String
+ Return m_sIniFile
+ End Function
+
+ Public Function GetTempDir() As String
+ Return m_sTempDir
+ End Function
+
+ Public Function GetMachinesRootDir() As String
+ Return m_sMachinesRoot
+ End Function
+
+ Public Function GetCurrMachine() As String
+ Return m_sCurrMachine
+ End Function
+
+ Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean
+ Return m_nKeyOptions And nKeyOpt
+ End Function
+
+ Friend Function GetKeyOptions() As UInteger
+ Return m_nKeyOptions
+ End Function
+
+ Private Sub MainWindow_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+ ' Verifico sia l'unica istanza
+ ManageSingleIstance()
+ ' Impostazione path radice per i dati
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ If GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ End If
+ ' Impostazione direttorio di configurazione
+ m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
+ ' Impostazione direttorio per file temporanei
+ m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
+ ' Impostazione path Ini file
+ m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
+ ' Impostazione direttorio per le macchine
+ If GetPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot, m_sIniFile) = 0 Then
+ m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
+ End If
+ ' Recupero nome macchina corrente
+ GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sCurrMachine, m_sIniFile)
+ ' Leggo e imposto chiave di protezione
+ Dim sLicFileName As String = String.Empty
+ GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName, m_sIniFile)
+ Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
+ Dim sKey As String = String.Empty
+ GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
+ EgtSetKey(sKey)
+ ' Inizializzazione generale di EgtInterface
+ m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
+ Dim sLogFile As String = m_sTempDir & "\" & GENLOG_FILE_NAME
+ Dim sLogMsg As String = My.Application.Info.Description.ToString() & " ver. " & My.Application.Info.Version.ToString()
+ EgtInit(m_nDebug, sLogFile, sLogMsg)
+ ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
+ Dim sMsgDir As String = String.Empty
+ If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir, m_sIniFile) = 0 Then
+ sMsgDir = m_sConfigDir
+ End If
+ ' Leggo elenco lingue disponibili da file ini
+ Dim nIndex As Integer = 1
+ Dim ReadLanguage As Language = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex, GetIniFile)
+ While Not IsNothing(ReadLanguage)
+ m_LanguagesList.Add(ReadLanguage)
+ nIndex += 1
+ ReadLanguage = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex, GetIniFile)
+ End While
+ ' Leggo file messaggi
+ Dim sMsgFile As String = String.Empty
+ GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgFile, m_sIniFile)
+ For i As Integer = 0 To m_LanguagesList.Count - 1
+ If m_LanguagesList(i).LanguageName = sMsgFile Then
+ m_CurrLanguage = m_LanguagesList(i)
+ End If
+ Next
+ Dim sMsgFilePath As String = sMsgDir & "\EgalTechIta.txt"
+ If Not IsNothing(m_CurrLanguage) Then
+ sMsgFilePath = sMsgDir & "\" & m_CurrLanguage.FileName
+ End If
+ If Not EgtLoadMessages(sMsgFilePath) Then
+ EgtOutLog("Error in EgtLoadMessages")
+ End If
+ Dim sNfeDir As String = String.Empty
+ GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir, m_sIniFile)
+ Dim sDefFont As String = String.Empty
+ GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont, m_sIniFile)
+ EgtSetFont(sNfeDir, sDefFont)
+ ' Recupero opzioni della chiave
+ Dim bKey As Boolean = EgtGetKeyOptions(9423, 16, 1, m_nKeyOptions)
+ EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
+ ' Imposto dir di default per libreria Lua e lancio libreria di base
+ Dim sLuaLibsDir As String = String.Empty
+ GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir, m_sIniFile)
+ EgtSetLuaLibs(sLuaLibsDir)
+ Dim sLuaBaseLib As String = String.Empty
+ GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib, m_sIniFile)
+ EgtLuaRequire(sLuaBaseLib)
+ ' Imposto unità di misura per interfaccia utente
+ Dim bMM As Boolean = (GetPrivateProfileInt(S_GENERAL, K_MMUNITS, 1, m_sIniFile) <> 0)
+ EgtSetUiUnits(bMM)
+ ' Imposto posizione e dimensioni della MainWindow
+ Dim nFlag As Integer
+ Dim nLeft As Integer
+ Dim nTop As Integer
+ Dim nWidth As Integer
+ Dim nHeight As Integer
+ GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
+ Me.WindowStartupLocation = Windows.WindowStartupLocation.Manual
+ Me.Top = nTop
+ Me.Left = nLeft
+ Me.Height = nHeight
+ Me.Width = nWidth
+ WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
+ ' Inizializzazione della libreria EgtWPFLib
+ EgtWPFInit()
+ ' Creazione delle Page UserControl
+ m_OptionsPageUC = New OptionsPageUC
+ ' Posizionemento nella griglia delle Page UserControl
+ m_OptionsPageUC.SetValue(Grid.ColumnProperty, 0)
+ m_OptionsPageUC.SetValue(Grid.RowProperty, 1)
+ ' Disabilita la possibilità di imitare il click del tasto destro del mouse tenendo premuto il dito sul touch
+ ' NB: Se abilitato impedisce di utilizzare lo stato Pressed dei Button che quindi non si evidenziano quando premuti
+ Stylus.SetIsPressAndHoldEnabled(Me, False)
+
+ 'Assegnazione scena all'host e posizionamento nella PlacePageGrid
+ CurrentProjectSceneHost.Child = CurrentProjectScene
+ CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 1)
+ CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
+ Me.SceneGrid.Children.Add(CurrentProjectSceneHost)
+
+ 'Creazione delle Page UserControl
+ m_SceneButtons = New SceneButtonsUC
+
+ ' Imposto OnIdle
+ AddHandler m_IdleTimer.Tick, AddressOf OnIdle
+ End Sub
+
+ Private Sub ManageSingleIstance()
+ Dim bCreated As Boolean
+ Try
+ m_objMutex = New Mutex(False, "Global\OmagView", bCreated)
+ Catch
+ bCreated = False
+ End Try
+ If Not bCreated Then
+ ' porto in primo piano la prima istanza
+ Dim bFound As Boolean = False
+ ' processi del programma a 32 bit
+ Dim localProc As Process() = Process.GetProcessesByName("OmagViewR32")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, 1)
+ Exit For
+ End If
+ Next
+ ' se non trovati processi a 32 bit provo a 64 bit
+ If Not bFound Then
+ localProc = Process.GetProcessesByName("OmagViewR64")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, SW.RESTORE)
+ Exit For
+ End If
+ Next
+ End If
+ ' esco dal programma
+ End
+ End If
+ End Sub
+
+ Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles Me.Loaded
+ ' imposto colore di default
+ Dim DefColor As New Color3d(0, 0, 0)
+ GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, GetIniFile())
+ CurrentProjectScene.SetDefaultMaterial(DefColor)
+ ' imposto colori sfondo
+ Dim BackTopColor As New Color3d(211, 211, 211)
+ GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, GetIniFile())
+ Dim BackBotColor As New Color3d(211, 211, 211)
+ GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, GetIniFile())
+ CurrentProjectScene.SetViewBackground(BackTopColor, BackBotColor)
+ ' imposto colore di evidenziazione
+ Dim MarkColor As New Color3d(255, 255, 0)
+ GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, GetIniFile())
+ CurrentProjectScene.SetMarkMaterial(MarkColor)
+ ' imposto colore per superfici selezionate
+ Dim SelSurfColor As New Color3d(255, 255, 192)
+ GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, GetIniFile())
+ CurrentProjectScene.SetSelSurfMaterial(SelSurfColor)
+ ' imposto tipo e colore del rettangolo di zoom
+ Dim bOutline As Boolean = True
+ Dim ZwColor As New Color3d(0, 0, 0)
+ GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, GetIniFile())
+ CurrentProjectScene.SetZoomWinAttribs(bOutline, ZwColor)
+ ' imposto colore della linea di distanza
+ Dim DstLnColor As New Color3d(255, 0, 0)
+ GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, GetIniFile())
+ CurrentProjectScene.SetDistLineMaterial(DstLnColor)
+ ' imposto parametri OpenGL
+ Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, GetIniFile())
+ Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, GetIniFile()) <> 0)
+ Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, GetIniFile())
+ Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, GetIniFile())
+ CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
+ ' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
+ If Not CurrentProjectScene.Init() Then
+ ' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
+ Me.SceneGrid.Children.Remove(CurrentProjectSceneHost)
+ Dim MissingKeyWnd As New EgtMsgBox(Me, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
+ Me.Close()
+ End If
+ ' Inizializzo gestore lavorazioni
+ EgtInitMachMgr(GetMachinesRootDir())
+ m_bFirst = False
+ ' Carico progetto in scarico
+ If Not LoadProject(m_sTempDir & "\CurrProj.nge") Then
+ NewProject()
+ End If
+ EgtZoom(ZM.ALL)
+ ' inibisco selezione diretta da Scene
+ CurrentProjectScene.SetStatusNull()
+ 'Posizionemento nella griglia delle Page UserControl
+ m_SceneButtons.SetValue(Grid.ColumnProperty, 1)
+ MainTabGrid.Children.Add(m_SceneButtons)
+ ' Lancio timer per aggiornamento interfaccia
+ m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
+ m_IdleTimer.Start()
+ End Sub
+
+ Private Sub OptionsBtn_Click(sender As Object, e As RoutedEventArgs) Handles OptionsBtn.Click
+ OptionsBtn.IsChecked = True
+ End Sub
+
+ Private Sub MainWindow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles Me.PreviewMouseDown
+ End Sub
+
+ Private Sub MainWindow_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
+ 'If (m_NumericKeyboardWD.IsVisible And e.Key = Key.Enter) Then
+ ' m_NumericKeyboardWD.Visibility = Windows.Visibility.Hidden
+ 'End If
+ End Sub
+
+ Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseDownScene
+ ' Si può selezionare solo con il tasto sinistro e se stato NULL
+ If e.Button <> Windows.Forms.MouseButtons.Left Or
+ Not CurrentProjectScene.IsStatusNull() Then
+ Return
+ End If
+ ' Identificativo del grezzo
+ Dim nRawId As Integer = EgtGetFirstRawPart()
+ ' Verifico se selezionato indicativo di pezzo
+ EgtSetObjFilterForSelect(True, True, True, True, True)
+ Dim nSel As Integer
+ EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
+ Dim nId As Integer = EgtGetFirstObjInSelWin()
+ While nId <> GDB_ID.NULL
+ ' Recupero l'identificativo del pezzo cui appartiene
+ Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
+ Dim bPartInTable As Boolean = (EgtGetParent(nPartId) = nRawId)
+ If EgtIsPart(nPartId) Or bPartInTable Then
+ Dim nStat As Integer = GDB_ST.ON_
+ EgtGetStatus(nPartId, nStat)
+ ' Se già selezionato deseleziono
+ If nStat = GDB_ST.SEL Then
+ EgtDeselectObj(nPartId)
+ Else
+ EgtDeselectAll()
+ EgtSelectObj(nPartId)
+ End If
+ EgtDraw()
+ Exit While
+ End If
+ nId = EgtGetNextObjInSelWin()
+ End While
+ End Sub
+
+ Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
+ ' Uscita
+ MainWindow_Unloaded(sender, e)
+ Me.Close()
+ End Sub
+
+ Private Sub MainWindow_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
+ ' Terminazione generale di EgtInterface
+ EgtExit()
+ ' Rilascio mutex
+ m_objMutex.Close()
+ End Sub
+
+ Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
+ End Sub
+
+ Private Sub EgtWPFInit()
+ 'EgtBasicInfo
+ EgtWPFLib.InitializeEgtWPFLib.EgtBasicInfo_Initialization("C:/EgtDev/OmagVIEW",
+ 1280, 1024, 15, 12,
+ "/#Century Gothic",
+ "/gothic.ttf",
+ Application.Current.FindResource("FontSize_UpperCaseCharacter"),
+ Application.Current.FindResource("FontSize_LowerCaseCharacter"))
+ ' EgtMessageBox
+ EgtWPFLib.InitializeEgtWPFLib.EgtMsgBox_Initialization(Application.Current.FindResource("OmagCut_WindowBorder"),
+ Application.Current.FindResource("OmagCut_WindowGrayTextButton"),
+ Nothing,
+ Application.Current.FindResource("FontSize_UpperCaseCharacter"),
+ Application.Current.FindResource("FontSize_LowerCaseCharacter"))
+ 'Inizializzazione della libreria
+ EgtWPFLib.InitializeEgtWPFLib.EgtPaths_Initialization()
+ End Sub
+
+ ' OnIdle
+ Private Sub OnIdle()
+ End Sub
+
+ ' Evento che apre AboutBox quando viene clickato il logo
+ Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
+ Dim AboutBox As New AboutBoxWD(Me)
+ End Sub
+
+ Private Function LoadProject(ByVal sPath As String) As Boolean
+ ' Carico il file
+ If Not EgtOpenFile(sPath) Then
+ Return False
+ End If
+ ' Recupero il gruppo di lavoro del file
+ Dim nMachGrpId As Integer = EgtGetFirstMachGroup()
+ If nMachGrpId = GDB_ID.NULL Then
+ Return False
+ End If
+ ' Carico il gruppo e verifico che la sua macchina sia quella corrente
+ Dim sFileMachine As String = String.Empty
+ If Not EgtSetCurrMachGroup(nMachGrpId) Then
+ EgtGetInfo(nMachGrpId, "Machine", sFileMachine)
+ Else
+ EgtGetCurrMachineName(sFileMachine)
+ End If
+ ' Visualizzo solo la tavola della macchina
+ EgtShowOnlyTable(True)
+ Return True
+ End Function
+
+ Friend Function NewProject() As Boolean
+ ' Imposto il nuovo progetto
+ EgtNewFile()
+ ' Recupero nome macchina corrente
+ Dim sMachine As String = String.Empty
+ GetPrivateProfileString(S_MACH, K_CURRMACH, "", sMachine, m_sIniFile)
+ ' Creo un gruppo di lavoro e carico la macchina corrente
+ If EgtAddMachGroup(MACH_GROUP, sMachine) = GDB_ID.NULL Then
+ Return False
+ End If
+ ' Imposto la tavola corrente
+ If Not EgtSetTable(MAIN_TAB) Then
+ Return False
+ End If
+ EgtShowOnlyTable(True)
+ Return True
+ End Function
+
+End Class
\ No newline at end of file
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
new file mode 100644
index 0000000..8cad84e
--- /dev/null
+++ b/My Project/AssemblyInfo.vb
@@ -0,0 +1,59 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+Imports System.Globalization
+Imports System.Resources
+Imports System.Windows
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+
+
+
+
+
+
+
+
+'In order to begin building localizable applications, set
+'CultureYouAreCodingWith in your .vbproj file
+'inside a . For example, if you are using US english
+'in your source files, set the to "en-US". Then uncomment the
+'NeutralResourceLanguage attribute below. Update the "en-US" in the line
+'below to match the UICulture setting in the project file.
+
+'
+
+
+'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
+'1st parameter: where theme specific resource dictionaries are located
+'(used if a resource is not found in the page,
+' or application resource dictionaries)
+
+'2nd parameter: where the generic resource dictionary is located
+'(used if a resource is not found in the page,
+'app, and any theme specific resource dictionaries)
+
+
+
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+'
+
+
+
diff --git a/My Project/MyExtensions/MyWpfExtension.vb b/My Project/MyExtensions/MyWpfExtension.vb
new file mode 100644
index 0000000..2f5639e
--- /dev/null
+++ b/My Project/MyExtensions/MyWpfExtension.vb
@@ -0,0 +1,121 @@
+#If _MyType <> "Empty" Then
+
+Namespace My
+ '''
+ ''' Module used to define the properties that are available in the My Namespace for WPF
+ '''
+ '''
+ _
+ Module MyWpfExtension
+ Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
+ Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
+ Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
+ Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
+ '''
+ ''' Returns the application object for the running application
+ '''
+ _
+ Friend ReadOnly Property Application() As Application
+ Get
+ Return CType(Global.System.Windows.Application.Current, Application)
+ End Get
+ End Property
+ '''
+ ''' Returns information about the host computer.
+ '''
+ _
+ Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
+ Get
+ Return s_Computer.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns information for the current user. If you wish to run the application with the current
+ ''' Windows user credentials, call My.User.InitializeWithWindowsUser().
+ '''
+ _
+ Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
+ Get
+ Return s_User.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns the application log. The listeners can be configured by the application's configuration file.
+ '''
+ _
+ Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
+ Get
+ Return s_Log.GetInstance()
+ End Get
+ End Property
+
+ '''
+ ''' Returns the collection of Windows defined in the project.
+ '''
+ _
+ Friend ReadOnly Property Windows() As MyWindows
+ _
+ Get
+ Return s_Windows.GetInstance()
+ End Get
+ End Property
+ _
+ _
+ Friend NotInheritable Class MyWindows
+ _
+ Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
+ If Instance Is Nothing Then
+ If s_WindowBeingCreated IsNot Nothing Then
+ If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
+ Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
+ End If
+ Else
+ s_WindowBeingCreated = New Global.System.Collections.Hashtable()
+ End If
+ s_WindowBeingCreated.Add(GetType(T), Nothing)
+ Return New T()
+ s_WindowBeingCreated.Remove(GetType(T))
+ Else
+ Return Instance
+ End If
+ End Function
+ _
+ _
+ Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
+ instance = Nothing
+ End Sub
+ _
+ _
+ Public Sub New()
+ MyBase.New()
+ End Sub
+ Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
+ Public Overrides Function Equals(ByVal o As Object) As Boolean
+ Return MyBase.Equals(o)
+ End Function
+ Public Overrides Function GetHashCode() As Integer
+ Return MyBase.GetHashCode
+ End Function
+ _
+ _
+ Friend Overloads Function [GetType]() As Global.System.Type
+ Return GetType(MyWindows)
+ End Function
+ Public Overrides Function ToString() As String
+ Return MyBase.ToString
+ End Function
+ End Class
+ End Module
+End Namespace
+Partial Class Application
+ Inherits Global.System.Windows.Application
+ _
+ _
+ Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
+ _
+ Get
+ Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
+ End Get
+ End Property
+End Class
+#End If
\ No newline at end of file
diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb
new file mode 100644
index 0000000..6d37a23
--- /dev/null
+++ b/My Project/Resources.Designer.vb
@@ -0,0 +1,63 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.34209
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Imports System
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("OmagVIEW.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/My Project/Resources.resx b/My Project/Resources.resx
new file mode 100644
index 0000000..ffecec8
--- /dev/null
+++ b/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb
new file mode 100644
index 0000000..535299a
--- /dev/null
+++ b/My Project/Settings.Designer.vb
@@ -0,0 +1,71 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.34209
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+
+ _
+Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+End Class
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.OmagVIEW.MySettings
+ Get
+ Return Global.OmagVIEW.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/My Project/Settings.settings b/My Project/Settings.settings
new file mode 100644
index 0000000..2b428d2
--- /dev/null
+++ b/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OmagVIEW.sln b/OmagVIEW.sln
new file mode 100644
index 0000000..7a48614
--- /dev/null
+++ b/OmagVIEW.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OmagVIEW", "OmagVIEW.vbproj", "{33137AF2-9126-46C4-9650-3E529B68CF9B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {33137AF2-9126-46C4-9650-3E529B68CF9B}.Debug|x86.ActiveCfg = Debug|x86
+ {33137AF2-9126-46C4-9650-3E529B68CF9B}.Debug|x86.Build.0 = Debug|x86
+ {33137AF2-9126-46C4-9650-3E529B68CF9B}.Release|x86.ActiveCfg = Release|x86
+ {33137AF2-9126-46C4-9650-3E529B68CF9B}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/OmagVIEW.vbproj b/OmagVIEW.vbproj
new file mode 100644
index 0000000..f66ab61
--- /dev/null
+++ b/OmagVIEW.vbproj
@@ -0,0 +1,215 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {33137AF2-9126-46C4-9650-3E529B68CF9B}
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
+ WinExe
+ OmagVIEW
+ OmagVIEW
+ v4.0
+ Custom
+ Client
+
+
+ AnyCPU
+ true
+ full
+ true
+ true
+ true
+ bin\Debug\
+
+
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
+ false
+
+
+ AnyCPU
+ pdbonly
+ false
+ false
+ true
+ false
+ true
+ bin\Release\
+
+
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
+ false
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+ x86
+ bin\x86\Debug\
+ false
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
+
+
+ x86
+ bin\x86\Release\
+ false
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
+
+
+
+ ..\..\EgtProg\DllD32\EgtUILib.dll
+
+
+ ..\..\EgtProg\DllD32\EgtWPFLib.dll
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ AboutBoxWD.xaml
+
+
+ EgtDictionary.xaml
+
+
+ OmagVIEWDictionary.xaml
+
+
+ OptionsPageUC.xaml
+
+
+ SceneButtonsUC.xaml
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Application.xaml
+ Code
+
+
+
+
+
+ MainWindow.xaml
+ Code
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Microsoft.VisualBasic.WPF.MyExtension
+ 1.0.0.0
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.vb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagVIEW\OmagVIEWR32.exe
+IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\OmagVIEW\OmagVIEWD32.exe
+
+
\ No newline at end of file
diff --git a/OmagVIEWDictionary.xaml b/OmagVIEWDictionary.xaml
new file mode 100644
index 0000000..ddbf98a
--- /dev/null
+++ b/OmagVIEWDictionary.xaml
@@ -0,0 +1,1769 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 9.5
+ 9.5
+ 3.3
+ 9.5
+ 12.5
+ 40
+ 18.6
+ 20
+ 33.3
+ 24
+ 18.6
+ 13.3
+ 1
+ 9.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/OmagVIEWDictionary.xaml.vb b/OmagVIEWDictionary.xaml.vb
new file mode 100644
index 0000000..f1b9155
--- /dev/null
+++ b/OmagVIEWDictionary.xaml.vb
@@ -0,0 +1,322 @@
+Imports System.Collections.ObjectModel
+Imports System.ComponentModel
+
+Partial Class OmagCUTDictionary
+ Inherits ResourceDictionary
+
+ Dim m_MainWindow As MainWindow = Application.Current.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 CathegoryItem
+ Inherits TreeViewItemBase
+
+ '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/Lama.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 CustomItem
+ Inherits TreeViewItemBase
+
+ '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 PartCathegoryItem
+ Inherits TreeViewItemBase
+
+ 'Private m_sTitle As String
+ Private m_sPictureString As String
+ Private m_nFType As Integer
+ Private m_Items As ObservableCollection(Of PartCustomItem)
+
+ '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/Lama.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 PartCustomItem
+ Inherits TreeViewItemBase
+
+ 'Private m_sTitle As String
+ 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 TreeViewItemBase
+ 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 CheckboxConverter
+ 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/OptionsPageUC.xaml b/OptionsPageUC.xaml
new file mode 100644
index 0000000..a2f1d60
--- /dev/null
+++ b/OptionsPageUC.xaml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionsPageUC.xaml.vb b/OptionsPageUC.xaml.vb
new file mode 100644
index 0000000..2e841bf
--- /dev/null
+++ b/OptionsPageUC.xaml.vb
@@ -0,0 +1,40 @@
+Imports EgtUILib
+
+Public Class OptionsPageUC
+
+ Dim m_MainWindow As MainWindow = Application.Current.MainWindow
+
+ Private UnitsList() As String = {"inch", "mm"}
+
+ Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+
+ ' Associazione della lista linguaggi alla combobox
+ LanguageCmBx.ItemsSource = m_MainWindow.m_LanguagesList
+ ' Associazione della lista unità di misura alla combobox
+ UnitsOfMeasureCmBx.ItemsSource = UnitsList
+
+ ' Imposto la lingua corrente
+ LanguageCmBx.SelectedItem = m_MainWindow.m_CurrLanguage
+
+ ' Imposto l'unità di misura corrente
+ UnitsOfMeasureCmBx.SelectedIndex = If(EgtUiUnitsAreMM(), 1, 0)
+
+ ' Messaggi
+ LanguageGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 1)
+ LanguageMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 2)
+ UnitsOfMeasureGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 3)
+ End Sub
+
+ Private Sub LanguageCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles LanguageCmBx.SelectionChanged
+ m_MainWindow.m_CurrLanguage = LanguageCmBx.SelectedItem
+ WritePrivateProfileString(S_GENERAL, K_MESSAGES, m_MainWindow.m_CurrLanguage.LanguageName, m_MainWindow.GetIniFile())
+ End Sub
+
+ Private Sub UnitsOfMeasureCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles UnitsOfMeasureCmBx.SelectionChanged
+ Dim bMM As Boolean = (UnitsOfMeasureCmBx.SelectedIndex <> 0)
+ EgtSetUiUnits(bMM)
+ 'm_MainWindow.m_CurrentProjectPageUC.UpdateHeightTxBx()
+ WritePrivateProfileString(S_GENERAL, K_MMUNITS, If(bMM, 1, 0), m_MainWindow.GetIniFile())
+ End Sub
+
+End Class
diff --git a/Resources/GenericView.png b/Resources/GenericView.png
new file mode 100644
index 0000000..3603766
Binary files /dev/null and b/Resources/GenericView.png differ
diff --git a/Resources/LogoOmag.jpg b/Resources/LogoOmag.jpg
new file mode 100644
index 0000000..394b443
Binary files /dev/null and b/Resources/LogoOmag.jpg differ
diff --git a/Resources/LookFromTOP.png b/Resources/LookFromTOP.png
new file mode 100644
index 0000000..c1c78fb
Binary files /dev/null and b/Resources/LookFromTOP.png differ
diff --git a/Resources/Options.png b/Resources/Options.png
new file mode 100644
index 0000000..6fb84bb
Binary files /dev/null and b/Resources/Options.png differ
diff --git a/Resources/Pan.png b/Resources/Pan.png
new file mode 100644
index 0000000..afc967c
Binary files /dev/null and b/Resources/Pan.png differ
diff --git a/Resources/V.png b/Resources/V.png
new file mode 100644
index 0000000..92ed674
Binary files /dev/null and b/Resources/V.png differ
diff --git a/Resources/X.png b/Resources/X.png
new file mode 100644
index 0000000..489c742
Binary files /dev/null and b/Resources/X.png differ
diff --git a/Resources/ZoomAll.png b/Resources/ZoomAll.png
new file mode 100644
index 0000000..144b0ec
Binary files /dev/null and b/Resources/ZoomAll.png differ
diff --git a/Resources/ZoomIn.png b/Resources/ZoomIn.png
new file mode 100644
index 0000000..2725f79
Binary files /dev/null and b/Resources/ZoomIn.png differ
diff --git a/Resources/ZoomOut.png b/Resources/ZoomOut.png
new file mode 100644
index 0000000..83c3b90
Binary files /dev/null and b/Resources/ZoomOut.png differ
diff --git a/Resources/ZoomWin.png b/Resources/ZoomWin.png
new file mode 100644
index 0000000..92883bb
Binary files /dev/null and b/Resources/ZoomWin.png differ
diff --git a/SceneButtonsUC.xaml b/SceneButtonsUC.xaml
new file mode 100644
index 0000000..d97b89a
--- /dev/null
+++ b/SceneButtonsUC.xaml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SceneButtonsUC.xaml.vb b/SceneButtonsUC.xaml.vb
new file mode 100644
index 0000000..8028a6c
--- /dev/null
+++ b/SceneButtonsUC.xaml.vb
@@ -0,0 +1,52 @@
+Imports EgtUILib
+
+Public Class SceneButtonsUC
+
+ 'Riferimento alla MainWindow
+ Dim m_MainWindow As MainWindow = Application.Current.MainWindow
+
+ Private Sub ZoomAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomAllBtn.Click
+ EgtZoom(ZM.ALL)
+ End Sub
+
+ Private Sub ZoomInBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomInBtn.Click
+ EgtZoom(ZM.IN_)
+ End Sub
+
+ Private Sub ZoomOutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomOutBtn.Click
+ EgtZoom(ZM.OUT)
+ End Sub
+
+ Private Sub ZoomWinBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomWinBtn.Click
+ GetCurrScene.SetStatusZoomWin()
+ End Sub
+
+ Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click
+ GetCurrScene.SetStatusPan()
+ End Sub
+
+ Private Sub GenericViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles GenericViewBtn.Click
+ If Keyboard.IsKeyDown(Key.T) Then
+ EgtSetView(VT.TOP)
+ ElseIf Keyboard.IsKeyDown(Key.F) Then
+ EgtSetView(VT.FRONT)
+ ElseIf Keyboard.IsKeyDown(Key.B) Then
+ EgtSetView(VT.BACK)
+ ElseIf Keyboard.IsKeyDown(Key.L) Then
+ EgtSetView(VT.LEFT)
+ ElseIf Keyboard.IsKeyDown(Key.R) Then
+ EgtSetView(VT.RIGHT)
+ Else
+ GetCurrScene.SetStatusRot()
+ End If
+ End Sub
+
+ Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click
+ EgtSetView(VT.TOP)
+ End Sub
+
+ Private Function GetCurrScene() As EgtUILib.Scene
+ Return m_MainWindow.CurrentProjectScene
+ End Function
+
+End Class
diff --git a/Utility.vb b/Utility.vb
new file mode 100644
index 0000000..a26afdc
--- /dev/null
+++ b/Utility.vb
@@ -0,0 +1,102 @@
+Imports System.Globalization
+Imports EgtUILib
+
+Module Utility
+
+ '--------------------------------------------------------------------------------------------------
+ Friend Sub UpdateUI()
+ ' Costringo ad aggiornare UI
+ Dim nDummy As Integer
+ Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
+ New Action(Function() nDummy = 0))
+ End Sub
+
+ '--------------------------------------------------------------------------------------------------
+ Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
+ Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
+ Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
+ If nNumDec > 0 Then
+ Return sVal.TrimEnd("0".ToCharArray()).TrimEnd(".".ToCharArray)
+ Else
+ Return sVal
+ End If
+ End Function
+
+ Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean
+ Return EgtLuaEvalNumExpr(sVal, dVal)
+ End Function
+
+ Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
+ Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
+ End Function
+
+ Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean
+ If EgtLuaEvalNumExpr(sVal, dVal) Then
+ dVal = EgtFromUiUnits(dVal)
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+ Friend Function UIExprToExpr(ByVal sUIExpr) As String
+ If String.IsNullOrWhiteSpace(sUIExpr) Then
+ Return ""
+ End If
+ Return sUIExpr.Replace("""", "*GEO.ONE_INCH")
+ End Function
+
+ Friend Function ExprToUIExpr(ByVal sExpr) As String
+ If String.IsNullOrWhiteSpace(sExpr) Then
+ Return ""
+ End If
+ Return sExpr.Replace("*GEO.ONE_INCH", """")
+ End Function
+
+ '--------------------------------------------------------------------------------------------------
+ Public Class Language
+
+ Private m_sLanguageName As String
+ Private m_sFileName As String
+
+ Public Property LanguageName As String
+ Get
+ Return m_sLanguageName
+ End Get
+ Set(value As String)
+ m_sLanguageName = value
+ End Set
+ End Property
+
+ Public Property FileName As String
+ Get
+ Return m_sFileName
+ End Get
+ Set(value As String)
+ m_sFileName = value
+ End Set
+ End Property
+
+ Sub New(LanguageName As String, FileName As String)
+ Me.LanguageName = LanguageName
+ Me.FileName = FileName
+ End Sub
+
+ End Class
+
+ Public Function GetPrivateProfileLanguage(
+ ByVal lpAppName As String,
+ ByVal lpKeyName As String,
+ ByVal lpFileName As String) As Language
+
+ Dim sVal As String = String.Empty
+ GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ If sItems.Count() = 2 Then
+ Return New Language(sItems(0), sItems(1))
+ End If
+ Return Nothing
+
+ End Function
+
+End Module
diff --git a/app.config b/app.config
new file mode 100644
index 0000000..843d111
--- /dev/null
+++ b/app.config
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+