EgtUILib 1.9e2 :

- possibilità di cambiare colore di sfondo e di default anche tramite scena.
This commit is contained in:
Dario Sassi
2018-05-24 15:44:47 +00:00
parent 4720bb7692
commit 2897fa4391
37 changed files with 176 additions and 159 deletions
+62 -62
View File
@@ -19,28 +19,28 @@ Imports System.Text
Public Class Controller
' Events
Public Event OnNewProject(ByVal sender As Object, ByVal bOk As Boolean)
Public Event OnOpeningProject(ByVal sender As Object)
Public Event OnOpenProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
Public Event OnInsertedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
Public Event OnSavingProject(ByVal sender As Object, ByVal sFile As String)
Public Event OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
Public Event OnSavingObject(ByVal sender As Object, ByVal sFile As String)
Public Event OnSavedObject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
Public Event OnImportingProject(ByVal sender As Object, ByVal nType As Integer, ByRef nFlag As Integer)
Public Event OnImportedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
Public Event OnExportingProject(ByVal sender As Object)
Public Event OnExportedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
Public Event OnExecutingScript(ByVal sender As Object)
Public Event OnExecutedScript(ByVal sender As Object, ByVal sFile As String,
ByVal bOk As Boolean, ByVal sError As String)
Public Event PrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean)
Public Event SetInputBoxText(ByVal sText As String)
Public Event SetInputBoxCheck(ByVal bCheck As Boolean)
Public Event AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean)
Public Event UpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean)
Public Event OutputInfo(ByVal sender As Object, ByVal sText As String)
Public Event OnNewProject(sender As Object, bOk As Boolean)
Public Event OnOpeningProject(sender As Object)
Public Event OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
Public Event OnInsertedProject(sender As Object, sFile As String, bOk As Boolean)
Public Event OnSavingProject(sender As Object, sFile As String)
Public Event OnSavedProject(sender As Object, sFile As String, bOk As Boolean)
Public Event OnSavingObject(sender As Object, sFile As String)
Public Event OnSavedObject(sender As Object, sFile As String, bOk As Boolean)
Public Event OnImportingProject(sender As Object, nType As Integer, ByRef nFlag As Integer)
Public Event OnImportedProject(sender As Object, sFile As String, bOk As Boolean)
Public Event OnExportingProject(sender As Object)
Public Event OnExportedProject(sender As Object, sFile As String, bOk As Boolean)
Public Event OnExecutingScript(sender As Object)
Public Event OnExecutedScript(sender As Object, sFile As String,
bOk As Boolean, sError As String)
Public Event PrepareInputBox(sTitle As String, sLabel As String, sCheckLabel As String,
bShowCombo As Boolean, bShowBtn As Boolean)
Public Event SetInputBoxText(sText As String)
Public Event SetInputBoxCheck(bCheck As Boolean)
Public Event AddInputBoxCombo(sText As String, bSelected As Boolean)
Public Event UpdateUI(sender As Object, bReloadUI As Boolean)
Public Event OutputInfo(sender As Object, sText As String)
' Documento e Vista
Private m_Scene As Scene
@@ -207,7 +207,7 @@ Public Class Controller
Private EXTEND_BIG_ADD As Double = 200
' Metodi
Public Function NewProject(Optional ByVal bCreatePart As Boolean = False) As Boolean
Public Function NewProject(Optional bCreatePart As Boolean = False) As Boolean
' gestisco eventuale file corrente modificato
If Not ManageModified() Then Return False
' reset controller e scena
@@ -237,7 +237,7 @@ Public Class Controller
Return bOk
End Function
Public Function OpenProject(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Public Function OpenProject(Optional sDir As String = "", Optional bWithDlg As Boolean = True) As Boolean
' gestisco eventuale file corrente modificato
If Not ManageModified() Then Return False
' reset controller e scena
@@ -274,7 +274,7 @@ Public Class Controller
Return bOk
End Function
Public Function InsertProject(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Public Function InsertProject(Optional sDir As String = "", Optional bWithDlg As Boolean = True) As Boolean
Dim sFile As String = sDir
' Reset controller e scena
ResetStatus()
@@ -320,7 +320,7 @@ Public Class Controller
Return bOk
End Function
Public Function SaveProject(Optional ByVal nType As NGE = NGE.CMPTEXT) As Boolean
Public Function SaveProject(Optional nType As NGE = NGE.CMPTEXT) As Boolean
Dim sCurrFile As String = GetCurrFile()
If String.IsNullOrWhiteSpace(sCurrFile) Or EgtGetFileType(sCurrFile) <> FT.NGE Then
Return SaveAsProject(sCurrFile, nType)
@@ -343,7 +343,7 @@ Public Class Controller
End If
End Function
Public Function SaveAsProject(Optional ByVal sFile As String = "", Optional ByVal nType As NGE = NGE.CMPTEXT) As Boolean
Public Function SaveAsProject(Optional sFile As String = "", Optional nType As NGE = NGE.CMPTEXT) As Boolean
' Reset controller e scena
ResetStatus()
' Se nome vuoto, assegno "New"
@@ -374,7 +374,7 @@ Public Class Controller
Return bOk
End Function
Public Function SaveObject(ByVal nId As Integer, Optional ByVal sDir As String = "", Optional ByVal nType As NGE = NGE.CMPTEXT) As Boolean
Public Function SaveObject(nId As Integer, Optional sDir As String = "", Optional nType As NGE = NGE.CMPTEXT) As Boolean
' Reset controller e scena
ResetStatus()
' Creo nome di default
@@ -430,7 +430,7 @@ Public Class Controller
Return bOk
End Function
Public Function ImportProject(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Public Function ImportProject(Optional sDir As String = "", Optional bWithDlg As Boolean = True) As Boolean
' gestisco eventuale file corrente modificato
If Not ManageModified() Then Return False
' reset controller e scena
@@ -505,7 +505,7 @@ Public Class Controller
Return EgtAddPicture(nLayId, sName, sFile, dScaleFactor * nPixelX, dScaleFactor * nPixelY) <> GDB_ID.NULL
End Function
Public Function ExportProject(Optional ByVal sFile As String = "") As Boolean
Public Function ExportProject(Optional sFile As String = "") As Boolean
' Reset controller e scena
ResetStatus()
'Assegnazione nome file con dialogo
@@ -556,7 +556,7 @@ Public Class Controller
m_nImgHeight = nHeight
End Sub
Public Function Exec(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Public Function Exec(Optional sDir As String = "", Optional bWithDlg As Boolean = True) As Boolean
Dim sFile As String = sDir
'Scelta file con dialogo
If bWithDlg Then
@@ -630,7 +630,7 @@ Public Class Controller
EgtDraw()
End Sub
Public Sub MouseSelectedObj(ByVal nId As Integer, ByVal bLast As Boolean)
Public Sub MouseSelectedObj(nId As Integer, bLast As Boolean)
EnableCommandLog()
If EgtIsSelectedObj(nId) Then
EgtDeselectObj(nId)
@@ -643,7 +643,7 @@ Public Class Controller
End If
End Sub
Public Sub MouseSelectedPart(ByVal nId As Integer)
Public Sub MouseSelectedPart(nId As Integer)
' recupero il pezzo
Dim nPartId = EgtGetParent(EgtGetParent(nId))
If EgtGetParent(nPartId) <> GDB_ID.ROOT Then Return
@@ -661,7 +661,7 @@ Public Class Controller
EgtDraw()
End Sub
Public Sub MouseSelectedLayer(ByVal nId As Integer)
Public Sub MouseSelectedLayer(nId As Integer)
' recupero il layer
Dim nLayerId = EgtGetParent(nId)
If EgtGetParent(EgtGetParent(nLayerId)) <> GDB_ID.ROOT Then Return
@@ -679,7 +679,7 @@ Public Class Controller
EgtDraw()
End Sub
Public Sub MouseSelectedPath(ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
Public Sub MouseSelectedPath(nId As Integer, bHaltOnFork As Boolean)
' verifico sia parte di un layer
Dim nPartId = EgtGetParent(EgtGetParent(nId))
If Not (EgtIsPart(nPartId) OrElse EgtGetRawPartFromPart(nPartId) <> GDB_ID.NULL) Then
@@ -692,7 +692,7 @@ Public Class Controller
EgtDraw()
End Sub
Public Sub MouseSelectedPoint(ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer, ByVal bDone As Boolean)
Public Sub MouseSelectedPoint(PtP As Point3d, nSep As SEP, nId As Integer, bDone As Boolean)
SetDataFromSelPoint(PtP, nSep, nId)
' avanzo di un passo
If bDone Then
@@ -716,13 +716,13 @@ Public Class Controller
End If
End Sub
Public Sub MouseMoveInSelectionPoint(ByVal PtP As Point3d)
Public Sub MouseMoveInSelectionPoint(PtP As Point3d)
SetDataFromSelPoint(PtP, SEP.PT_STD, GDB_ID.NULL)
' eseguo drag
ExecuteDrag()
End Sub
Private Sub SetDataFromSelPoint(ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
Private Sub SetDataFromSelPoint(PtP As Point3d, nSep As SEP, nId As Integer)
' recupero il punto e le sue info ausiliarie
m_ptLast = PtP
m_sepLast = nSep
@@ -743,14 +743,14 @@ Public Class Controller
End Select
End Sub
Public Sub Done(ByVal sText As String)
Public Sub Done(sText As String)
' recupero il dato
InputTextToLast(sText)
' avanzo di un passo
ProcessStatus()
End Sub
Public Sub Show(ByVal sText As String)
Public Sub Show(sText As String)
' recupero il dato
InputTextToLast(sText)
' disabilito drag da mouse
@@ -761,16 +761,16 @@ Public Class Controller
ExecuteDrag()
End Sub
Private Sub SetInputBoxString(ByVal sText As String)
Private Sub SetInputBoxString(sText As String)
RaiseEvent SetInputBoxText(sText)
End Sub
Private Sub SetInputBoxInteger(ByVal nVal As Integer)
Private Sub SetInputBoxInteger(nVal As Integer)
Dim sText As String = nVal.ToString()
RaiseEvent SetInputBoxText(sText)
End Sub
Private Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As UInteger) As String
Private Function DoubleToString(dVal As Double, nNumDec As UInteger) As String
Dim sFormat As String = "F" + nNumDec.ToString()
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
If nNumDec > 0 Then
@@ -780,13 +780,13 @@ Public Class Controller
End If
End Function
Private Sub SetInputBoxDouble(ByVal dVal As Double, Optional ByVal bUiScale As Boolean = False)
Private Sub SetInputBoxDouble(dVal As Double, Optional bUiScale As Boolean = False)
Dim dTmp As Double = If(bUiScale, EgtToUiUnits(dVal), dVal)
Dim sText As String = DoubleToString(dTmp, 4)
RaiseEvent SetInputBoxText(sText)
End Sub
Private Sub SetInputBox3Double(ByVal d3Val() As Double)
Private Sub SetInputBox3Double(d3Val() As Double)
' verifico ci siano almeno 3 elementi nell'array
If d3Val.Length < 3 Then
Return
@@ -801,7 +801,7 @@ Public Class Controller
RaiseEvent SetInputBoxText(sText.ToString())
End Sub
Private Sub SetInputBoxPoint3d(ByVal ptVal As Point3d)
Private Sub SetInputBoxPoint3d(ptVal As Point3d)
' converto da coordinate globali a griglia
ptVal = ptVal.Loc(GDB_ID.GRID)
' visualizzo
@@ -814,7 +814,7 @@ Public Class Controller
RaiseEvent SetInputBoxText(sText.ToString())
End Sub
Private Sub SetInputBoxVector3d(ByVal vtVal As Vector3d)
Private Sub SetInputBoxVector3d(vtVal As Vector3d)
' converto da coordinate globali a griglia
vtVal = vtVal.Loc(GDB_ID.GRID)
' visualizzo
@@ -934,11 +934,11 @@ Public Class Controller
m_vtCont = vtV
End Sub
Public Sub SetLastDouble(ByVal dVal As Double)
Public Sub SetLastDouble(dVal As Double)
m_dLast = dVal
End Sub
Public Sub SetLast3Double(ByVal d3Val() As Double)
Public Sub SetLast3Double(d3Val() As Double)
If d3Val.Length >= 1 Then
m_d3Last(0) = d3Val(0)
If d3Val.Length >= 2 Then
@@ -950,7 +950,7 @@ Public Class Controller
End If
End Sub
Public Sub SetLastInteger(ByVal nVal As Integer)
Public Sub SetLastInteger(nVal As Integer)
m_nLast = nVal
If m_nLastCmd = CMD.TEXTPLUS Or m_nLastCmd = CMD.OFFSET Then
' aggiorno drag al cambio di font
@@ -962,7 +962,7 @@ Public Class Controller
m_sLast = sVal
End Sub
Public Sub SetLastBoolean(ByVal bVal As Boolean)
Public Sub SetLastBoolean(bVal As Boolean)
m_bLast = bVal
If m_nLastCmd = CMD.TEXTPLUS Or m_nLastCmd = CMD.POLYGON Or m_nLastCmd = CMD.EXTRUDE Or m_nLastCmd = CMD.REVOLVE Or m_nLastCmd = CMD.SETCURVETHICKNESS Then
' aggiorno drag al cambio di italic
@@ -970,7 +970,7 @@ Public Class Controller
End If
End Sub
Public Sub SetPointFromSelection(ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
Public Sub SetPointFromSelection(nId As Integer, PtP As Point3d, nAux As Integer)
If EgtIsSelectedObj(nId) Then
m_ptPrevSel = m_ptLastSel
m_nPrevSel = m_nLastSel
@@ -1000,7 +1000,7 @@ Public Class Controller
Return ExecuteCommand(m_nLastCmd)
End Function
Public Function ExecuteCommand(ByVal nCmd As CMD) As Boolean
Public Function ExecuteCommand(nCmd As CMD) As Boolean
' Posso partire solo con stato libero
If m_nStep <> 0 Then Return False
' Reset eventuali analisi e distanza in corso
@@ -1954,7 +1954,7 @@ Public Class Controller
Return True
End Function
Private Function DoCopyPartLayerObj(ByVal nId As Integer) As Integer
Private Function DoCopyPartLayerObj(nId As Integer) As Integer
Dim nNewId As Integer = GDB_ID.NULL
' se pezzo
If EgtIsPart(m_nLast) Then
@@ -5158,7 +5158,7 @@ Public Class Controller
Return False
End Function
Private Function PrepareTransform(Optional ByVal bAllSelected As Boolean = True) As Boolean
Private Function PrepareTransform(Optional bAllSelected As Boolean = True) As Boolean
' verifico ci sia qualcosa di selezionato
If EgtGetFirstSelectedObj() = GDB_ID.NULL Then
Return False
@@ -5190,12 +5190,12 @@ Public Class Controller
Return True
End Function
Private Function GridLenFromGlobLen(ByVal vtLen As Vector3d) As Double
Private Function GridLenFromGlobLen(vtLen As Vector3d) As Double
vtLen.ToLoc(EgtGetGridFrame())
Return Math.Sqrt(vtLen.x * vtLen.x + vtLen.y * vtLen.y)
End Function
Private Function GridAngFromGlobDir(ByVal vtDir As Vector3d) As Double
Private Function GridAngFromGlobDir(vtDir As Vector3d) As Double
vtDir.ToLoc(EgtGetGridFrame())
Dim dLen As Double
Dim dAngVertDeg As Double
@@ -5204,7 +5204,7 @@ Public Class Controller
Return dAngOrizzDeg
End Function
Private Function GlobDirFromGridAng(ByVal dGridAngDeg As Double) As Vector3d
Private Function GlobDirFromGridAng(dGridAngDeg As Double) As Vector3d
Dim vtDir As Vector3d = Vector3d.X_AX()
vtDir.Rotate(Vector3d.Z_AX, dGridAngDeg)
vtDir.ToGlob(EgtGetGridFrame())
@@ -5221,7 +5221,7 @@ Public Class Controller
End Function
'-------------------------------- Modified Status ------------------------------------------------
Public Function SetCurrFile(ByVal sFile As String) As Boolean
Public Function SetCurrFile(sFile As String) As Boolean
Return EgtSetCurrFilePath(sFile)
End Function
@@ -5235,12 +5235,12 @@ Public Class Controller
Return sCurrFile
End Function
Public Sub SetModified(Optional ByVal bReloadUI As Boolean = True)
Public Sub SetModified(Optional bReloadUI As Boolean = True)
EgtSetModified()
RaiseEvent UpdateUI(Me, bReloadUI)
End Sub
Public Sub ResetModified(Optional ByVal bReloadUI As Boolean = True)
Public Sub ResetModified(Optional bReloadUI As Boolean = True)
EgtResetModified()
RaiseEvent UpdateUI(Me, bReloadUI)
End Sub
@@ -5297,7 +5297,7 @@ Public Class Controller
'-------------------------------- Registrazione Comandi (in Lua) ---------------------------------
Private m_bCommandLog As Boolean = False
Public Function SetCommandLog(ByVal bCmdLog As Boolean, ByVal sCmdLogDir As String, ByVal sCmdLogFile As String) As Boolean
Public Function SetCommandLog(bCmdLog As Boolean, sCmdLogDir As String, sCmdLogFile As String) As Boolean
' imposto stato
m_bCommandLog = bCmdLog
' se necessario inizializzo logger
+43 -43
View File
@@ -8,17 +8,17 @@ Public Module GenInterface
'-------------------------------- IniFile : Get --------------------------------------------------
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
Public Function GetPrivateProfileInt(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal nDefault As Integer,
ByVal lpFileName As String) As Integer
lpAppName As String,
lpKeyName As String,
nDefault As Integer,
lpFileName As String) As Integer
End Function
Public Function GetPrivateProfileDouble(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal dDefault As Double,
ByVal lpFileName As String) As Double
lpAppName As String,
lpKeyName As String,
dDefault As Double,
lpFileName As String) As Double
Dim sValue As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, dDefault.ToString(), sValue, lpFileName)
Dim nPos As Integer = sValue.IndexOf(";")
@@ -34,19 +34,19 @@ End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
Private Function GetPrivateProfileString(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal lpDefault As String,
ByVal lpReturnedString As StringBuilder,
ByVal nSize As Integer,
ByVal lpFileName As String) As Integer
lpAppName As String,
lpKeyName As String,
lpDefault As String,
lpReturnedString As StringBuilder,
nSize As Integer,
lpFileName As String) As Integer
End Function
Public Function GetPrivateProfileString(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal lpDefault As String,
lpAppName As String,
lpKeyName As String,
lpDefault As String,
ByRef lpString As String,
ByVal lpFileName As String) As Integer
lpFileName As String) As Integer
Dim sb As New StringBuilder(1024)
Dim nRet As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, sb, sb.Capacity, lpFileName)
lpString = sb.ToString
@@ -54,10 +54,10 @@ Public Function GetPrivateProfileString(
End Function
Public Function GetPrivateProfileColor(
ByVal lpAppName As String,
ByVal lpKeyName As String,
lpAppName As String,
lpKeyName As String,
ByRef Col As Color3d,
ByVal lpFileName As String) As Boolean
lpFileName As String) As Boolean
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
@@ -74,11 +74,11 @@ Public Function GetPrivateProfileColor(
End Function
Public Function GetPrivateProfileZoomWin(
ByVal lpAppName As String,
ByVal lpKeyName As String,
lpAppName As String,
lpKeyName As String,
ByRef bOutline As Boolean,
ByRef Col As Color3d,
ByVal lpFileName As String) As Boolean
lpFileName As String) As Boolean
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
@@ -94,14 +94,14 @@ Public Function GetPrivateProfileZoomWin(
End Function
Public Function GetPrivateProfileWinPos(
ByVal lpAppName As String,
ByVal lpKeyName As String,
lpAppName As String,
lpKeyName As String,
ByRef nFlag As Integer,
ByRef nLeft As Integer,
ByRef nTop As Integer,
ByRef nWidth As Integer,
ByRef nHeight As Integer,
ByVal lpFileName As String) As Boolean
lpFileName As String) As Boolean
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
@@ -120,21 +120,21 @@ End Function
'-------------------------------- IniFile : Write ------------------------------------------------
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
Public Function WritePrivateProfileString(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal lpString As String,
ByVal lpFileName As String) As Boolean
lpAppName As String,
lpKeyName As String,
lpString As String,
lpFileName As String) As Boolean
End Function
Public Function WritePrivateProfileWinPos(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal nFlag As Integer,
ByVal nLeft As Integer,
ByVal nTop As Integer,
ByVal nWidth As Integer,
ByVal nHeight As Integer,
ByVal lpFileName As String) As Boolean
lpAppName As String,
lpKeyName As String,
nFlag As Integer,
nLeft As Integer,
nTop As Integer,
nWidth As Integer,
nHeight As Integer,
lpFileName As String) As Boolean
Dim sVal As String
sVal = nFlag.ToString & "," & nLeft.ToString & "," & nTop.ToString & "," & nWidth.ToString & "," & nHeight.ToString
Return WritePrivateProfileString(lpAppName, lpKeyName, sVal, lpFileName)
@@ -143,11 +143,11 @@ End Function
'-------------------------------- System Menu ----------------------------------------------------
<DllImport("user32.dll")>
Public Function GetSystemMenu(ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
Public Function GetSystemMenu(hWnd As IntPtr, bRevert As Boolean) As IntPtr
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto)>
Public Function AppendMenu(ByVal hMenu As IntPtr, ByVal uFlags As Integer,
ByVal uIDNewItem As Integer, ByVal lpNewItem As String) As Boolean
Public Function AppendMenu(hMenu As IntPtr, uFlags As Integer,
uIDNewItem As Integer, lpNewItem As String) As Boolean
End Function
Public Const MF_STRING As UInt32 = &H0
Public Const MF_SEPARATOR As UInt32 = &H800
@@ -156,7 +156,7 @@ Public Const IDM_ABOUTBOX As UInt32 = &H10
'-------------------------------- Windows --------------------------------------------------------
<DllImport("user32.dll")>
Public Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
Public Function ShowWindow(hWnd As IntPtr, nCmdShow As Integer) As Boolean
End Function
Public Enum SW As Integer
HIDE = 0
+2 -2
View File
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
' utilizzando l'asterisco (*) come descritto di seguito:
<Assembly: AssemblyVersion("1.9.5.1")>
<Assembly: AssemblyFileVersion("1.9.5.1")>
<Assembly: AssemblyVersion("1.9.5.2")>
<Assembly: AssemblyFileVersion("1.9.5.2")>
+1 -1
View File
@@ -29,7 +29,7 @@ Namespace My
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)
Private Shared Sub AutoSaveSettings( sender As Global.System.Object, e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class Scene
'UserControl esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+34 -17
View File
@@ -116,7 +116,7 @@ Public Class Scene
End Sub
'---- Initials --------
Public Sub SetViewAttributes(ByVal nDriver As Integer, ByVal b2Buff As Boolean, ByVal nColorBits As Integer, ByVal nDepthBits As Integer)
Public Sub SetViewAttributes(nDriver As Integer, b2Buff As Boolean, nColorBits As Integer, nDepthBits As Integer)
m_nDriver = nDriver
m_b2Buff = b2Buff
m_nColorBits = nColorBits
@@ -124,12 +124,34 @@ Public Class Scene
End Sub
Public Sub SetViewBackground(ByRef BackTopColor As Color3d, ByRef BackBotColor As Color3d)
' Salvo i colori
m_BackTopColor = BackTopColor
m_BackBotColor = BackBotColor
' Se esiste già un contesto, lo aggiorno
If m_nGseContext <> 0 Then
' salvo il contesto corrente e imposto quello della scena
Dim nOldGseCtx = EgtGetCurrentContext()
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(m_nGseContext)
' imposto i colori di sfondo
EgtSetBackground(m_BackTopColor, m_BackBotColor)
' ripristino il contesto originale
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(nOldGseCtx)
End If
End Sub
Public Sub SetDefaultMaterial(ByRef DefColor As Color3d)
' Salvo il colore
m_DefColor = DefColor
' Se esiste già un contesto, lo aggiorno
If m_nGseContext <> 0 Then
' salvo il contesto corrente e imposto quello della scena
Dim nOldGseCtx = EgtGetCurrentContext()
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(m_nGseContext)
' imposto il colore di default
EgtSetDefaultMaterial(m_DefColor)
' ripristino il contesto originale
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(nOldGseCtx)
End If
End Sub
Public Sub SetMarkMaterial(ByRef DefColor As Color3d)
@@ -140,7 +162,7 @@ Public Class Scene
m_SelSurfColor = DefColor
End Sub
Public Sub SetZoomWinAttribs(ByVal bZwOutline As Boolean, ByRef ZwColor As Color3d)
Public Sub SetZoomWinAttribs(bZwOutline As Boolean, ByRef ZwColor As Color3d)
m_bZwOutline = bZwOutline
m_ZwColor = ZwColor
End Sub
@@ -149,7 +171,7 @@ Public Class Scene
m_DstLnColor = DstLnColor
End Sub
Public Sub SetGridCursorPos(ByVal bGridCursorPos As Boolean)
Public Sub SetGridCursorPos(bGridCursorPos As Boolean)
m_bGridCursorPos = bGridCursorPos
End Sub
@@ -254,7 +276,7 @@ Public Class Scene
'---- Mouse -----------
Private m_bSetFocusOnMove As Boolean = True
Public Sub SetFocusOnMove(ByVal bVal As Boolean)
Public Sub SetFocusOnMove(bVal As Boolean)
m_bSetFocusOnMove = bVal
End Sub
@@ -469,9 +491,7 @@ Public Class Scene
Protected Overrides Sub OnMouseUp(e As System.Windows.Forms.MouseEventArgs)
' salvo il contesto corrente e imposto quello della scena
Dim nOldGseCtx = EgtGetCurrentContext()
If nOldGseCtx <> m_nGseContext Then
EgtSetCurrentContext(m_nGseContext)
End If
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(m_nGseContext)
' --- Rilascio tasto sinistro o tasto medio (rotella) ---
If e.Button = Windows.Forms.MouseButtons.Left Or
e.Button = Windows.Forms.MouseButtons.Middle Then
@@ -534,9 +554,7 @@ Public Class Scene
' Evento che può essere gestito da altri
RaiseEvent OnMouseUpScene(Me, e)
' Ripristino il contesto originale
If nOldGseCtx <> m_nGseContext Then
EgtSetCurrentContext(nOldGseCtx)
End If
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(nOldGseCtx)
End Sub
Protected Overrides Sub OnMouseMove(e As System.Windows.Forms.MouseEventArgs)
@@ -719,7 +737,7 @@ Public Class Scene
Return GDB_ID.NULL
End Function
Private Sub ShowCursorPos(ByVal WinXY As Point)
Private Sub ShowCursorPos(WinXY As Point)
' se coord. griglia e non snap a punto in Z
If m_bGridCursorPos And m_nStatus <> ST.SELPOINTZ Then
' calcolo lo snap da utilizzare
@@ -835,7 +853,6 @@ Public Class Scene
End If
End Sub
'---- Contextual Menu management -------------
Private m_bTangentPointOn As Boolean = False
Private m_bPerpendicularPointOn As Boolean = False
@@ -1107,7 +1124,7 @@ Public Class Scene
End Function
'-------------------------------- KeyDown --------------------------------------------------------
Private Sub Scene_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown
Private Sub Scene_KeyDown(sender As System.Object, e As KeyEventArgs) Handles MyBase.KeyDown
' Con selezione punti e drag abilitato
If (m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or m_nStatus = ST.SELPOINT) And m_bDragOn Then
' Con 'S' imposto Punto Sketch
@@ -1249,13 +1266,13 @@ Public Class Scene
If m_nOldStatus = ST.ANALYZE Then RaiseEvent OnCloseAnalyze(Me)
End Sub
Public Sub SetStatusSelPoint(Optional ByVal bAlsoDir As Boolean = False)
Public Sub SetStatusSelPoint(Optional bAlsoDir As Boolean = False)
SaveCurrStatus()
m_nStatus = ST.SELPOINT
m_bAlsoSelDir = bAlsoDir
End Sub
Public Sub ResetStatus(Optional ByVal bRedraw As Boolean = True)
Public Sub ResetStatus(Optional bRedraw As Boolean = True)
ResetStatusAnalyze()
ResetStatusGetDistance()
' Pulisco eventuali geometrie temporanee
@@ -1293,7 +1310,7 @@ Public Class Scene
RaiseEvent OnCloseGetDist(Me)
End Sub
Public Sub SetDragIntersForSelPoint(ByVal bVal As Boolean)
Public Sub SetDragIntersForSelPoint(bVal As Boolean)
m_bAlsoDragIntersForSnap = bVal
End Sub
@@ -1386,7 +1403,7 @@ Public Class Scene
Return True
End Function
Public Function AddToDragGroup(ByVal nId As Integer) As Integer
Public Function AddToDragGroup(nId As Integer) As Integer
' le azioni successive sono temporanee -> non devono cambiare lo stato di modifica del progetto
EgtDisableModified()
' copio entità
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class SelectMulti
'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+3 -3
View File
@@ -55,12 +55,12 @@ Public Class SelectMulti
Me.Close()
End Sub
Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
Private Sub ListBox1_DoubleClick( sender As Object, e As System.EventArgs) Handles ListBox1.DoubleClick
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub ListBox1_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles Me.KeyDown
Private Sub ListBox1_KeyDown( sender As System.Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyData = Keys.Escape Then
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
@@ -79,7 +79,7 @@ Public Class SelectMulti
Public m_sTitle As String
Public m_nId As Integer
Public Sub New(ByVal sTitle As String, ByVal nId As Integer)
Public Sub New( sTitle As String, nId As Integer)
Me.m_sTitle = sTitle
Me.m_nId = nId
End Sub
+1 -1
View File
@@ -14,7 +14,7 @@
Module Utilities
' Verifica se il file è in uso
Public Function FileInUse(ByVal sFile As String) As Boolean
Public Function FileInUse( sFile As String) As Boolean
If System.IO.File.Exists(sFile) Then
Try
Dim F As Short = FreeFile()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnBack
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnExec
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnExport
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnFront
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnImport
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnIso
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnLeft
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnLookFrom
'UserControl esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnNew
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnOpen
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnRendering
'UserControl esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnRight
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnSave
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnTop
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnZoomAll
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnZoomIn
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class btnZoomOut
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class gbLookFrom
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class rbtnHiddenLine
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class rbtnScene
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class rbtnShading
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class rbtnWireframe
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class tsExec
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class tsInfo
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class tsLookFrom
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class tsMain
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class tsRendering
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
+1 -1
View File
@@ -4,7 +4,7 @@ Partial Class tsZoom
'Control esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Protected Overrides Sub Dispose( disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()