EgtDOORCreator 2.1i2:

-> gestione del materiale,
-> gestione delle proprietà autoescludenti,
-> aggiunta dello scrollBar nell'inserimento delle componenti,
-> evidenziazione in azzurro delle componenti aggiunte.
This commit is contained in:
Nicola Pievani
2019-10-09 17:04:29 +00:00
parent a041ffe3d6
commit 070e614d80
13 changed files with 671 additions and 214 deletions
+67 -7
View File
@@ -27,9 +27,13 @@ Friend Module OptionModule
Friend m_DisableArch As Visibility = Visibility.Collapsed
Friend m_DisableProperties As Visibility
Friend m_MaterialIsVisible As Visibility = Visibility.Visible
Friend m_PropertList As New ObservableCollection(Of PropertyItem)
Friend m_PropertListJamb As New ObservableCollection(Of PropertyItem)
' lista dei materiali
Friend m_MaterialList As New ObservableCollection(Of MaterialType)
Friend Enum LauncherOpt As Integer
Open_window = 0
Open_last_project = 1
@@ -276,13 +280,41 @@ Friend Module OptionModule
m_bBevelDown = Visibility.Visible
End If
' carico la lista delle proprietà
' carico i nomi dei materiali (NomeDDF/NomeGrafica) e le liste di materiali associate
Dim MaterialList As New ObservableCollection(Of String)
DefaultGetPrivateProfileObservableCollection("Material", "MaterialList", MaterialList)
LoadMaterialList (MaterialList)
' se eiste un solo materiale allora non mostro a vodeo
If MaterialList.Count < 2 then
m_MaterialIsVisible = Visibility.Collapsed
End If
Dim PropertyList As New ObservableCollection(Of String)
DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLIST_INI, PropertyList)
LoadPropertiesList(PropertyList, m_PropertList)
PropertyList.Clear()
DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLISTJAMB_INI, PropertyList)
If PropertyList.Count > 0 Then LoadPropertiesList(PropertyList, m_PropertListJamb)
' se non trovo l'elenco dei materiali allora eseguo le vecchie istruzioni
If Not DefaultGetPrivateProfileMaterialProperties(ConstIni.S_PROPERTIES_INI, "Property", m_MaterialList) then
DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLIST_INI, PropertyList)
m_MaterialIsVisible = Visibility.Collapsed
' carico la vecchia lista di proprietà
LoadPropertiesList(PropertyList, m_PropertList)
' genero una lista fittizia di materiali
MaterialList.Add(GENERICMATERIAL)
LoadMaterialList (MaterialList)
m_MaterialList(0).PropertiesList = m_PropertList
If PropertyList.Count < 1 then
OptionModule.m_DisableProperties = Visibility.Collapsed
End If
PropertyList.Clear()
DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLISTJAMB_INI, PropertyList)
If PropertyList.Count > 0 Then LoadPropertiesList(PropertyList, m_PropertListJamb)
End If
'-------------------------------------------------------------------------------------------------------------------------------
' carico la lista delle proprietà
'Dim PropertyList As New ObservableCollection(Of String)
'DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLIST_INI, PropertyList)
'LoadPropertiesList(PropertyList, m_PropertList)
'PropertyList.Clear()
'DefaultGetPrivateProfileObservableCollection(ConstIni.S_PROPERTIES_INI, ConstIni.K_PROPRTIESLISTJAMB_INI, PropertyList)
'If PropertyList.Count > 0 Then LoadPropertiesList(PropertyList, m_PropertListJamb)
'-------------------------------------------------------------------------------------------------------------------------------
' Leggo le dimensioni della porta dal file Default.ini
Dim IsMM As Boolean = False
@@ -585,6 +617,18 @@ Friend Module OptionModule
End Sub
Friend sub LoadMaterialList (ByVal List As ObservableCollection(Of string))
If IsNothing(List) then Return
For Each Material In List
Dim Item As String() = Material.Split("/"c)
If Item.Count < 2 then
m_MaterialList.Add(New MaterialType(Item(0),Item(0)))
else
m_MaterialList.Add(New MaterialType(Item(0),Item(1)))
End If
Next
End Sub
Friend Sub LoadPropertiesList(List As ObservableCollection(Of String), ByRef ListToBeLoaded As ObservableCollection(Of PropertyItem))
If List.Count = 0 Then
m_DisableProperties = Visibility.Collapsed
@@ -617,10 +661,26 @@ Friend Module OptionModule
End If
End If
Next
Dim bNoneExists As Boolean = false
For Each Item in ListToBeLoaded
If Item.Name = NONE_DDF then
bNoneExists = true
Exit for
End If
Next
If Not bNoneExists then
ListToBeLoaded.Add(New PropertyItem(NONE_DDF, EgtMsg(50703), False))
End If
End Sub
Friend Sub CreateNewPropertiesList(ByRef List As ObservableCollection(Of PropertyItem))
Friend Sub CreateNewPropertiesList(ByRef List As ObservableCollection(Of PropertyItem), ByRef SelectedMaterial As MaterialType)
If OptionModule.m_DisableProperties <> Visibility.Visible Then Return
If OptionModule.m_MaterialList.Count > 1 Then
SelectedMaterial = OptionModule.m_MaterialList(0)
List = OptionModule.m_MaterialList(0).PropertiesList
return
End if
' configurazione senza materiali
If List.Count > 0 Then List.Clear()
For Each Item In OptionModule.m_PropertList
List.Add(New PropertyItem(Item.Name, Item.GraphicName, Item.IsChecked))