From 049126798bccabec40d17afa78251e921b129d92 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sun, 6 Sep 2015 08:31:42 +0000 Subject: [PATCH] =?UTF-8?q?SarmaxWall=201.6i3=20:=20-=20modifiche=20per=20?= =?UTF-8?q?gestione=20PAN,=20ROTATE=20e=20ZOOMWIN=20-=20aggiunta=20possibi?= =?UTF-8?q?lit=C3=A0=20di=20cancellare=20porte=20o=20finsetre=20mentre=20s?= =?UTF-8?q?i=20sta=20definendo=20una=20parete=20-=20migliorata=20selezione?= =?UTF-8?q?=20pezzi,=20ora=20solo=20su=20tasto=20sinistro=20(come=20touch)?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrawPageUC.xaml | 4 ++-- DrawPageUC.xaml.vb | 45 ++++++++++++++++++++++++++++++++----- ImportPageUC.xaml | 4 ++-- ImportPageUC.xaml.vb | 10 ++++----- My Project/AssemblyInfo.vb | 4 ++-- PlacePageUC.xaml | 4 ++-- PlacePageUC.xaml.vb | 4 ++++ Resources/ZoomWin.png | Bin 0 -> 2292 bytes SarmaxWall.vbproj | 3 +++ SceneButtonsUC.xaml | 22 +++++++++++++----- SceneButtonsUC.xaml.vb | 22 ++++++++++++++++-- 11 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 Resources/ZoomWin.png diff --git a/DrawPageUC.xaml b/DrawPageUC.xaml index 5b79217..2eeb1ac 100644 --- a/DrawPageUC.xaml +++ b/DrawPageUC.xaml @@ -83,8 +83,8 @@ - - + + diff --git a/DrawPageUC.xaml.vb b/DrawPageUC.xaml.vb index 1792461..7cdadd3 100644 --- a/DrawPageUC.xaml.vb +++ b/DrawPageUC.xaml.vb @@ -8,6 +8,8 @@ Public Class DrawPageUC Private Const NUM_VAR As Integer = 4 Private Const LUA_CMP_VARS As String = "CMP" Private Const LUA_CMP_DRAW As String = "CMP_Draw" + Private Const LUA_REMOVEHOLE As String = "RemoveHole" + Private Const LUA_PREINSERT As String = "PreInsert" Private Const INFO_CMP As String = "CMP" Private Const LUA_CMP_WALL As String = "Wall" Private Const LUA_CMP_DOOR As String = "Door" @@ -198,6 +200,18 @@ Public Class DrawPageUC End Sub Private Sub CancelBtn_Click(sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click + ' Leggo l'indice del componente corrente + Dim nCmp As Integer = 0 + If Not EgtLuaGetGlobIntVar(LUA_CMP_INDEX, nCmp) Or nCmp < 1 Then + Return + End If + Dim sCmp As String = nCmp.ToString() + ' Lancio cancellazione + If Not EgtLuaExecLine(LUA_REMOVEHOLE & "(" & nCmp & ")") Then + EgtOutLog("Error in RemoveHole execution") + Return + End If + ' Sistemo interfaccia ResetBtns() m_ActiveComponent = Components.Null ' Deseleziono oggetto corrente e aggiorno visualizzazione @@ -213,6 +227,10 @@ Public Class DrawPageUC End Sub Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles DrawScene.OnMouseDownScene + ' Si può selezionare solo con il tasto sinistro e se stato NULL + If e.Button <> Windows.Forms.MouseButtons.Left Or Not DrawScene.IsStatusNull() Then + Return + End If ' Si può selezionare solo se non si sta già editando un componente If m_ActiveComponent <> Components.Null Then Return @@ -264,6 +282,8 @@ Public Class DrawPageUC ResetLuaVariables() ' Carico il file Dim bOk As Boolean = ExecCompoFile() + ' Leggo le variabili da Lua (per sapere numero, nome e tipo) + ReadVariables() ' Imposto le variabili del componente For i As Integer = 1 To NUM_VAR ' leggo il valore della variabile @@ -294,8 +314,8 @@ Public Class DrawPageUC MessageLabel.Background = If(m_bDrawOk, Brushes.White, Brushes.Tomato) DrawScene.ZoomAll() m_bEdit = True - ' Leggo variabili e aggiorno griglia - ReadAndShowVariables() + ' Aggiorno griglia + ShowVariables() ' Visualizzo bottoni Add e Cancel, e MessageLabel ShowComponentsButtons() End Sub @@ -350,13 +370,13 @@ Public Class DrawPageUC MessageLabel.Background = If(m_bDrawOk, Brushes.White, Brushes.Tomato) DrawScene.ZoomAll() ' Leggo variabili e aggiorno griglia - ReadAndShowVariables() + ReadVariables() + ShowVariables() ' Visualizzo bottoni Add e Cancel, e MessageLabel ShowComponentsButtons() End Sub - Private Function ReadAndShowVariables() As Boolean - m_bShowVar = True + Private Function ReadVariables() As Boolean ' Recupero nome, tipo e valore delle variabili globali For i As Integer = 1 To NUM_VAR Dim CVar = New CompoVar @@ -367,7 +387,12 @@ Public Class DrawPageUC m_CVars(i - 1) = Nothing End If Next + Return True + End Function + + Private Function ShowVariables() As Boolean ' Aggiorno la griglia dalle variabili + m_bShowVar = True 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 @@ -441,6 +466,11 @@ Public Class DrawPageUC End Function Private Function MakeInsert(ByVal nNbr As Integer) As Boolean + ' Lancio funzione pre-inserimento + If Not EgtLuaExecLine(LUA_PREINSERT & "()") Then + EgtOutLog("Error in PreInsert execution") + Return False + End If ' Vettore nomi file temporanei Dim sTmpFiles As New ArrayList() ' Ciclo di salvataggio dei pezzi @@ -450,6 +480,7 @@ Public Class DrawPageUC Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Wall" & nId & ".Nge" sTmpFiles.Add(sTmpFile) If Not EgtSaveObjToFile(nId, sTmpFile, NGE.BIN) Then + EgtOutLog("Error in saveObjToFile ") Return False End If ' Passo al pezzo successivo @@ -503,7 +534,9 @@ Public Class DrawPageUC ResetBtns() m_ActiveComponent = Components.Null ' Inserisco il componente nel DB geometrico principale - MakeInsert(1) + If Not MakeInsert(1) Then + Return + End If ' Aggiorno ambiente principale EgtZoom(ZM.ALL) ' Istruzioni per chiudere DrawPageUC e aprire PlacePage UC diff --git a/ImportPageUC.xaml b/ImportPageUC.xaml index 4755232..4c2baca 100644 --- a/ImportPageUC.xaml +++ b/ImportPageUC.xaml @@ -30,8 +30,8 @@ - - + + diff --git a/ImportPageUC.xaml.vb b/ImportPageUC.xaml.vb index aa474b7..bc4e870 100644 --- a/ImportPageUC.xaml.vb +++ b/ImportPageUC.xaml.vb @@ -181,20 +181,14 @@ Public Class ImportPageUC 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() @@ -245,6 +239,10 @@ Public Class ImportPageUC End Function Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportScene.OnMouseDownScene + ' Si può selezionare solo con il tasto sinistro e se stato NULL + If e.Button <> Windows.Forms.MouseButtons.Left Or Not ImportScene.IsStatusNull() Then + Return + End If ' Verifico se selezionato indicativo di pezzo EgtSetObjFilterForSelect(True, True, True, True, True) Dim nSel As Integer diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 65f818a..713ebf6 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -55,5 +55,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/PlacePageUC.xaml b/PlacePageUC.xaml index 1309e88..bed1c74 100644 --- a/PlacePageUC.xaml +++ b/PlacePageUC.xaml @@ -82,8 +82,8 @@ - - + + diff --git a/PlacePageUC.xaml.vb b/PlacePageUC.xaml.vb index 6979b15..b5d9921 100644 --- a/PlacePageUC.xaml.vb +++ b/PlacePageUC.xaml.vb @@ -99,6 +99,10 @@ Public Class PlacePageUC End Sub Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles PlaceScene.OnMouseDownScene + ' Si può selezionare solo con il tasto sinistro e se stato NULL + If e.Button <> Windows.Forms.MouseButtons.Left Or Not PlaceScene.IsStatusNull() Then + Return + End If ' Verifico se selezionato indicativo di pezzo EgtSetObjFilterForSelect(True, True, True, True, True) Dim nSel As Integer diff --git a/Resources/ZoomWin.png b/Resources/ZoomWin.png new file mode 100644 index 0000000000000000000000000000000000000000..06d24a7a0d37347ebf4666e2225fdc475552ff8c GIT binary patch literal 2292 zcmZuzc{CJ^79Z~$dzgqOjV-h>F$mMdAk3J_u9QK9?Awqb36rG}V@z2}me26nx5|vN zW#1+$p=5a&%aEig$}r!@Iq$r4I`5r(e)s;)z31Nh$Nl4XNj6p}F%el2001Cnfi|_< zi^=;C64>+SmoWPUf$Lb5Dd6vYD{Lu!u$K`IL0=660K~iY!I!BfesnJ>7;a%{CO9L^ zFRiCuZG^Z400_lfm>N4oPORl!3pg|`o!q9~)CD%tB#$N)J2+U3J_e4)_?Tt>Ytz2E z?2=4F1>eSrJMre13@3vGwt_1`a2`gV=vbvNk%8s8T3KqEw;~uddI<4WBI3hmlt0)9f!9H zF}LWpbG2O@`2lq+;a4;xpr8ZTDD~*GRaKyf+6#1OTZ?fy?!LFgLVco;G(Ca4hNWv? zhQd?gDbYkc7g`boHUCx2@OGFV@k*0 zj8a?$K11h7qCdwnN9hA=TJngvH6uU&x5?IN{-kiVDrT09$1#||)YYKv*OT8Qyr2R` zwUw+S#A~tf^!bYe46n#=epnZpOv0x|y)R9q;A--Qf0|j@dH!|Ek^*v}Dle;lA5&cb zll6Cb2j`j{%3K;3`wY=ibpx^Lsq9ZS&$0gZ4;A=pf zY{HvkaDWN#Za=B4Nq?=E@;K*~1D31^vSNG5g%@1p!ob0$>b8SQJ*;Ky)u%Ripfcx{ zehDevnhQHn+BaK9g&4aX_e6^Zmd!&8@jKcjBn>g6oG2XrUeizQf;bFWcs^!es^1_g z?O>kz48|A!QWXV4NA|mybjjz%)6g|3$5l|8VD#;W-{D>O^N!kq?Czp&#AzBq?S}Az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b/SarmaxWall.vbproj index 9cac26b..2bcca83 100644 --- a/SarmaxWall.vbproj +++ b/SarmaxWall.vbproj @@ -241,6 +241,9 @@ + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\SarmaxWall\SarmaxWallR32.exe diff --git a/SceneButtonsUC.xaml b/SceneButtonsUC.xaml index b93155f..4c59bf7 100644 --- a/SceneButtonsUC.xaml +++ b/SceneButtonsUC.xaml @@ -4,9 +4,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" - d:DesignHeight="64" d:DesignWidth="409.6"> + d:DesignHeight="64" d:DesignWidth="455"> - + + + + + + @@ -15,7 +20,8 @@ - + + - + - - diff --git a/SceneButtonsUC.xaml.vb b/SceneButtonsUC.xaml.vb index 3802c3f..be13683 100644 --- a/SceneButtonsUC.xaml.vb +++ b/SceneButtonsUC.xaml.vb @@ -2,6 +2,9 @@ Public Class SceneButtonsUC + 'Riferimento alla MainWindow + Dim m_MainWindow As MainWindow = Application.Current.MainWindow + Private Sub ZoomAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomAllBtn.Click EgtZoom(ZM.ALL) End Sub @@ -14,16 +17,31 @@ Public Class SceneButtonsUC EgtZoom(ZM.OUT) End Sub - Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click + Private Sub ZoomWinBtn_Click(sender As Object, e As RoutedEventArgs) Handles ZoomWinBtn.Click + GetCurrScene.SetStatusZoomWin() + End Sub + Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click + GetCurrScene.SetStatusPan() End Sub Private Sub GenericViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles GenericViewBtn.Click - + GetCurrScene.SetStatusRot() End Sub Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click EgtSetView(VT.TOP) End Sub + Private Function GetCurrScene() As EgtUILib.Scene + 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 + End Select + End Function + End Class