diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb index 00a35e9..2245d2d 100644 --- a/Assembly/Assembly.vb +++ b/Assembly/Assembly.vb @@ -298,10 +298,10 @@ Public Class Assembly m_LockEdgeType = value NotifyPropertyChanged("LockEdgeType") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True - m_LeftJamb.LockEdgeType = value - m_RightJamb.LockEdgeType = value - m_TopJamb.LockEdgeType = value - m_BottomJamb.LockEdgeType = value + m_LeftJamb.SetLockEdgeType(value) + m_RightJamb.SetLockEdgeType(value) + m_TopJamb.SetLockEdgeType(value) + m_BottomJamb.SetLockEdgeType(value) End Set End Property Public Sub SetLockEdgeType(sLockEdgeType As EdgeType) @@ -322,10 +322,10 @@ Public Class Assembly m_HingeEdgeType = value NotifyPropertyChanged("HingeEdgeType") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True - m_LeftJamb.HingeEdgeType = value - m_RightJamb.HingeEdgeType = value - m_TopJamb.HingeEdgeType = value - m_BottomJamb.HingeEdgeType = value + m_LeftJamb.SetHingeEdgeType(value) + m_RightJamb.SetHingeEdgeType(value) + m_TopJamb.SetHingeEdgeType(value) + m_BottomJamb.SetHingeEdgeType(value) End Set End Property Public Sub SetHingeEdgeType(sHingeEdgeType As EdgeType) @@ -346,10 +346,10 @@ Public Class Assembly m_TopType = value NotifyPropertyChanged("TopType") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True - m_LeftJamb.TopType = value - m_RightJamb.TopType = value - m_TopJamb.TopType = value - m_BottomJamb.TopType = value + m_LeftJamb.SetTopType(value) + m_RightJamb.SetTopType(value) + m_TopJamb.SetTopType(value) + m_BottomJamb.SetTopType(value) End Set End Property Public Sub SetTopType(sTopType As EdgeType) @@ -370,10 +370,10 @@ Public Class Assembly m_BottomType = value NotifyPropertyChanged("BottomType") Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True - m_LeftJamb.BottomType = value - m_RightJamb.BottomType = value - m_TopJamb.BottomType = value - m_BottomJamb.BottomType = value + m_LeftJamb.SetBottomType(value) + m_RightJamb.SetBottomType(value) + m_TopJamb.SetBottomType(value) + m_BottomJamb.SetBottomType(value) End Set End Property Public Sub SetBottomType(sBottomType As EdgeType) @@ -1116,14 +1116,12 @@ Public Class Assembly If Not DoorActive.Swing.Contains("I") Then For IndexCompo As Integer = 0 To DoorActive.CompoList.Count - 1 If Not String.IsNullOrEmpty(DoorActive.CompoList(IndexCompo).IdCode) Then - For IndexCompoLeftJamb As Integer = 0 To DoorInactive.CompoList.Count - 1 - If DoorInactive.CompoList(IndexCompoLeftJamb).IdCode = DoorActive.CompoList(IndexCompo).IdCode Then - DoorActive.CompoList(IndexCompo).refJambCompo = DoorInactive.CompoList(IndexCompoLeftJamb) - DoorActive.CompoList(IndexCompo).refJambCompo.IsReadOnly = True + For IndexCompoInactiveDoor As Integer = 0 To DoorInactive.CompoList.Count - 1 + If DoorInactive.CompoList(IndexCompoInactiveDoor).IdCode = DoorActive.CompoList(IndexCompo).IdCode Then + DoorActive.CompoList(IndexCompo).refJambCompo = DoorInactive.CompoList(IndexCompoInactiveDoor) + DoorActive.CompoList(IndexCompo).refJambCompo.IsReadOnly = False DoorActive.CompoList(IndexCompo).IsReadOnly = True - If Not LoadCompoParam(DoorActive.CompoList(IndexCompo)) Then Return - For IndexParam As Integer = 0 To DoorActive.CompoList(IndexCompo).refJambCompo.CompoParamList.Count - 1 Dim CmpPar As CompoParam = DoorActive.CompoList(IndexCompo).CompoParamList(IndexParam) Dim CmpRefPar As CompoParam = DoorActive.CompoList(IndexCompo).refJambCompo.CompoParamList(IndexParam) @@ -1248,6 +1246,7 @@ Public Class Assembly Public Sub UpDateCurrCompoJamb(ByRef CurrCompo As Compo) CurrCompo.refJambCompo.IsReadOnly = False ' devo distinguere il caso della componente sulla porta o sul jamb + If CurrCompo.refJambCompo.CompoParamList.Count <> CurrCompo.CompoParamList.Count Then Return For IndexParam As Integer = 0 To CurrCompo.refJambCompo.CompoParamList.Count - 1 If TypeOf CurrCompo.refJambCompo.CompoParamList(IndexParam) Is TextBoxParam AndAlso CurrCompo.CompoParamList(IndexParam).DDFName = CurrCompo.refJambCompo.CompoParamList(IndexParam).DDFName Then Dim TBoxPar As TextBoxParam = DirectCast(CurrCompo.CompoParamList(IndexParam), TextBoxParam) @@ -1301,7 +1300,10 @@ Public Class Assembly ' Elimino tutti le componenti sul Jamb (che ora diventa di Tipo L) eliminando dalla porta due Map.refPartPageVM.CurrPart = GetArrayPartDoor(1).Door For IndexDeleteCompo As Integer = GetArrayPartDoor(1).Door.CompoList.Count - 1 To 0 Step -1 - Map.refPartPageVM.CurrPart.CompoList(IndexDeleteCompo).Delete() + GetArrayPartDoor(1).Door.CompoList(IndexDeleteCompo).Delete() + Next + For IndexDeleteCompo As Integer = GetArrayPartDoor(0).Door.CompoList.Count - 1 To 0 Step -1 + GetArrayPartDoor(0).Door.CompoList(IndexDeleteCompo).refJambCompo = Nothing Next ' ricarico tutti i riferimenti della porta vecchia sul jamb Map.refPartPageVM.CurrPart = GetArrayPartDoor(0).Door @@ -1337,6 +1339,9 @@ Public Class Assembly TopRabbetJamb() BottomRabbetJamb() HingeRabbetJamb() + For IndexCompo As Integer = 0 To GetArrayPartDoor(0).Door.CompoList.Count - 1 + GetArrayPartDoor(0).Door.CompoList(IndexCompo).SetTemplateSelItem(GetArrayPartDoor(0).Door.CompoList(IndexCompo).TemplateSelItem) + Next NotifyPropertyChanged("CurrAssembly") Case "2" ' passaggio da una porta a due porte OneDoorProperty = False diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb index df0cd01..2164a61 100644 --- a/AssemblyManager/AssemblyManagerVM.vb +++ b/AssemblyManager/AssemblyManagerVM.vb @@ -297,10 +297,10 @@ Public Class AssemblyManagerVM ref_Part.IsActive = False ref_Part.Measure = OptionModule.m_SelectedMeasureUnit ref_Part.Weight = OptionModule.m_Weight - ref_Part.LockEdgeType = OptionModule.m_LockEdgeType - ref_Part.HingeEdgeType = OptionModule.m_HingeEdgeType - ref_Part.TopType = OptionModule.m_TopType - ref_Part.BottomType = OptionModule.m_BottomType + ref_Part.SetLockEdgeType(OptionModule.m_LockEdgeType) + ref_Part.SetHingeEdgeType(OptionModule.m_HingeEdgeType) + ref_Part.SetTopType(OptionModule.m_TopType) + ref_Part.SetBottomType(OptionModule.m_BottomType) ref_Part.LockEdgeMachining = OptionModule.m_LockEdgeMachining ref_Part.HingeEdgeMachining = OptionModule.m_HingeEdgeMachining ref_Part.TopMachining = OptionModule.m_TopMachining diff --git a/CompoPanel/CompoPanelVM.vb b/CompoPanel/CompoPanelVM.vb index 4619933..ad5f0e4 100644 --- a/CompoPanel/CompoPanelVM.vb +++ b/CompoPanel/CompoPanelVM.vb @@ -50,7 +50,6 @@ Public Class CompoPanelVM Sub New() Map.SetRefCompoPanelVM(Me) Dim IndexCompoOrder = 0 - Dim CompoPanelList As List(Of String) = OptionModule.m_CompoPaneOrder ' Lettura file ini per generare bottoni Dim Index As Integer = 1 Dim CompoName As String = String.Empty @@ -63,6 +62,7 @@ Public Class CompoPanelVM End If Dim CompoArray() As String = Directory.GetDirectories(IniFile.m_CompoDir) ' carico i valori dei bottoni con un preciso ordine + Dim CompoPanelList As List(Of String) = OptionModule.m_CompoPaneOrder For IndexCompoOrder = 0 To DdfFile.CompoListOrder.Count - 1 For Index = 0 To CompoArray.Count - 1 ' apro ogni directory e cerco un file di testo di nome Config.ini diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 9dd1848..1e3a208 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -64,6 +64,7 @@ Module ConstIni Public Const S_COMPOORDER As String = "CompoOrder" Public Const K_COMPOORDER_INI As String = "CompoDDFOrder" + Public Const S_COMPOOPANELORDER_INI As String = "CompoPanelOrder" Public Const S_LIGHT As String = "Light" Public Const K_LIGHTUP As String = "LightUp" diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index 999bf78..a04042f 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -203,7 +203,6 @@ Public Class Compo End If If Not String.IsNullOrWhiteSpace(ErrorList) Then EgtOutLog(ErrorList) '---------------------------------------------------------------------------------------------------------------------------------------------- - ' Not IsNothing(Me.refJambCompo) And If Assembly.BuiltReffCompo Then Dim FrameCompoFile As String = String.Empty Dim FrameCompoFileConfig As String = String.Empty @@ -227,7 +226,9 @@ Public Class Compo If File.Exists(CurrCompoPath) Then GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath) GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath) - If String.IsNullOrEmpty(Side) Then Side = Me.CompoType.JambSide + If String.IsNullOrEmpty(Side) Then + ' cerco nell'eleco dei parametri il parametro di nome side + End If '------------------------------------------------------------------------------------------------------------------------------- If IsNothing(Me.refJambCompo) Then Part.CreateRefCompo(Me.CompoType, Me, Map.refAssemblyPageVM.CurrAssembly, FrameCompoFileConfig, FrameCompoFile, Map.refPartPageVM.CurrPart) @@ -249,6 +250,11 @@ Public Class Compo LoadCompoParam(Me) Map.refAssemblyPageVM.CurrAssembly.UpDateCurrCompoJamb(Me) ResetCompoParam() + Else + If Not IsNothing(Me.refJambCompo) Then + Map.refPartPageVM.CurrPart.RemoveRefCompo(Me.refJambCompo) + Me.refJambCompo = Nothing + End If End If End If @@ -332,9 +338,9 @@ Public Class Compo End If ' controllo che esiste il file altrimenti esco If Not File.Exists(CurrItemPath) Then Return + Assembly.BuiltReffCompo = False CurrRefCompo.TemplateSelItem = value ' carico un vettore con le stringhe del file corrente - Assembly.BuiltReffCompo = False Dim ReadCurrCompo() As String = File.ReadAllLines(CurrItemPath) Assembly.BuiltReffCompo = True Dim EndOfFile As Boolean = False @@ -413,7 +419,6 @@ Public Class Compo Else S_CHAPTER = S_GR_PARAM_DEFAULT & DefaultConfig End If - While EgtUILib.GetPrivateProfileString(S_CHAPTER, K_PARAM & ParamIndex, "", sParam, CurrConfig) > 0 If Not String.IsNullOrWhiteSpace(sParam) Then ' leggo il tipo di parametro @@ -955,4 +960,28 @@ Public Class TextBoxOnOffParam Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String)) MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList) End Sub +End Class + +Public Class ComboBoxOnOffParam + Inherits ComboBoxParam + + Private m_IsActive As Boolean = True + Public Property IsActive As Boolean + Get + Return m_IsActive + End Get + Set(value As Boolean) + m_IsActive = value + Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + Map.refSceneManagerVM.RefreshBtn() + End Set + End Property + Public Sub SetIsActive(IsActive As Boolean) + m_IsActive = IsActive + 'NotifyPropertyChanged("IsActive") + End Sub + + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, ItemList As List(Of String), ItemListDDF As List(Of String), sSelItem As String) + MyBase.New(sDDFName, sName, CurrCompo, ItemList, ItemListDDF, sSelItem) + End Sub End Class \ No newline at end of file diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index 5cc21f6..4403080 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -322,8 +322,13 @@ Public Class Part Set(value As EdgeType) m_LockEdgeType = value Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + Map.refSceneManagerVM.RefreshBtn() End Set End Property + Public Sub SetLockEdgeType(LockEdgeType As EdgeType) + m_LockEdgeType = LockEdgeType + NotifyPropertyChanged("LockEdgeType") + End Sub Private m_HingeEdgeType As New EdgeType("", Visibility.Visible) Public Property HingeEdgeType As EdgeType @@ -337,8 +342,13 @@ Public Class Part Set(value As EdgeType) m_HingeEdgeType = value Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + Map.refSceneManagerVM.RefreshBtn() End Set End Property + Public Sub SetHingeEdgeType(HingeEdgeType As EdgeType) + m_HingeEdgeType = HingeEdgeType + NotifyPropertyChanged("HingeEdgeType") + End Sub Private m_TopType As New EdgeType("", Visibility.Visible) Public Property TopType As EdgeType @@ -352,8 +362,13 @@ Public Class Part Set(value As EdgeType) m_TopType = value Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + Map.refSceneManagerVM.RefreshBtn() End Set End Property + Public Sub SetTopType(TopType As EdgeType) + m_TopType = TopType + NotifyPropertyChanged("TopType") + End Sub Private m_BottomType As New EdgeType("", Visibility.Visible) Public Property BottomType As EdgeType @@ -367,8 +382,13 @@ Public Class Part Set(value As EdgeType) m_BottomType = value Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True + Map.refSceneManagerVM.RefreshBtn() End Set End Property + Public Sub SetBottomType(BottomType As EdgeType) + m_BottomType = BottomType + NotifyPropertyChanged("BottomType") + End Sub #End Region @@ -633,78 +653,80 @@ Public Class Part If File.Exists(CurrCompoPath) Then GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, FrameCompoNameDDF, FrameCompoName, CurrCompoPath) GetPrivateProfileJambSide("PositionSide", "Side", Side, CurrCompoPath) - If String.IsNullOrEmpty(Side) Then Side = CurrCompoType.JambSide - Dim FrameCompoDirectory As String - FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\")) - CompoTypeJamb = New CompoType(FrameCompoName, FrameCompoNameDDF, FrameCompoDirectory, Side) + If String.IsNullOrEmpty(Side) Then + ' controllo nell'elenco dei parametri se esiste un parametro di tipo Side + For IndexParam As Integer = 0 To NewCompo.CompoParamList.Count - 1 + If NewCompo.CompoParamList(IndexParam).DDFName.ToLower = "side" Then + Side = DirectCast(NewCompo.CompoParamList(IndexParam), ComboBoxParam).SelItem + Exit For + End If + Next + End If + ' ricontrollo che la stringa non sia vuota + If Not String.IsNullOrEmpty(Side) Then + Dim FrameCompoDirectory As String + FrameCompoDirectory = FrameCompoFileConfig.Remove(FrameCompoFileConfig.LastIndexOf("\")) + CompoTypeJamb = New CompoType(FrameCompoName, FrameCompoNameDDF, FrameCompoDirectory, Side) + NewCompo.CompoType.SetJambSide(Side) + Else + Return + End If Else ' se non trovo nulla nel direttorio indicato carico il direttorio della componente corrente - CompoTypeJamb = New CompoType(CurrCompoType.Name, CurrCompoType.DDFName, CurrCompoType.Path, CurrCompoType.JambSide) + Return End If '------------------------------------------------------------------------------------------------------------------------------------------ Select Case CurrAssembly.DoorNumber Case "1" ' questo select case serve per gestire la posizione degli hardware sui Jamb - Select Case CurrCompoType.JambSide - Case "Hinge" + Select Case CurrCompoType.JambSide.ToLower + Case "hinge" If CurrAssembly.LeftJamb.Swing.Contains("L") Then - NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True Else - NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True End If - Case "Lock" + Case "lock" If CurrAssembly.LeftJamb.Swing.Contains("L") Then - NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True Else - NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True End If - Case "Top" - NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + Case "top" + NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True - Case "Bottom" - NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + Case "bottom" + NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True End Select Case "2" - Select Case CurrCompoType.JambSide - Case "Hinge" + Select Case CurrCompoType.JambSide.ToLower + Case "hinge" If CurrDoor.TypePart = "DO_1" Then - NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + NewCompo.refJambCompo = CurrAssembly.LeftJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True Else - NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo.refJambCompo) + NewCompo.refJambCompo = CurrAssembly.RightJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True End If - Case "Lock" + Case "lock" ' significa che le componenrti stanno solo sulle porte If CurrDoor.TypePart = "DO_1" And Not CurrDoor.Swing.Contains("I") Then - NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(1).Door.AddRefCompo(CurrCompoType) - NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile) + NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(1).Door.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True ElseIf CurrDoor.TypePart = "DO_2" And Not CurrDoor.Swing.Contains("I") Then - NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(0).Door.AddRefCompo(CurrCompoType) - NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile) + NewCompo.refJambCompo = CurrAssembly.GetArrayPartDoor(0).Door.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True End If - Case "Top" - NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile) + Case "top" + NewCompo.refJambCompo = CurrAssembly.TopJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True - Case "Bottom" - NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb) - NewCompo.refJambCompo.SetTemplateSelItem(FrameCompoFile) + Case "bottom" + NewCompo.refJambCompo = CurrAssembly.BottomJamb.AddRefCompo(CompoTypeJamb, FrameCompoFile) NewCompo.refJambCompo.IsReadOnly = True End Select End Select @@ -713,7 +735,7 @@ Public Class Part End Sub 'Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini - Public Function AddRefCompo(CurrCompoType As CompoType) As Compo + Public Function AddRefCompo(CurrCompoType As CompoType, FrameCompoFile As String) As Compo ' creo la stringa che contiene la lista degli errori Dim ErrorList As String = String.Empty ' creo il nuovo compo @@ -730,22 +752,7 @@ Public Class Part NewCompo.TemplateDDFName = DDFName NewCompo.TemplateName = Name NewCompo.TemplateItemList = TemplateList - If Not SetItemTemplate(NewCompo.CompoType.DDFName) = String.Empty Then - NewCompo.SetTemplateSelItemRefCompo(NewCompo.CompoType.DDFName, NewCompo) - Else - ' se esiste un lista di template - If NewCompo.TemplateItemList.Count > 0 Then - Dim SelItemindex As Integer = 0 - ' cerco il primo elemento della lista che abbia estensione lua - While Path.HasExtension(NewCompo.TemplateItemList(SelItemindex)) And SelItemindex < NewCompo.TemplateItemList.Count - 1 - SelItemindex += 1 - End While - ' inizializzo la combobox template - NewCompo.SetTemplateSelItemRefCompo(NewCompo.TemplateItemList(SelItemindex), NewCompo) - - End If - End If - ' se non c'è il template + NewCompo.SetTemplateSelItemRefCompo(FrameCompoFile, NewCompo) Else ' nascondo il template NewCompo.TemplateVisibility = Visibility.Collapsed diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index fca2ae5..af1a298 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -282,7 +282,7 @@ Friend Module OptionModule ' carico l'ordinamento delle componenti DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, DdfFile.CompoListOrder) ' carico l'ordinamento dei bottoni - DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, m_CompoPaneOrder) + DefaultGetPrivateProfileList(S_COMPOOPANELORDER_INI, K_COMPOORDER_INI, m_CompoPaneOrder) '----------------------------------------------------------------------------------------------------------------- Dim ThicknessJamb As String = String.Empty diff --git a/ProjectManager/ProjectManagerVM.vb b/ProjectManager/ProjectManagerVM.vb index 22c30d4..2f81672 100644 --- a/ProjectManager/ProjectManagerVM.vb +++ b/ProjectManager/ProjectManagerVM.vb @@ -188,7 +188,12 @@ Public Class ProjectManagerVM End Select End If Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog - FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir + If String.IsNullOrWhiteSpace(OptionModule.m_sLastProject) Then + FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir + Else + FolderBrowserDialog.SelectedPath = OptionModule.m_sLastProject + End If + ' mostriamo la finestra di dialogo aperta fino alla directory MyProjects If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then ' se la risposta è diversa da OK esce