SarmaxWall :
- Aggiunta OpenPage.
This commit is contained in:
+22
-22
@@ -38,7 +38,7 @@ Public Class ImportPageUC
|
||||
Me.ImportPageGrid.Children.Add(ImportSceneHost)
|
||||
|
||||
'Definizione del collegamento tra ItemList e ListBox1
|
||||
FileListBox.ItemsSource = m_MainWindow.ItemList
|
||||
FileListBox.ItemsSource = m_MainWindow.ImportItemList
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -98,21 +98,21 @@ Public Class ImportPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadGridData()
|
||||
Dim dSnapStep As Double = GetPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nMinLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1, m_MainWindow.GetIniFile())
|
||||
Dim nMajLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nExtSStep As Integer = GetPrivateProfileInt(S_GRID, K_EXTSSTEP, 50, m_MainWindow.GetIniFile())
|
||||
Dim MinLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor, m_MainWindow.GetIniFile())
|
||||
Dim MajLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor, m_MainWindow.GetIniFile())
|
||||
EgtSetGridFrame(Frame3d.GLOB)
|
||||
EgtSetGridGeo(dSnapStep, nMinLineSStep, nMajLineSStep, nExtSStep)
|
||||
EgtSetGridColor(MinLnColor, MajLnColor)
|
||||
Dim bShowGrid As Boolean = (GetPrivateProfileInt(S_GRID, K_SHOWGRID, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
EgtSetGridShow(bShowGrid, False)
|
||||
End Sub
|
||||
Private Sub LoadGridData()
|
||||
Dim dSnapStep As Double = GetPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nMinLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1, m_MainWindow.GetIniFile())
|
||||
Dim nMajLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nExtSStep As Integer = GetPrivateProfileInt(S_GRID, K_EXTSSTEP, 50, m_MainWindow.GetIniFile())
|
||||
Dim MinLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor, m_MainWindow.GetIniFile())
|
||||
Dim MajLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor, m_MainWindow.GetIniFile())
|
||||
EgtSetGridFrame(Frame3d.GLOB)
|
||||
EgtSetGridGeo(dSnapStep, nMinLineSStep, nMajLineSStep, nExtSStep)
|
||||
EgtSetGridColor(MinLnColor, MajLnColor)
|
||||
Dim bShowGrid As Boolean = (GetPrivateProfileInt(S_GRID, K_SHOWGRID, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
EgtSetGridShow(bShowGrid, False)
|
||||
End Sub
|
||||
|
||||
Private Function LoadCurrDir() As Boolean
|
||||
' se direttorio corrente non valido, carico l'elenco dei dischi
|
||||
@@ -124,16 +124,16 @@ Public Class ImportPageUC
|
||||
' lo visualizzo
|
||||
FilePathTxBl.Content = TempPath.ToString
|
||||
' pulisco la lista
|
||||
m_MainWindow.ItemList.Clear()
|
||||
m_MainWindow.ImportItemList.Clear()
|
||||
' per risalire al direttorio padre
|
||||
m_MainWindow.ItemList.Add(New IconListBoxItem("..", 0))
|
||||
m_MainWindow.ImportItemList.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))
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem(DirI.Name, 2))
|
||||
End If
|
||||
Next
|
||||
' elenco dei file
|
||||
@@ -142,7 +142,7 @@ Public Class ImportPageUC
|
||||
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))
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem(FileI.Name, 3))
|
||||
End If
|
||||
Next
|
||||
' pulisco la vista
|
||||
@@ -156,12 +156,12 @@ Public Class ImportPageUC
|
||||
' lo visualizzo
|
||||
FilePathTxBl.Content = m_sCurrDir
|
||||
' pulisco la lista
|
||||
m_MainWindow.ItemList.Clear()
|
||||
m_MainWindow.ImportItemList.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))
|
||||
m_MainWindow.ImportItemList.Add(New IconListBoxItem(DriI.Name, 1))
|
||||
Next
|
||||
' pulisco la vista
|
||||
ClearView()
|
||||
|
||||
+7
-2
@@ -24,7 +24,8 @@
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
@@ -37,7 +38,11 @@
|
||||
<ToggleButton Name="DrawBtn" Grid.Column="2" FontSize="15" FontWeight="Bold" />
|
||||
<ToggleButton Name="PlaceBtn" Grid.Column="3" FontSize="15" FontWeight="Bold" />
|
||||
<ToggleButton Name="OptionsBtn" Grid.Column="4" FontSize="15" FontWeight="Bold" />
|
||||
|
||||
<ToggleButton Name="OpenBtn" Grid.Column="5">
|
||||
<Image Source="Resources/Open.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</ToggleButton>
|
||||
|
||||
<Button Grid.Column="7" Click="ExitBtn_Click" >
|
||||
<Image Source="Resources/X.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
+41
-3
@@ -9,6 +9,7 @@ Class MainWindow
|
||||
Friend m_DrawPageUC As DrawPageUC
|
||||
Friend m_PlacePageUC As PlacePageUC
|
||||
Friend m_OptionsPageUC As OptionsPageUC
|
||||
Friend m_OpenPageUC As OpenPageUC
|
||||
Friend m_NumericKeyboardWD As NumericKeyboardWD
|
||||
Friend m_AboutBoxWD As AboutBoxWD
|
||||
|
||||
@@ -20,7 +21,8 @@ Class MainWindow
|
||||
Private m_nDebug As Integer = 0
|
||||
|
||||
'Dichiarazione lista per ListBox della ImportPage
|
||||
Friend ItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
Friend ImportItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
Friend OpenItemList As New ObservableCollection(Of IconListBoxItem)
|
||||
|
||||
'Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActivePage As Pages
|
||||
@@ -30,6 +32,7 @@ Class MainWindow
|
||||
Draw
|
||||
Place
|
||||
Options
|
||||
Open
|
||||
End Enum
|
||||
|
||||
Dim OpenTimer As New DispatcherTimer
|
||||
@@ -103,12 +106,12 @@ Class MainWindow
|
||||
Me.Width = nWidth
|
||||
WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
|
||||
|
||||
|
||||
'Creazione delle Page UserControl
|
||||
m_ImportPageUC = New ImportPageUC
|
||||
m_DrawPageUC = New DrawPageUC
|
||||
m_PlacePageUC = New PlacePageUC
|
||||
m_OptionsPageUC = New OptionsPageUC
|
||||
m_OpenPageUC = New OpenPageUC
|
||||
m_NumericKeyboardWD = New NumericKeyboardWD
|
||||
m_AboutBoxWD = New AboutBoxWD
|
||||
|
||||
@@ -121,6 +124,8 @@ Class MainWindow
|
||||
m_PlacePageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_OptionsPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_OptionsPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_OpenPageUC.SetValue(Grid.ColumnProperty, 0)
|
||||
m_OpenPageUC.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
|
||||
@@ -147,7 +152,6 @@ Class MainWindow
|
||||
m_NumericKeyboardWD.Owner = Me
|
||||
m_AboutBoxWD.Owner = Me
|
||||
|
||||
|
||||
'Seleziono la Tab e la Page di apertura
|
||||
MainWindowGrid.Children.Add(m_PlacePageUC)
|
||||
m_ActivePage = Pages.Place
|
||||
@@ -187,6 +191,9 @@ Class MainWindow
|
||||
Case Pages.Options
|
||||
ImportBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
Case Pages.Open
|
||||
ImportBtn.IsChecked = False
|
||||
OpenBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -206,6 +213,9 @@ Class MainWindow
|
||||
Case Pages.Options
|
||||
DrawBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
Case Pages.Open
|
||||
DrawBtn.IsChecked = False
|
||||
OpenBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -222,6 +232,9 @@ Class MainWindow
|
||||
Case Pages.Options
|
||||
PlaceBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
Case Pages.Open
|
||||
PlaceBtn.IsChecked = False
|
||||
OpenBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -241,6 +254,31 @@ Class MainWindow
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.Options
|
||||
OptionsBtn.IsChecked = True
|
||||
Case Pages.Open
|
||||
OptionsBtn.IsChecked = False
|
||||
OpenBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
|
||||
Select Case m_ActivePage
|
||||
Case Pages.Import
|
||||
ImportBtn.IsChecked = True
|
||||
OpenBtn.IsChecked = False
|
||||
Case Pages.Draw
|
||||
DrawBtn.IsChecked = True
|
||||
OpenBtn.IsChecked = False
|
||||
Case Pages.Place
|
||||
OpenBtn.IsChecked = True
|
||||
PlaceBtn.IsChecked = False
|
||||
MainWindowGrid.Children.Remove(m_PlacePageUC)
|
||||
MainWindowGrid.Children.Add(m_OpenPageUC)
|
||||
m_ActivePage = Pages.Open
|
||||
Case Pages.Options
|
||||
OptionsBtn.IsChecked = True
|
||||
OpenBtn.IsChecked = False
|
||||
Case Pages.Open
|
||||
OpenBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" BorderThickness="1,1,1,0"
|
||||
CornerRadius="3,3,0,0" BorderBrush="DarkGray" >
|
||||
CornerRadius="3,3,0,0" BorderBrush="DarkGray" >
|
||||
<TextBlock Text="Lato A" FontSize="25" Name="NumericKeyboardWDTitle" Background="#FFDDDDDD"
|
||||
Padding="3,0,0,0"/>
|
||||
Padding="3,0,0,0"/>
|
||||
</Border>
|
||||
<TextBox Text="100" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5"
|
||||
TextAlignment="Right" FontSize="25" Name="NumericKeyboardWDTextBox" />
|
||||
TextAlignment="Right" FontSize="25" Name="NumericKeyboardWDTextBox" IsReadOnly="True" />
|
||||
|
||||
<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" />
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<UserControl x:Class="OpenPageUC"
|
||||
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="OpenPage_Initialized" Loaded="OpenPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="SarmaxWallDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della OpenPage -->
|
||||
<Grid Name="OpenPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="9.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Name="FilePathTxBl" Background="White" FontSize="15"/>
|
||||
<ListBox Name="FileListBox" Grid.Row="1" ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||
ItemsSource="{Binding ItemList}"/>
|
||||
|
||||
<!-- Definizione della Grid Inferiore per i Button V e X -->
|
||||
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Name="OkBtn" Grid.Column="2" >
|
||||
<Image Source="Resources/V.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="3" >
|
||||
<Image Source="Resources/X.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,322 @@
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class OpenPageUC
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
'Dichiarazione del UserControl SceneButtons
|
||||
Friend m_SceneButtons As SceneButtonsUC
|
||||
|
||||
' 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 Scene
|
||||
Friend WithEvents OpenScene As New Scene
|
||||
Dim OpenSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
|
||||
Private Sub OpenPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Creazione del UserCOntrol SceneButtons
|
||||
m_SceneButtons = New SceneButtonsUC
|
||||
|
||||
'Posizionemento nella griglia del UserControl SceneButtons
|
||||
m_SceneButtons.SetValue(Grid.ColumnProperty, 0)
|
||||
BottomButtonsGrid.Children.Add(m_SceneButtons)
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella OpenPageGrid
|
||||
OpenSceneHost.Child = OpenScene
|
||||
OpenSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
OpenSceneHost.SetValue(Grid.RowProperty, 0)
|
||||
OpenSceneHost.SetValue(Grid.RowSpanProperty, 2)
|
||||
Me.OpenPageGrid.Children.Add(OpenSceneHost)
|
||||
|
||||
'Definizione del collegamento tra ItemList e ListBox1
|
||||
FileListBox.ItemsSource = m_MainWindow.OpenItemList
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OpenPage_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())
|
||||
OpenScene.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())
|
||||
OpenScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, m_MainWindow.GetIniFile())
|
||||
OpenScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, m_MainWindow.GetIniFile())
|
||||
OpenScene.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())
|
||||
OpenScene.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())
|
||||
OpenScene.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())
|
||||
OpenScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' Inizializzazione delle viste
|
||||
OpenScene.Init()
|
||||
' Imposto griglia
|
||||
LoadGridData()
|
||||
' leggo direttorio corrente
|
||||
GetPrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, "", m_sCurrDir, m_MainWindow.GetIniFile())
|
||||
' lo carico
|
||||
LoadCurrDir()
|
||||
m_bFirst = False
|
||||
Else
|
||||
EgtSetCurrentContext(OpenScene.GetCtx())
|
||||
End If
|
||||
|
||||
' Pulisco tutto
|
||||
ClearView()
|
||||
' inibisco selezione diretta da Scene
|
||||
OpenScene.SetStatusNull()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadGridData()
|
||||
Dim dSnapStep As Double = GetPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nMinLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1, m_MainWindow.GetIniFile())
|
||||
Dim nMajLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10, m_MainWindow.GetIniFile())
|
||||
Dim nExtSStep As Integer = GetPrivateProfileInt(S_GRID, K_EXTSSTEP, 50, m_MainWindow.GetIniFile())
|
||||
Dim MinLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor, m_MainWindow.GetIniFile())
|
||||
Dim MajLnColor As New Color3d(160, 160, 160)
|
||||
GetPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor, m_MainWindow.GetIniFile())
|
||||
EgtSetGridFrame(Frame3d.GLOB)
|
||||
EgtSetGridGeo(dSnapStep, nMinLineSStep, nMajLineSStep, nExtSStep)
|
||||
EgtSetGridColor(MinLnColor, MajLnColor)
|
||||
Dim bShowGrid As Boolean = (GetPrivateProfileInt(S_GRID, K_SHOWGRID, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
EgtSetGridShow(bShowGrid, False)
|
||||
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
|
||||
Dim TempPath As New Text.StringBuilder(260)
|
||||
PathCompactPathEx(TempPath, m_sCurrDir, 28, 0)
|
||||
' lo visualizzo
|
||||
FilePathTxBl.Content = TempPath.ToString
|
||||
' pulisco la lista
|
||||
m_MainWindow.OpenItemList.Clear()
|
||||
' per risalire al direttorio padre
|
||||
m_MainWindow.OpenItemList.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.OpenItemList.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 = ".NGE" Then
|
||||
m_MainWindow.OpenItemList.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.Content = m_sCurrDir
|
||||
' pulisco la lista
|
||||
m_MainWindow.OpenItemList.Clear()
|
||||
' elenco dei dischi
|
||||
Dim vDriI As DriveInfo() = DriveInfo.GetDrives()
|
||||
Dim DriI As DriveInfo
|
||||
For Each DriI In vDriI
|
||||
m_MainWindow.OpenItemList.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()
|
||||
Case 1 ' Vai nella radice del disco
|
||||
m_sCurrDir = vItems.Name
|
||||
m_sCurrFile = ""
|
||||
LoadCurrDir()
|
||||
Case 2 ' Vai nel sottodirettorio
|
||||
m_sCurrDir = IO.Path.Combine(m_sCurrDir, vItems.Name)
|
||||
m_sCurrFile = ""
|
||||
LoadCurrDir()
|
||||
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
|
||||
OpenScene.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.NGE Then
|
||||
' Carico Btl
|
||||
bOk = bOk AndAlso EgtOpenFile(sPath)
|
||||
Else
|
||||
' Formato sconosciuto
|
||||
EgtNewFile()
|
||||
bOk = False
|
||||
End If
|
||||
' Eseguo zoom
|
||||
OpenScene.ZoomAll()
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles OpenScene.OnMouseDownScene
|
||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or Not OpenScene.IsStatusNull() Then
|
||||
Return
|
||||
End If
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelect(True, True, True, True, True)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, 2 * Scene.DIM_SEL, 2 * 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))
|
||||
If EgtIsPart(nPartId) Then
|
||||
Dim nStat As Integer = GDB_ST.ON_
|
||||
EgtGetStatus(nPartId, nStat)
|
||||
If nStat = GDB_ST.SEL Then
|
||||
EgtDeselectObj(nPartId)
|
||||
Else
|
||||
EgtSelectObj(nPartId)
|
||||
End If
|
||||
EgtDraw()
|
||||
Exit While
|
||||
End If
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub ConfirmBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
' Vettore nomi file temporanei
|
||||
Dim sTmpFiles As New ArrayList()
|
||||
' Ciclo di salvataggio dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Esporto il pezzo in un file temporaneo
|
||||
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Wall" & nId & ".Nge"
|
||||
sTmpFiles.Add(sTmpFile)
|
||||
If Not EgtSaveObjToFile(nId, sTmpFile, NGE.BIN) Then
|
||||
Return
|
||||
End If
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Passo al contesto principale
|
||||
EgtSetCurrentContext(m_MainWindow.m_PlacePageUC.PlaceScene.GetCtx())
|
||||
' Ciclo di caricamento dei pezzi
|
||||
For Each sTmpfile As String In sTmpFiles
|
||||
If My.Computer.FileSystem.FileExists(sTmpfile) Then
|
||||
' Inserisco il pezzo
|
||||
EgtInsertFile(sTmpfile)
|
||||
' Ne recupero l'Id
|
||||
Dim nId2 As Integer = EgtGetLastPart()
|
||||
' Lo posiziono in ordine
|
||||
EgtPackPart(nId2, m_MainWindow.m_PlacePageUC.m_dOffsetX, m_MainWindow.m_PlacePageUC.m_dOffsetY,
|
||||
m_MainWindow.m_PlacePageUC.m_dLength, m_MainWindow.m_PlacePageUC.m_dMinDist)
|
||||
' Cancello il file
|
||||
My.Computer.FileSystem.DeleteFile(sTmpfile)
|
||||
End If
|
||||
Next
|
||||
' Aggiorno ambiente principale
|
||||
EgtZoom(ZM.ALL)
|
||||
'Istruzioni per chiudere ImportPageUC e aprire PlacePage UC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
|
||||
m_MainWindow.OpenBtn.IsChecked = False
|
||||
m_MainWindow.PlaceBtn.IsChecked = True
|
||||
End Sub
|
||||
|
||||
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_OpenPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PlacePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Place
|
||||
m_MainWindow.OpenBtn.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
|
||||
+5
-3
@@ -37,7 +37,8 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Name="WallPositioningLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
|
||||
@@ -67,9 +68,10 @@
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
<Button Name="RemoveWallBtn" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" FontSize="15" />
|
||||
<Button Name="StoreWallBtn" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" FontSize="15" />
|
||||
<Button Name="RemoveWallBtn" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" FontSize="15" />
|
||||
|
||||
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2">
|
||||
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2">
|
||||
<TextBlock Name="LayerThicknessLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" FontSize="15" TextWrapping="WrapWithOverflow" Width="75"
|
||||
TextAlignment="Center" />
|
||||
|
||||
+7
-2
@@ -42,8 +42,9 @@ Public Class PlacePageUC
|
||||
GenerateBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 1) 'Generate - Genera
|
||||
SendBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 2) 'Send - Trasmetti
|
||||
WallPositioningLbl.Content = EgtMsg(MSG_PLACEPAGEUC + 3) 'Wall position - Posizionamento parete
|
||||
RemoveWallBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 4) 'RemoveWall - Elimina parete
|
||||
LayerThicknessLbl.Text = EgtMsg(MSG_PLACEPAGEUC + 5) 'Layer thickness - Spessore strato
|
||||
StoreWallBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 4) 'Store wall - Parcheggia parete
|
||||
RemoveWallBtn.Content = EgtMsg(MSG_PLACEPAGEUC + 5) 'Remove wall - Elimina parete
|
||||
LayerThicknessLbl.Text = EgtMsg(MSG_PLACEPAGEUC + 6) 'Layer thickness - Spessore strato
|
||||
|
||||
' Associo TextBox e Label
|
||||
Dim TempLabel As New Label
|
||||
@@ -189,6 +190,10 @@ Public Class PlacePageUC
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub StoreWallBtn_Click(sender As Object, e As RoutedEventArgs) Handles StoreWallBtn.Click
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveWallBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveWallBtn.Click
|
||||
' Ciclo di cancellazione dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -110,6 +110,9 @@
|
||||
<Compile Include="NumericKeyboardWD.xaml.vb">
|
||||
<DependentUpon>NumericKeyboardWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OpenPageUC.xaml.vb">
|
||||
<DependentUpon>OpenPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OptionsPageUC.xaml.vb">
|
||||
<DependentUpon>OptionsPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -160,6 +163,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="OpenPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="OptionsPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -257,6 +264,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NumericKeyboardArrow.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Open.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\SarmaxWall\SarmaxWallR32.exe
|
||||
|
||||
@@ -35,12 +35,14 @@ Public Class SceneButtonsUC
|
||||
|
||||
Private Function GetCurrScene() As EgtUILib.Scene
|
||||
Select Case m_MainWindow.m_ActivePage
|
||||
Case MainWindow.Pages.Draw
|
||||
Return m_MainWindow.m_DrawPageUC.DrawScene
|
||||
Case MainWindow.Pages.Import
|
||||
Return m_MainWindow.m_ImportPageUC.ImportScene
|
||||
Case Else
|
||||
Return m_MainWindow.m_PlacePageUC.PlaceScene
|
||||
Case MainWindow.Pages.Draw
|
||||
Return m_MainWindow.m_DrawPageUC.DrawScene
|
||||
Case MainWindow.Pages.Import
|
||||
Return m_MainWindow.m_ImportPageUC.ImportScene
|
||||
Case MainWindow.Pages.Open
|
||||
Return m_MainWindow.m_OpenPageUC.OpenScene
|
||||
Case Else
|
||||
Return m_MainWindow.m_PlacePageUC.PlaceScene
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user