SarmaxWall 1.6i1 :

- Primo rilascio.
This commit is contained in:
Emmanuele Sassi
2015-09-02 13:34:13 +00:00
parent 5089d337e2
commit 0efe5cff09
34 changed files with 2534 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
+6
View File
@@ -0,0 +1,6 @@
Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
End Class
+45
View File
@@ -0,0 +1,45 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstGen.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti generali.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
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 = "OmagCUT.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 = "OmagCUTLog.txt"
' File di log dei comandi
Public Const CMDLOG_FILE_NAME As String = "OmagCUTLog.tua"
' 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 Pack dei pezzi in Special
Public Const PACK_MAX_X As Double = 2500
Public Const PACK_OFFS As Double = 20
End Module
+91
View File
@@ -0,0 +1,91 @@
'----------------------------------------------------------------------------
' 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 = "SarmaxWall.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_USERLEVEL As String = "UserLevel"
Public Const K_MAXINST As String = "MaxInstances"
Public Const K_INSTANCES As String = "Instances"
Public Const K_COMMANDLOG As String = "CommandLog"
Public Const K_MESSAGES As String = "Messages"
Public Const K_WINPLACE As String = "WinPlace"
Public Const K_LASTNGEDIR As String = "LastNgeDir"
Public Const K_LASTNGEOBJDIR As String = "LastNgeObjDir"
Public Const K_LASTLUADIR As String = "LastLuaDir"
Public Const K_LASTIMPDIR As String = "LastImpDir"
Public Const K_LASTEXPDIR As String = "LastExpDir"
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 K_SAVETYPE As String = "SaveType"
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 K_MMUNITS As String = "MmUnits"
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_TABSPECIAL As String = "TabSpecial"
Public Const K_TSSHOW As String = "Show"
Public Const S_COMPO As String = "Compo"
Public Const K_CMPWINPLACE As String = "WinPlace"
Public Const K_COMPODIR As String = "CompoDir"
Public Const S_FLATPARTS As String = "FlatParts"
Public Const K_FLPWINPLACE As String = "WinPlace"
Public Const K_FLPCURRDIR As String = "CurrDir"
Public Const S_MACH As String = "Mach"
Public Const K_MACHINESDIR As String = "MachinesDir"
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUSCRIPTS As String = "MruScripts"
Public Const K_FILE As String = "File"
End Module
+10
View File
@@ -0,0 +1,10 @@
Module ConstMsg
Public Const MSG_GENERAL As Integer = 101000
Public Const MSG_IMPORTPAGEUC As Integer = 101100
Public Const MSG_DRAWPAGEUC As Integer = 101200
Public Const MSG_PLACEPAGEUC As Integer = 101300
Public Const MSG_OPTIONSPAGEUC As Integer = 101400
Public Const MSG_MISSINGKEYWD As Integer = 101500
End Module
+91
View File
@@ -0,0 +1,91 @@
<UserControl x:Class="DrawPageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="704" d:DesignWidth="1024" Initialized="DrawPage_Initialized" Loaded="DrawPage_Loaded" Unloaded="DrawPage_Unloaded">
<!-- Chiamata al Dictionary -->
<UserControl.Resources>
<ResourceDictionary Source="SarmaxWallDictionary.xaml"/>
</UserControl.Resources>
<!-- Definizione della DrawPage -->
<Grid Name="DrawPageGrid" Background="Red">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ToggleButton Name="WallBtn" Grid.Row="0" Grid.ColumnSpan="2" />
<ToggleButton Name="DoorBtn" Grid.Row="1" Grid.ColumnSpan="2" />
<ToggleButton Name="WindowBtn" Grid.Row="2" Grid.ColumnSpan="2" />
<Label Name="Label1" Grid.Row="5" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="20"/>
<TextBox Name="TextBox1" Grid.Column="1" Grid.Row="5" Style="{StaticResource NumericKeyboard}"
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
TextAlignment="Right"/>
<Label Name="Label2" Grid.Row="6" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="20"/>
<TextBox Name="TextBox2" Grid.Column="1" Grid.Row="6" Style="{StaticResource NumericKeyboard}"
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
TextAlignment="Right" />
<Label Name="Label3" Grid.Row="7" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="20"/>
<TextBox Name="TextBox3" Grid.Column="1" Grid.Row="7" Style="{StaticResource NumericKeyboard}"
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
TextAlignment="Right"/>
<Label Name="Label4" Grid.Row="8" Content="Label" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="20"/>
<TextBox Name="TextBox4" Grid.Column="1" Grid.Row="8" Style="{StaticResource NumericKeyboard}"
FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60"
TextAlignment="Right"/>
<Label Name="MessageLabel" Grid.Row="9" Grid.ColumnSpan="2" Content="Label" FontSize="15"/>
<Button Name="AddBtn" Grid.Row="10" />
<Button Name="CancelBtn" Grid.Row="10" Grid.Column="1"/>
</Grid>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="ConfirmBtn" Grid.Column="1" Content="V" />
<Button Name="ExitBtn" Grid.Column="2" Content="X" />
</Grid>
</Grid>
</UserControl>
+504
View File
@@ -0,0 +1,504 @@
Imports System.Globalization
Imports EgtUILib
Imports EgtUILib.EgtInterface
Public Class DrawPageUC
'Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
' Constants
Private Const NUM_VAR As Integer = 10
Private Const LUA_CMP_VARS As String = "CMP"
Private Const LUA_CMP_DRAW As String = "CMP_Draw"
Private Const INFO_VAR As String = "Var"
' Properties
Private m_sCompoDir As String = String.Empty
Private m_sCompoName As String = String.Empty
Private m_CVars(NUM_VAR - 1) As CompoVar
Private m_bDrawOk As Boolean = False
Private m_bFirst As Boolean = True
'Riferimento alla pagina correntemente attiva
Friend m_ActiveComponent As Components
Enum Components
Wall
Door
Window
Null
End Enum
'Dichiarazione Scene
Friend Shared WithEvents DrawScene As New Scene
Dim DrawSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private Sub DrawPage_Initialized(sender As Object, e As EventArgs)
'Assegnazione scena all'host e posizionamento nella ImportPageGrid
DrawSceneHost.Child = DrawScene
DrawSceneHost.SetValue(Grid.ColumnProperty, 1)
DrawSceneHost.SetValue(Grid.RowProperty, 0)
Me.DrawPageGrid.Children.Add(DrawSceneHost)
'Imposto i messaggi letti dal file dei messaggi
WallBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 1) 'Wall - Parete
DoorBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 2) 'Door - Porta
WindowBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 3) 'Window - Finestra
AddBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 4) 'Add - Aggiungi
CancelBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 5) 'Cancel - Annulla
End Sub
Private Sub DrawPage_Loaded(sender As Object, e As RoutedEventArgs)
If m_bFirst Then
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
DrawScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
DrawScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
DrawScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
DrawScene.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, m_MainWindow.GetIniFile())
DrawScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
DrawScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
DrawScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
' inizializzo la scena (DB geometrico + visualizzazione)
DrawScene.Init()
' inibisco selezione diretta da Scene
DrawScene.SetStatusNull()
' leggo direttorio componenti
GetPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir, m_MainWindow.GetIniFile())
m_bFirst = False
Else
EgtSetCurrentContext(DrawScene.GetCtx())
End If
'Associo TextBox e Label
TextBox1.Tag = Label1
TextBox2.Tag = Label2
TextBox3.Tag = Label3
TextBox4.Tag = Label4
'Apro e seleziono per default il componente Parete
'WallBtn.RaiseEvent(New RoutedEventArgs(Button.ClickEvent))
m_ActiveComponent = Components.Wall
' Carico componente
LoadCurrentCompo("Rettangolo")
WallBtn.IsChecked = True
End Sub
Private Sub WallBtn_Click(sender As Object, e As RoutedEventArgs) Handles WallBtn.Click
Select Case m_ActiveComponent
Case Components.Wall
WallBtn.IsChecked = True
Case Components.Door
WallBtn.IsChecked = False
DoorBtn.IsChecked = True
Case Components.Window
WallBtn.IsChecked = False
WindowBtn.IsChecked = True
Case Components.Null
m_ActiveComponent = Components.Wall
' Carico componente
LoadCurrentCompo("Rettangolo")
WallBtn.IsChecked = True
End Select
End Sub
Private Sub DoorBtn_Click(sender As Object, e As RoutedEventArgs) Handles DoorBtn.Click
Select Case m_ActiveComponent
Case Components.Wall
WallBtn.IsChecked = True
DoorBtn.IsChecked = False
Case Components.Door
DoorBtn.IsChecked = True
Case Components.Window
DoorBtn.IsChecked = False
WindowBtn.IsChecked = True
Case Components.Null
m_ActiveComponent = Components.Door
' Carico componente
LoadCurrentCompo("Triangolo2L")
DoorBtn.IsChecked = True
End Select
End Sub
Private Sub WindowBtn_Click(sender As Object, e As RoutedEventArgs) Handles WindowBtn.Click
Select Case m_ActiveComponent
Case Components.Wall
WallBtn.IsChecked = True
WindowBtn.IsChecked = False
Case Components.Door
DoorBtn.IsChecked = True
WindowBtn.IsChecked = False
Case Components.Window
WindowBtn.IsChecked = True
Case Components.Null
m_ActiveComponent = Components.Window
' Carico componente
LoadCurrentCompo("Triangolo3L")
WindowBtn.IsChecked = True
End Select
End Sub
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
Select Case m_ActiveComponent
Case Components.Wall
WallBtn.IsChecked = False
HideComponentParameters()
Case Components.Door
DoorBtn.IsChecked = False
HideComponentParameters()
Case Components.Window
WindowBtn.IsChecked = False
HideComponentParameters()
Case Components.Null
MessageLabel.Content = "Nessun componente selezionato"
End Select
m_ActiveComponent = Components.Null
End Sub
Private Sub CancelBtn_Click(sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click
Select Case m_ActiveComponent
Case Components.Wall
WallBtn.IsChecked = False
HideComponentParameters()
Case Components.Door
DoorBtn.IsChecked = False
HideComponentParameters()
Case Components.Window
WindowBtn.IsChecked = False
HideComponentParameters()
Case Components.Null
MessageLabel.Content = "Nessun componente selezionato"
End Select
m_ActiveComponent = Components.Null
End Sub
Private Sub HideComponentParameters()
Label1.Visibility = Windows.Visibility.Hidden
Label2.Visibility = Windows.Visibility.Hidden
Label3.Visibility = Windows.Visibility.Hidden
Label4.Visibility = Windows.Visibility.Hidden
TextBox1.Visibility = Windows.Visibility.Hidden
TextBox2.Visibility = Windows.Visibility.Hidden
TextBox3.Visibility = Windows.Visibility.Hidden
TextBox4.Visibility = Windows.Visibility.Hidden
MessageLabel.Content = String.Empty
End Sub
Public Sub UpdateView()
' aggiorno le variabili dalla griglia
UpdateVariables()
' ricalcolo il disegno
Dim sMsg As String = String.Empty
MakePreview(sMsg)
MessageLabel.Content = sMsg
MessageLabel.Background = If(m_bDrawOk, Brushes.White, Brushes.Tomato)
' aggiorno visualizzazione
EgtSetView(VT.TOP, False)
EgtZoom(ZM.ALL)
End Sub
Private Function ExecCompoFile() As Boolean
' Costruisco path completa del componente
Dim sPath = m_sCompoDir & "\" & m_sCompoName & ".lua"
' Carico il file
Return EgtLuaExecFile(sPath)
End Function
Private Sub LoadCurrentCompo(ByVal sCompo As String)
' Verifico se cambiato
'If sCompo = m_sCompoName Then
' Return
'End If
m_sCompoName = sCompo
' Pulisco l'ambiente lua
ResetLuaVariables()
' Carico il file ed eseguo in modalità anteprima
Dim bOk As Boolean = ExecCompoFile()
Dim sMsg As String = String.Empty
bOk = bOk AndAlso MakePreview(sMsg)
If Not bOk Then
EgtNewFile()
End If
MessageLabel.Content = sMsg
MessageLabel.Background = If(m_bDrawOk, Brushes.White, Brushes.Tomato)
DrawScene.ZoomAll()
' leggo variabili e aggiorno griglia
ReadAndShowVariables()
' abilito bottoni Vista e Inserisci
'btnView.Enabled = True
'btnInsert.Enabled = True
' un pezzo da inserire
'tbNbr.Text = "1"
End Sub
Private Function ReadAndShowVariables() As Boolean
' Recupero nome, tipo e valore delle variabili globali
For i As Integer = 1 To NUM_VAR
Dim CVar = New CompoVar
CVar.m_nInd = i
If CVar.NameTypeValueFromLua() Then
m_CVars(i - 1) = CVar
Else
m_CVars(i - 1) = Nothing
End If
Next
' Aggiorno la griglia dalle variabili
For i As Integer = 1 To NUM_VAR
If m_CVars(i - 1) IsNot Nothing Then
GetNameEdit(i).Content = m_CVars(i - 1).m_sName
GetNameEdit(i).Visibility = Windows.Visibility.Visible
GetValueEdit(i).Text = m_CVars(i - 1).ToString()
GetValueEdit(i).Visibility = Windows.Visibility.Visible
Else
GetNameEdit(i).Visibility = Windows.Visibility.Hidden
GetValueEdit(i).Visibility = Windows.Visibility.Hidden
End If
Next
Return True
End Function
Private Function UpdateVariables() As Boolean
' aggiorno le variabili
For i As Integer = 1 To NUM_VAR
If m_CVars(i - 1) IsNot Nothing Then
' interpreto il valore, se non riesco ripristino default
If Not m_CVars(i - 1).FromString(GetValueEdit(i).Text) Then
GetValueEdit(i).Text = m_CVars(i - 1).ToString()
End If
' aggiorno la corrispondente variabile lua
If Not m_CVars(i - 1).ToLua() Then
Dim sErr As String = String.Empty
EgtLuaGetLastError(sErr)
EgtOutLog(sErr)
End If
End If
Next
Return True
End Function
Private Function ResetLuaVariables() As Boolean
EgtLuaResetGlobVar(LUA_CMP_VARS)
EgtLuaResetGlobVar(LUA_CMP_DRAW)
Return False
End Function
Private Function MakePreview(ByRef sMsg As String) As Boolean
If Not EgtLuaExecLine(LUA_CMP_DRAW & "(true)") Then
sMsg = "Error in component execution"
m_bDrawOk = False
Else
EgtLuaGetGlobStringVar(LUA_CMP_VARS & ".MSG", sMsg)
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar(LUA_CMP_VARS & ".ERR", nErr)
m_bDrawOk = (nErr = 0)
End If
Return m_bDrawOk
End Function
Private Function MakeInsert(ByVal nNbr As Integer) As Boolean
' abilito registrazione
EgtEnableCommandLogger()
' ricarico componente corrente
ExecCompoFile()
' aggiorno variabili
UpdateVariables()
' elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' eseguo inserimento
For i As Integer = 1 To nNbr
' Inserisco il componente
If Not EgtLuaExecLine(LUA_CMP_DRAW & "(false)") Then
Dim sErr As String = String.Empty
EgtLuaGetLastError(sErr)
EgtOutLog(sErr)
Exit For
End If
' Ne recupero l'Id
Dim nId2 As Integer = EgtGetLastPart()
' Lo posiziono in ordine
EgtPackPart(nId2, PACK_MAX_X, PACK_OFFS)
Next
' disabilito registrazione
EgtDisableCommandLogger()
Return True
End Function
Private Function GetNameEdit(ByVal nInd As Integer) As Label
Select Case nInd
Case 1
Return Label1
Case 2
Return Label2
Case 3
Return Label3
Case Else
Return Label4
End Select
End Function
Private Function GetValueEdit(ByVal nInd As Integer) As TextBox
Select Case nInd
Case 1
Return TextBox1
Case 2
Return TextBox2
Case 3
Return TextBox3
Case Else
Return TextBox4
End Select
End Function
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
'Istruzioni per chiudere DrawPageUC e aprire PlacePage UC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
m_MainWindow.DrawBtn.IsChecked = False
m_MainWindow.PlaceBtn.IsChecked = True
End Sub
Private Sub DrawPage_Unloaded(sender As Object, e As RoutedEventArgs)
' Pulisco l'ambiente lua
ResetLuaVariables()
End Sub
Private Class CompoVar
' Public Members
Public m_nInd As Integer
Public m_sName As String
Public m_nType As Integer
Public m_bVal As Boolean
Public m_nVal As Integer
Public m_dVal As Double
Public m_sVal As String
' Constants
Const LUA_NAME As String = LUA_CMP_VARS & ".N"
Const LUA_TYPE As String = LUA_CMP_VARS & ".T"
Const LUA_VALUE As String = LUA_CMP_VARS & ".V"
Public Sub New()
m_nInd = 0
m_nType = 0
End Sub
Public Overrides Function ToString() As String
Select Case m_nType
Case 1 ' booleano
Return m_bVal.ToString()
Case 2 ' intero
Return m_nVal.ToString()
Case 3 ' lunghezza
Return EgtToUiUnits(m_dVal).ToString("F0", CultureInfo.InvariantCulture)
Case 4 ' double
Return m_dVal.ToString("F0", CultureInfo.InvariantCulture)
Case 5 ' stringa
Return m_sVal
End Select
Return ""
End Function
Public Function FromString(ByVal sVal As String) As Boolean
Select Case m_nType
Case 1 ' booleano
Dim bVal As Boolean = False
If Boolean.TryParse(sVal, bVal) Then
m_bVal = bVal
Return True
End If
Case 2 ' intero
Dim dVal As Double
If EgtLuaEvalNumExpr(sVal, dVal) Then
m_nVal = CInt(dVal)
Return True
End If
Case 3 ' lunghezza
Dim dVal As Double
If EgtLuaEvalNumExpr(sVal, dVal) Then
m_dVal = EgtFromUiUnits(dVal)
Return True
End If
Case 4 ' double
Dim dVal As Double
If EgtLuaEvalNumExpr(sVal, dVal) Then
m_dVal = dVal
Return True
End If
Case 5 'stringa
m_sVal = sVal
Return True
End Select
Return False
End Function
Public Function ToLua() As Boolean
Select Case m_nType
Case 1
Return EgtLuaSetGlobBoolVar(LUA_VALUE & m_nInd.ToString(), m_bVal)
Case 2
Return EgtLuaSetGlobIntVar(LUA_VALUE & m_nInd.ToString(), m_nVal)
Case 3, 4
Return EgtLuaSetGlobNumVar(LUA_VALUE & m_nInd.ToString(), m_dVal)
Case 5
Return EgtLuaSetGlobStringVar(LUA_VALUE & m_nInd.ToString(), m_sVal)
End Select
Return False
End Function
Public Function FromLua() As Boolean
Select Case m_nType
Case 1
Return EgtLuaGetGlobBoolVar(LUA_VALUE & m_nInd.ToString(), m_bVal)
Case 2
Return EgtLuaGetGlobIntVar(LUA_VALUE & m_nInd.ToString(), m_nVal)
Case 3, 4
Return EgtLuaGetGlobNumVar(LUA_VALUE & m_nInd.ToString(), m_dVal)
Case 5
Return EgtLuaGetGlobStringVar(LUA_VALUE & m_nInd.ToString(), m_sVal)
End Select
Return False
End Function
Public Function NameTypeValueFromLua() As Boolean
Dim bOk As Boolean = True
bOk = bOk AndAlso EgtLuaGetGlobStringVar(LUA_NAME & m_nInd.ToString(), m_sName)
bOk = bOk AndAlso EgtLuaGetGlobIntVar(LUA_TYPE & m_nInd.ToString(), m_nType)
Return bOk AndAlso FromLua()
End Function
End Class
End Class
+43
View File
@@ -0,0 +1,43 @@
<UserControl x:Class="ImportPageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="704" d:DesignWidth="1024" Initialized="ImportPage_Initialized" Loaded="ImportPage_Loaded" Unloaded="ImportPage_Unloaded">
<!-- Chiamata al Dictionary -->
<UserControl.Resources>
<ResourceDictionary Source="SarmaxWallDictionary.xaml"/>
</UserControl.Resources>
<!-- Definizione della ImportPage -->
<Grid Name="ImportPageGrid" Background="Blue">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Name="FilePathTxBl" Background="White"/>
<ListBox Name="FileListBox" Grid.Row="1" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Grid.Column="1" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Content="V" />
<Button Name="ExitBtn" Grid.Column="2" Content="X" />
</Grid>
</Grid>
</UserControl>
+276
View File
@@ -0,0 +1,276 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Public Class ImportPageUC
'Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
' Properties
Private m_sCurrDir As String = String.Empty
Private m_sCurrFile As String = String.Empty
Private m_nFileType As Integer = FT.NULL
Private m_bFirst As Boolean = True
'Dichiarazione lista per ListBox
'Private ItemList As New ObservableCollection(Of IconListBoxItem)
'Dichiarazione Scene
Friend Shared WithEvents ImportScene As New Scene
Dim ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private Sub ImportPage_Initialized(sender As Object, e As EventArgs)
'Assegnazione scena all'host e posizionamento nella ImportPageGrid
ImportSceneHost.Child = ImportScene
ImportSceneHost.SetValue(Grid.ColumnProperty, 1)
ImportSceneHost.SetValue(Grid.RowProperty, 0)
ImportSceneHost.SetValue(Grid.RowSpanProperty, 2)
Me.ImportPageGrid.Children.Add(ImportSceneHost)
'Definizione del collegamento tra ItemList e ListBox1
FileListBox.ItemsSource = m_MainWindow.ItemList
End Sub
Private Sub ImportPage_Loaded(sender As Object, e As RoutedEventArgs)
If m_bFirst Then
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
ImportScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
ImportScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
ImportScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
ImportScene.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, m_MainWindow.GetIniFile())
ImportScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
ImportScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
ImportScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
'Inizializzazione delle viste
ImportScene.Init()
ClearView()
' leggo direttorio corrente
GetPrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, "", m_sCurrDir, m_MainWindow.GetIniFile())
' lo carico
LoadCurrDir()
m_bFirst = False
Else
EgtSetCurrentContext(ImportScene.GetCtx())
End If
'' leggo direttorio corrente
'GetPrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, "", m_sCurrDir, m_MainWindow.GetIniFile())
'' lo carico
'LoadCurrDir()
End Sub
Private Function LoadCurrDir() As Boolean
' se direttorio corrente non valido, carico l'elenco dei dischi
If String.IsNullOrWhiteSpace(m_sCurrDir) OrElse Not IO.Directory.Exists(m_sCurrDir) Then
Return LoadDisks()
End If
' lo visualizzo
FilePathTxBl.Text = m_sCurrDir
' pulisco la lista
m_MainWindow.ItemList.Clear()
' per risalire al direttorio padre
m_MainWindow.ItemList.Add(New IconListBoxItem("..", 0))
' elenco dei sottodirettori
Dim DirInfo As New DirectoryInfo(m_sCurrDir)
Dim vDirI As DirectoryInfo() = DirInfo.GetDirectories("*")
Dim DirI As DirectoryInfo
For Each DirI In vDirI
If (DirI.Attributes And FileAttributes.Hidden) <> FileAttributes.Hidden Then
m_MainWindow.ItemList.Add(New IconListBoxItem(DirI.Name, 2))
End If
Next
' elenco dei file
Dim vFileI As FileInfo() = DirInfo.GetFiles()
Dim FileI As FileInfo
For Each FileI In vFileI
Dim sExt As String = Path.GetExtension(FileI.Name).ToUpper()
If sExt = ".BTL" Then
m_MainWindow.ItemList.Add(New IconListBoxItem(FileI.Name, 3))
End If
Next
' pulisco la vista
ClearView()
Return True
End Function
Private Function LoadDisks() As Boolean
' dir corrente vuoto
m_sCurrDir = ""
' lo visualizzo
FilePathTxBl.Text = m_sCurrDir
' pulisco la lista
m_MainWindow.ItemList.Clear()
' elenco dei dischi
Dim vDriI As DriveInfo() = DriveInfo.GetDrives()
Dim DriI As DriveInfo
For Each DriI In vDriI
m_MainWindow.ItemList.Add(New IconListBoxItem(DriI.Name, 1))
Next
' pulisco la vista
ClearView()
Return True
End Function
Private Sub FileListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles FileListBox.PreviewMouseUp
' Recupero item selezionato
If FileListBox.SelectedItems.Count() = 0 Then
Return
End If
Dim vItems As IconListBoxItem = FileListBox.SelectedItems(0)
' A seconda del tipo
Select Case vItems.PictureID
Case 0 ' Vai nel direttorio padre
m_sCurrDir = IO.Path.GetDirectoryName(m_sCurrDir)
m_sCurrFile = ""
LoadCurrDir()
'ListBox1.Items(0).Selected = True
'ListBox1.Items(0).Focused = True
Case 1 ' Vai nella radice del disco
m_sCurrDir = vItems.Name
m_sCurrFile = ""
LoadCurrDir()
'ListBox1.Items(0).Selected = True
'ListBox1.Items(0).Focused = True
Case 2 ' Vai nel sottodirettorio
m_sCurrDir = IO.Path.Combine(m_sCurrDir, vItems.Name)
m_sCurrFile = ""
LoadCurrDir()
'ListBox1.Items(0).Selected = True
'ListBox1.Items(0).Focused = True
Case 3 ' File
m_sCurrFile = vItems.Name
LoadCurrFile()
End Select
End Sub
Private Sub FileListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles FileListBox.SelectionChanged
' Recupero item selezionato
If FileListBox.SelectedItems.Count() = 0 Then
Return
End If
Dim vItems As IconListBoxItem = FileListBox.SelectedItems(0)
' Gestisco solo aggiornamento visualizzazione file
If vItems.PictureID = 3 Then
m_sCurrFile = vItems.Name
LoadCurrFile()
End If
End Sub
Private Function ClearView() As Boolean
' Pulisco il DB geometrico locale
EgtNewFile()
' Eseguo zoom
ImportScene.ZoomAll()
Return True
End Function
Private Function LoadCurrFile() As Boolean
' Pulisco il DB geometrico locale
Dim bOk As Boolean = EgtNewFile()
' Costruisco path completa del componente
Dim sPath = IO.Path.Combine(m_sCurrDir, m_sCurrFile)
' Riconoscimento tipo
m_nFileType = EgtGetFileType(sPath)
If m_nFileType = FT.BTL Then
' Carico Btl
bOk = bOk AndAlso EgtImportBtl(sPath, True)
Else
' Formato sconosciuto
EgtNewFile()
bOk = False
End If
' Eseguo zoom
ImportScene.ZoomAll()
Return bOk
End Function
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
'Istruzioni per chiudere ImportPageUC e aprire PlacePage UC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_ImportPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
m_MainWindow.ImportBtn.IsChecked = False
m_MainWindow.PlaceBtn.IsChecked = True
End Sub
Private Sub ImportPage_Unloaded(sender As Object, e As RoutedEventArgs)
' Salvo direttorio corrente
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
End Sub
End Class
Public Class IconListBoxItem
Private m_iPictureID As Integer
Private m_sName As String
Public Property PictureID() As Integer
Get
Return m_iPictureID
End Get
Set(value As Integer)
m_iPictureID = value
End Set
End Property
Public Property Name() As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Public ReadOnly Property PictureString() As String
Get
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
End Get
End Property
Sub New()
Me.Name = String.Empty
Me.PictureID = 0
End Sub
Sub New(Name As String, PictureID As Integer)
Me.Name = Name
Me.PictureID = PictureID
End Sub
End Class
+40
View File
@@ -0,0 +1,40 @@
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="768" Width="1024" ResizeMode="NoResize"
Initialized="MainWindow_Initialized" Loaded="MainWindow_Loaded" WindowStyle="None" PreviewMouseDown="MainWindow_PreviewMouseDown" >
<!-- ** Definizione della Grid della MainWindow ** -->
<Grid Name="MainWindowGrid">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="11*"/>
</Grid.RowDefinitions>
<!-- ** Definizione della Grid dei Tab ** -->
<Grid Name="TabGrid" Grid.Column="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="ImportBtn" Grid.Column="1" />
<ToggleButton Name="DrawBtn" Grid.Column="2" />
<ToggleButton Name="PlaceBtn" Grid.Column="3" />
<ToggleButton Name="OptionsBtn" Grid.Column="4" />
<Button Content="X" Grid.Column="7" Click="ExitBtn_Click" />
</Grid>
</Grid>
</Window>
+230
View File
@@ -0,0 +1,230 @@
Imports System.Collections.ObjectModel
Imports System.Windows.Threading
Imports EgtUILib
Class MainWindow
'Dichiarazione delle Page UserControl
Friend m_ImportPageUC As ImportPageUC
Friend m_DrawPageUC As DrawPageUC
Friend m_PlacePageUC As PlacePageUC
Friend m_OptionsPageUC As OptionsPageUC
Friend m_NumericKeyboardWD As NumericKeyboardWD
'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 Shared m_sIniFile As String = String.Empty
Private m_nDebug As Integer = 0
'Dichiarazione lista per ListBox della ImportPage
Friend ItemList As New ObservableCollection(Of IconListBoxItem)
'Riferimento alla pagina correntemente attiva
Friend m_ActivePage As Pages
Enum Pages
Import
Draw
Place
Options
End Enum
Dim OpenTimer As New DispatcherTimer
Dim OpenTimer2 As New DispatcherTimer
Public Function GetIniFile() As String
Return m_sIniFile
End Function
Private Sub MainWindow_Initialized(sender As Object, e As EventArgs)
' Impostazione path radice per i dati
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory.Substring(0, System.AppDomain.CurrentDomain.BaseDirectory.Length - 1)
If GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory.Substring(0, System.AppDomain.CurrentDomain.BaseDirectory.Length - 1)
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
' 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 file messaggi
Dim sMsgFile As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgFile, m_sIniFile)
Dim sMsgFilePath As String = m_sConfigDir & "\" & sMsgFile
If Not EgtLoadMessages(sMsgFilePath) Then
EgtOutLog("Error in EgtLoadMessages")
End If
' imposto dir font Nfe e font default
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)
' 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)
'Creazione delle Page UserControl
m_ImportPageUC = New ImportPageUC
m_DrawPageUC = New DrawPageUC
m_PlacePageUC = New PlacePageUC
m_OptionsPageUC = New OptionsPageUC
m_NumericKeyboardWD = New NumericKeyboardWD
'Posizionemento nella griglia delle Page UserControl
m_ImportPageUC.SetValue(Grid.ColumnProperty, 0)
m_ImportPageUC.SetValue(Grid.RowProperty, 1)
m_DrawPageUC.SetValue(Grid.ColumnProperty, 0)
m_DrawPageUC.SetValue(Grid.RowProperty, 1)
m_PlacePageUC.SetValue(Grid.ColumnProperty, 0)
m_PlacePageUC.SetValue(Grid.RowProperty, 1)
m_OptionsPageUC.SetValue(Grid.ColumnProperty, 0)
m_OptionsPageUC.SetValue(Grid.RowProperty, 1)
'Imposto i messaggi letti dal file dei messaggi
ImportBtn.Content = EgtMsg(MSG_GENERAL + 1) 'Import - Importa
DrawBtn.Content = EgtMsg(MSG_GENERAL + 2) 'Draw - Disegna
PlaceBtn.Content = EgtMsg(MSG_GENERAL + 3) 'Place - Posiziona
OptionsBtn.Content = EgtMsg(MSG_GENERAL + 4) 'Options - Opzioni
'AddHandler OpenTimer.Tick, AddressOf OpenTimer_tick
'OpenTimer.Interval = TimeSpan.FromMilliseconds(1)
'OpenTimer.Start()
'AddHandler OpenTimer2.Tick, AddressOf OpenTimer2_tick
'OpenTimer2.Interval = TimeSpan.FromMilliseconds(2)
'OpenTimer2.Start()
End Sub
Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs)
'Assegno la NumericKeyboardWD come child della MainWindow
m_NumericKeyboardWD.Owner = Me
'Seleziono la Tab e la Page di apertura
MainWindowGrid.Children.Add(m_PlacePageUC)
m_ActivePage = Pages.Place
PlaceBtn.IsChecked = True
End Sub
Private Sub OpenTimer_tick(ByVal sender As Object, ByVal e As EventArgs)
'DrawBtn.RaiseEvent(New RoutedEventArgs(Button.ClickEvent))
'OpenTimer.Stop()
End Sub
Private Sub OpenTimer2_tick(ByVal sender As Object, ByVal e As EventArgs)
'm_DrawPageUC.ExitBtn.RaiseEvent(New RoutedEventArgs(Button.ClickEvent))
'OpenTimer2.Stop()
End Sub
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
Select Case m_ActivePage
Case Pages.Import
ImportBtn.IsChecked = True
Case Pages.Draw
ImportBtn.IsChecked = False
DrawBtn.IsChecked = True
Case Pages.Place
ImportBtn.IsChecked = True
PlaceBtn.IsChecked = False
MainWindowGrid.Children.Remove(m_PlacePageUC)
MainWindowGrid.Children.Add(m_ImportPageUC)
m_ActivePage = Pages.Import
Case Pages.Options
ImportBtn.IsChecked = False
OptionsBtn.IsChecked = True
End Select
End Sub
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
Select Case m_ActivePage
Case Pages.Import
ImportBtn.IsChecked = True
DrawBtn.IsChecked = False
Case Pages.Draw
DrawBtn.IsChecked = True
Case Pages.Place
DrawBtn.IsChecked = True
PlaceBtn.IsChecked = False
MainWindowGrid.Children.Remove(m_PlacePageUC)
MainWindowGrid.Children.Add(m_DrawPageUC)
m_ActivePage = Pages.Draw
Case Pages.Options
DrawBtn.IsChecked = False
OptionsBtn.IsChecked = True
End Select
End Sub
Private Sub PlaceBtn_Click(sender As Object, e As RoutedEventArgs) Handles PlaceBtn.Click
Select Case m_ActivePage
Case Pages.Import
ImportBtn.IsChecked = True
PlaceBtn.IsChecked = False
Case Pages.Draw
DrawBtn.IsChecked = True
PlaceBtn.IsChecked = False
Case Pages.Place
PlaceBtn.IsChecked = True
Case Pages.Options
PlaceBtn.IsChecked = False
OptionsBtn.IsChecked = True
End Select
End Sub
Private Sub OptionsBtn_Click(sender As Object, e As RoutedEventArgs) Handles OptionsBtn.Click
Select Case m_ActivePage
Case Pages.Import
ImportBtn.IsChecked = True
OptionsBtn.IsChecked = False
Case Pages.Draw
DrawBtn.IsChecked = True
OptionsBtn.IsChecked = False
Case Pages.Place
OptionsBtn.IsChecked = True
PlaceBtn.IsChecked = False
MainWindowGrid.Children.Remove(m_PlacePageUC)
MainWindowGrid.Children.Add(m_OptionsPageUC)
m_ActivePage = Pages.Options
Case Pages.Options
OptionsBtn.IsChecked = True
End Select
End Sub
'Impedisce di clickare fuori dalla calcolatrice quando questa è attiva
Private Sub MainWindow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If (m_NumericKeyboardWD.IsVisible And Not m_NumericKeyboardWD.IsMouseOver) Then
e.Handled = True
End If
End Sub
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
Me.Close()
End Sub
End Class
+36
View File
@@ -0,0 +1,36 @@
<Window x:Class="MissingKeyWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MissingKeyWD" Height="300" Width="450" Initialized="MissingKeyWD_Initialized" WindowStyle="None" ShowInTaskbar="False" ResizeMode="NoResize">
<Border BorderBrush="Black" BorderThickness="1">
<!-- ** Definizione della Grid della MissingKeyWindow ** -->
<Grid Name="MissingKeyGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="8*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="ErrorLbl" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="Red" FontSize="25" />
<Label Name="MissingKeyLbl" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<Label Name="InsertKeyLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18" />
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="5" FontSize="18"/>
</Grid>
</Border>
</Window>
+18
View File
@@ -0,0 +1,18 @@
Imports EgtUILib
Public Class MissingKeyWD
Private Sub MissingKeyWD_Initialized(sender As Object, e As EventArgs)
'Imposto i messaggi letti dal file dei messaggi
ErrorLbl.Content = EgtMsg(MSG_MISSINGKEYWD + 1) 'Error! - Errore
MissingKeyLbl.Content = EgtMsg(MSG_MISSINGKEYWD + 2) 'Missing key - Chiave non presente
InsertKeyLbl.Content = EgtMsg(MSG_MISSINGKEYWD + 3) 'Insert it and reload program - Inserirla e riavviare il programma
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
Close()
End Sub
End Class
+59
View File
@@ -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
<Assembly: AssemblyTitle("SarmaxWall")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("SarmaxWall")>
<Assembly: AssemblyCopyright("Copyright © 2015")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
'In order to begin building localizable applications, set
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
'inside a <PropertyGroup>. For example, if you are using US english
'in your source files, set the <UICulture> 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.
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
'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)
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("0a0139d7-41a2-4c69-9b2e-fd8cb4680929")>
' 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:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.6.9.1")>
<Assembly: AssemblyFileVersion("1.6.9.1")>
+121
View File
@@ -0,0 +1,121 @@
#If _MyType <> "Empty" Then
Namespace My
''' <summary>
''' Module used to define the properties that are available in the My Namespace for WPF
''' </summary>
''' <remarks></remarks>
<Global.Microsoft.VisualBasic.HideModuleName()> _
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)
''' <summary>
''' Returns the application object for the running application
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Application() As Application
Get
Return CType(Global.System.Windows.Application.Current, Application)
End Get
End Property
''' <summary>
''' Returns information about the host computer.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
Get
Return s_Computer.GetInstance()
End Get
End Property
''' <summary>
''' Returns information for the current user. If you wish to run the application with the current
''' Windows user credentials, call My.User.InitializeWithWindowsUser().
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
Get
Return s_User.GetInstance()
End Get
End Property
''' <summary>
''' Returns the application log. The listeners can be configured by the application's configuration file.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
Get
Return s_Log.GetInstance()
End Get
End Property
''' <summary>
''' Returns the collection of Windows defined in the project.
''' </summary>
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
Friend ReadOnly Property Windows() As MyWindows
<Global.System.Diagnostics.DebuggerHidden()> _
Get
Return s_Windows.GetInstance()
End Get
End Property
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")> _
Friend NotInheritable Class MyWindows
<Global.System.Diagnostics.DebuggerHidden()> _
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
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
<Global.System.Diagnostics.DebuggerHidden()> _
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
instance = Nothing
End Sub
<Global.System.Diagnostics.DebuggerHidden()> _
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Public Sub New()
MyBase.New()
End Sub
<Global.System.ThreadStatic()> Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function Equals(ByVal o As Object) As Boolean
Return MyBase.Equals(o)
End Function
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function GetHashCode() As Integer
Return MyBase.GetHashCode
End Function
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> _
Friend Overloads Function [GetType]() As Global.System.Type
Return GetType(MyWindows)
End Function
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> 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
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
<Global.System.Diagnostics.DebuggerHidden()> _
Get
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
End Get
End Property
End Class
#End If
+63
View File
@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
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.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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("SarmaxWall.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+71
View File
@@ -0,0 +1,71 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.SarmaxWall.MySettings
Get
Return Global.SarmaxWall.MySettings.Default
End Get
End Property
End Module
End Namespace
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+68
View File
@@ -0,0 +1,68 @@
<Window x:Class="NumericKeyboardWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="NumericKeyboardWD" Height="768" Width="1024" Background="Transparent" ResizeMode="NoResize"
ShowInTaskbar="False" AllowsTransparency="True" WindowStyle="None" IsVisibleChanged="NumericKeyboardWD_IsVisibleChanged" Unloaded="NumericKeyboardWD_Unloaded" KeyDown="NumericKeyboardWD_KeyDown">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Border Grid.Row="2" Grid.Column="2" BorderBrush="Black" BorderThickness="0">
<Grid Grid.Row="2" Grid.Column="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="Lato A" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5"
FontSize="25" Name="NumericKeyboardWDTitle" />
<TextBox Text="100" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5"
TextAlignment="Right" FontSize="25" Name="NumericKeyboardWDTextBox" />
<Button Content="7" Grid.Row="2" Grid.Column="0" FontSize="40" Click="Btn7WD_Click" />
<Button Content="8" Grid.Row="2" Grid.Column="1" FontSize="40" Click="Btn8WD_Click" />
<Button Content="9" Grid.Row="2" Grid.Column="2" FontSize="40" Click="Btn9WD_Click" />
<Button Content="+" Grid.Row="2" Grid.Column="3" FontSize="40" Click="BtnPlusWD_Click" />
<Button Content="!-" Grid.Row="2" Grid.Column="4" FontSize="40" Click="BtnDeleteWD_Click" />
<Button Content="4" Grid.Row="3" Grid.Column="0" FontSize="40" Click="Btn4WD_Click" />
<Button Content="5" Grid.Row="3" Grid.Column="1" FontSize="40" Click="Btn5WD_Click" />
<Button Content="6" Grid.Row="3" Grid.Column="2" FontSize="40" Click="Btn6WD_Click" />
<Button Content="-" Grid.Row="3" Grid.Column="3" FontSize="40" Click="BtnMinusWD_Click" />
<Button Content="C" Grid.Row="3" Grid.Column="4" FontSize="40" Click="BtnCancelWD_Click" />
<Button Content="1" Grid.Row="4" Grid.Column="0" FontSize="40" Click="Btn1WD_Click" />
<Button Content="2" Grid.Row="4" Grid.Column="1" FontSize="40" Click="Btn2WD_Click" />
<Button Content="3" Grid.Row="4" Grid.Column="2" FontSize="40" Click="Btn3WD_Click" />
<Button Content="*" Grid.Row="4" Grid.Column="3" FontSize="40" Click="BtnMultiplicationWD_Click" />
<Button Content="X" Grid.Row="4" Grid.Column="4" FontSize="40" Click="BtnExitWD_Click" />
<Button Content="0" Grid.Row="5" Grid.Column="0" FontSize="40" Click="Btn0WD_Click"/>
<Button Content="." Grid.Row="5" Grid.Column="1" FontSize="40" Click="BtnDotWD_Click" />
<Button Content="=" Grid.Row="5" Grid.Column="2" FontSize="40" Click="BtnEvaluateWD_Click" />
<Button Content="/" Grid.Row="5" Grid.Column="3" FontSize="40" Click="BtnDivisionWD_Click" />
<Button Content="V" Grid.Row="5" Grid.Column="4" FontSize="40" Click="BtnApplyWD_Click" />
</Grid>
</Border>
</Grid>
</Window>
+130
View File
@@ -0,0 +1,130 @@
Imports System.Globalization
Public Class NumericKeyboardWD
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
Public m_CurrentTxBx As TextBox
Public m_CurrentLbl As String = String.Empty
Dim m_bErrorState As Boolean = False
Private Sub NumericKeyboardWD_IsVisibleChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
If Me.IsVisible Then
NumericKeyboardWDTextBox.Text = m_CurrentTxBx.Text
NumericKeyboardWDTitle.Text = m_CurrentLbl
End If
End Sub
Private Sub NumericKeyboardWD_Unloaded(sender As Object, e As RoutedEventArgs)
MainWindowUC.Focus()
End Sub
Private Sub NumericKeyboardWD_KeyDown(sender As Object, e As KeyEventArgs)
If (e.Key = Key.Enter) Then
Visibility = Windows.Visibility.Hidden
End If
End Sub
Private Sub Btn0WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "0"
End Sub
Private Sub Btn1WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "1"
End Sub
Private Sub Btn2WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "2"
End Sub
Private Sub Btn3WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "3"
End Sub
Private Sub Btn4WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "4"
End Sub
Private Sub Btn5WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "5"
End Sub
Private Sub Btn6WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "6"
End Sub
Private Sub Btn7WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "7"
End Sub
Private Sub Btn8WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "8"
End Sub
Private Sub Btn9WD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "9"
End Sub
Private Sub BtnDotWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "."
End Sub
Private Sub BtnEvaluateWD_Click(sender As Object, e As RoutedEventArgs)
Evaluate()
End Sub
Private Sub BtnPlusWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "+"
End Sub
Private Sub BtnMinusWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "-"
End Sub
Private Sub BtnMultiplicationWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "*"
End Sub
Private Sub BtnDivisionWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text &= "/"
End Sub
Private Sub BtnDeleteWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text = NumericKeyboardWDTextBox.Text.Substring(0, NumericKeyboardWDTextBox.Text.Length - 1)
End Sub
Private Sub BtnCancelWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text = String.Empty
End Sub
Private Sub BtnExitWD_Click(sender As Object, e As RoutedEventArgs)
NumericKeyboardWDTextBox.Text = String.Empty
Visibility = Windows.Visibility.Hidden
End Sub
Private Sub BtnApplyWD_Click(sender As Object, e As RoutedEventArgs)
Evaluate()
If m_bErrorState Then
Else
m_CurrentTxBx.Text = NumericKeyboardWDTextBox.Text
NumericKeyboardWDTextBox.Text = String.Empty
Visibility = Windows.Visibility.Hidden
End If
End Sub
Private Sub Evaluate()
Dim DoubleResult As Double = 0
Dim bOk As Boolean = EgtUILib.EgtLuaEvalNumExpr(NumericKeyboardWDTextBox.Text, DoubleResult)
If (bOk) Then
NumericKeyboardWDTextBox.Text = DoubleResult.ToString(CultureInfo.InvariantCulture)
If m_bErrorState Then
m_bErrorState = False
NumericKeyboardWDTitle.Text = m_CurrentLbl
End If
Else
m_bErrorState = True
NumericKeyboardWDTitle.Text &= " ESPRESSIONE ERRATA"
End If
End Sub
End Class
+33
View File
@@ -0,0 +1,33 @@
<UserControl x:Class="OptionsPageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="704" d:DesignWidth="1024" >
<!-- Definizione della ImportPage -->
<Grid Name="OptionsPageGrid" Background="Yellow">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Grid.Column="1" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Content="V" />
<Button Name="ExitBtn" Grid.Column="2" Content="X" />
</Grid>
</Grid>
</UserControl>
+14
View File
@@ -0,0 +1,14 @@
Public Class OptionsPageUC
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
'Istruzioni per chiudere OptionsPageUC e aprire PlacePage UC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OptionsPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
m_MainWindow.OptionsBtn.IsChecked = False
m_MainWindow.PlaceBtn.IsChecked = True
End Sub
End Class
+35
View File
@@ -0,0 +1,35 @@
<UserControl x:Class="PlacePageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="704" d:DesignWidth="1024" Initialized="PlacePage_Initialized" Loaded="PlacePage_Loaded">
<!-- Definizione della PlacePage -->
<Grid Name="PlacePageGrid" Background="Green" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid Inferiore per i Button Genera e Trasmetti -->
<Grid Grid.Column="2" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="8*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="GenerateBtn" Grid.Column="1" />
<Button Name="SendBtn" Grid.Column="2" />
</Grid>
</Grid>
</UserControl>
+90
View File
@@ -0,0 +1,90 @@
Imports EgtUILib
Public Class PlacePageUC
'Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
' Properties
Private m_bFirst As Boolean = True
'Dichiarazione Scene
Friend Shared WithEvents PlaceScene As New Scene
Dim PlaceSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private Sub PlacePage_Initialized(sender As Object, e As EventArgs)
'Assegnazione scena all'host e posizionamento nella PlacePageGrid
PlaceSceneHost.Child = PlaceScene
PlaceSceneHost.SetValue(Grid.ColumnProperty, 2)
PlaceSceneHost.SetValue(Grid.RowProperty, 0)
Me.PlacePageGrid.Children.Add(PlaceSceneHost)
'Imposto i messaggi letti dal file dei messaggi
GenerateBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 1) 'Generate - Genera
SendBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 2) 'Send - Trasmetti
End Sub
Private Sub PlacePage_Loaded(sender As Object, e As RoutedEventArgs)
If (Not m_bFirst) Then
EgtSetCurrentContext(PlaceScene.GetCtx())
Return
End If
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, m_MainWindow.GetIniFile())
PlaceScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, m_MainWindow.GetIniFile())
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, m_MainWindow.GetIniFile())
PlaceScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
PlaceScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
PlaceScene.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, m_MainWindow.GetIniFile())
PlaceScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, m_MainWindow.GetIniFile())
PlaceScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, m_MainWindow.GetIniFile())
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, m_MainWindow.GetIniFile()) <> 0)
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, m_MainWindow.GetIniFile())
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
PlaceScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
If Not PlaceScene.Init() Then
Dim m_MissingKeyWindow As New MissingKeyWD
m_MissingKeyWindow.Top = m_MainWindow.Top + (m_MainWindow.Height / 2 - m_MissingKeyWindow.Height / 2)
m_MissingKeyWindow.Left = m_MainWindow.Left + (m_MainWindow.Width / 2 - m_MissingKeyWindow.Width / 2)
m_MainWindow.Close()
m_MissingKeyWindow.Show()
End If
' inibisco selezione diretta da Scene
PlaceScene.SetStatusNull()
m_bFirst = False
End Sub
Private Sub GenerateBtn_Click(sender As Object, e As RoutedEventArgs) Handles GenerateBtn.Click
End Sub
Private Sub SendBtn_Click(sender As Object, e As RoutedEventArgs) Handles SendBtn.Click
End Sub
End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

+22
View File
@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SarmaxWall", "SarmaxWall.vbproj", "{663060E0-0E4B-46AF-A8D0-023811AE8DC5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{663060E0-0E4B-46AF-A8D0-023811AE8DC5}.Debug|x86.ActiveCfg = Debug|x86
{663060E0-0E4B-46AF-A8D0-023811AE8DC5}.Debug|x86.Build.0 = Debug|x86
{663060E0-0E4B-46AF-A8D0-023811AE8DC5}.Release|x86.ActiveCfg = Release|x86
{663060E0-0E4B-46AF-A8D0-023811AE8DC5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+230
View File
@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{663060E0-0E4B-46AF-A8D0-023811AE8DC5}</ProjectGuid>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<OutputType>WinExe</OutputType>
<RootNamespace>SarmaxWall</RootNamespace>
<AssemblyName>SarmaxWall</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MyType>Custom</MyType>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>true</IncrementalBuild>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>SarmaxWall.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>false</DebugSymbols>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<IncrementalBuild>false</IncrementalBuild>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>SarmaxWall.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Debug\</OutputPath>
<DocumentationFile>SarmaxWall.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DefineTrace>false</DefineTrace>
<OutputPath>bin\x86\Release\</OutputPath>
<DocumentationFile>SarmaxWall.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RemoveIntegerChecks>true</RemoveIntegerChecks>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib">
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="Application.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="ConstGen.vb" />
<Compile Include="ConstIni.vb" />
<Compile Include="ConstMsg.vb" />
<Compile Include="MissingKeyWD.xaml.vb">
<DependentUpon>MissingKeyWD.xaml</DependentUpon>
</Compile>
<Compile Include="NumericKeyboardWD.xaml.vb">
<DependentUpon>NumericKeyboardWD.xaml</DependentUpon>
</Compile>
<Compile Include="OptionsPageUC.xaml.vb">
<DependentUpon>OptionsPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="PlacePageUC.xaml.vb">
<DependentUpon>PlacePageUC.xaml</DependentUpon>
</Compile>
<Compile Include="SarmaxWallDictionary.xaml.vb">
<DependentUpon>SarmaxWallDictionary.xaml</DependentUpon>
</Compile>
<Page Include="DrawPageUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ImportPageUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="Application.xaml.vb">
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="DrawPageUC.xaml.vb">
<DependentUpon>DrawPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="ImportPageUC.xaml.vb">
<DependentUpon>ImportPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="MainWindow.xaml.vb">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="MissingKeyWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="NumericKeyboardWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionsPageUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PlacePageUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SarmaxWallDictionary.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Data" />
<Import Include="System.Windows.Documents" />
<Import Include="System.Windows.Input" />
<Import Include="System.Windows.Shapes" />
<Import Include="System.Windows.Media" />
<Import Include="System.Windows.Media.Imaging" />
<Import Include="System.Windows.Navigation" />
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb">
<SubType>Code</SubType>
</Compile>
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb">
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID>
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
</EmbeddedResource>
<None Include="app.config" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<AppDesigner Include="My Project\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ImportPageListBoxImages\0.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ImportPageListBoxImages\1.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ImportPageListBoxImages\2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ImportPageListBoxImages\3.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\SarmaxWall\SarmaxWallR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\SarmaxWall\SarmaxWallD32.exe</PostBuildEvent>
</PropertyGroup>
</Project>
+26
View File
@@ -0,0 +1,26 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SarmaxWallDictionary">
<!-- ** TEXTBOX ** -->
<Style TargetType="{x:Type TextBox}" x:Key="NumericKeyboard">
<Setter Property="IsReadOnly" Value="True"/>
<EventSetter Event="PreviewMouseDown" Handler="PreviewMouseDown"/>
<EventSetter Event="TextChanged" Handler="TextChanged" />
</Style>
<!-- *************************************************************************** -->
<!-- ** LISTBOX ** -->
<DataTemplate x:Key="DataTemplateItem">
<Canvas Width="236" Height="48">
<Image Source="{Binding PictureString}" Height="32" Width="32" Canvas.Left="8" Canvas.Top="8"/>
<TextBlock Text="{Binding Name}" Canvas.Left="56" Canvas.Top="8" Width="172"/>
</Canvas>
</DataTemplate>
<!-- *************************************************************************** -->
</ResourceDictionary>
+27
View File
@@ -0,0 +1,27 @@
Public Class SarmaxWallDictionary
Inherits ResourceDictionary
Dim MainWindowUC As MainWindow = Application.Current.MainWindow
Dim m_NumericKeyboardWD As NumericKeyboardWD
'Evento della TextBox con Style che permette di aprire in automatico la calcolatrice
Private Sub PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
m_NumericKeyboardWD = MainWindowUC.m_NumericKeyboardWD
m_NumericKeyboardWD.m_CurrentTxBx = e.Source
Dim AssocLabel As Label = m_NumericKeyboardWD.m_CurrentTxBx.Tag
If (Not IsNothing(AssocLabel)) Then
m_NumericKeyboardWD.m_CurrentLbl = AssocLabel.Content
End If
m_NumericKeyboardWD.Top = MainWindowUC.Top
m_NumericKeyboardWD.Left = MainWindowUC.Left
m_NumericKeyboardWD.Height = MainWindowUC.Height
m_NumericKeyboardWD.Width = MainWindowUC.Width
m_NumericKeyboardWD.Visibility = Visibility.Visible
End Sub
'Evento della TextBox con Style che permette di aggiornare in automatico il componente con il nuovo valore
Private Sub TextChanged(sender As Object, e As TextChangedEventArgs)
MainWindowUC.m_DrawPageUC.UpdateView()
End Sub
End Class
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>