diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index f2224b6..1e3b240 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -4,7 +4,7 @@
-
@(descParentSplit(CurrItem))
+
@(descParentSplit(CurrSplit))
@@ -14,14 +14,14 @@
Split
- @if ((CurrItem.nSplitQtyVert == 1 && CurrItem.nSplitQtyHoriz == 0) || (CurrItem.nSplitQtyVert == 0 && CurrItem.nSplitQtyHoriz == 1)) + @if ((CurrSplit.nSplitQtyVert == 1 && CurrSplit.nSplitQtyHoriz == 0) || (CurrSplit.nSplitQtyVert == 0 && CurrSplit.nSplitQtyHoriz == 1)) {
- +
}
- +
- @if (CurrItem.SelSplitShape == Json.WindowConst.SplitShapes.GRID) + @if (CurrSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) {
- +
diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index 9562c05..779cefc 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using Newtonsoft.Json.Linq; using WebWindowComplex.Models; using static WebWindowComplex.Json.WindowConst; @@ -10,13 +11,13 @@ namespace WebWindowComplex.Compo /// Indice dello split corrente rispetto alla lista split /// [Parameter] - public int CurrIndex { get; set; } = 0; + public int CurrIndex { get; set; } = -1; /// /// Split corrente rispetto alla lista split /// [Parameter] - public Split CurrItem { get; set; } = null!; + public Split CurrSplit { get; set; } = null!; /// /// Lista di sash @@ -30,24 +31,12 @@ namespace WebWindowComplex.Compo [CascadingParameter(Name = "SplitList")] public List SplitList { get; set; } = null!; - /// - /// Evento per scambiare le aree di uno split - /// - [Parameter] - public EventCallback EC_SwapTwoAree { get; set; } - /// /// Evento per rimuovere split /// [Parameter] public EventCallback EC_RemoveArea { get; set; } - /// - /// Evento per cambiare nel caso di split a griglia se inizia con lo split verticale - /// - [Parameter] - public EventCallback EC_ChangeStartVert { get; set; } - /// /// Evento per richiedere reset dizionario Shape /// @@ -55,10 +44,10 @@ namespace WebWindowComplex.Compo public EventCallback EC_ReqResetDictShape { get; set; } /// - /// Evento per aggiornare lo split + /// Evento per aggiornare Split /// [Parameter] - public EventCallback EC_UpdateSplit { get; set; } + public EventCallback EC_UpdatePreview { get; set; } /// /// Evento per tornare nella pagine Tree @@ -71,11 +60,14 @@ namespace WebWindowComplex.Compo /// /// split corrente /// - protected async Task SwapTwoAree(Split item) + protected async Task SwapTwoAree() { - // richiesta reset dict shape - _ = EC_ReqResetDictShape.InvokeAsync(true); - await EC_SwapTwoAree.InvokeAsync(item); + CurrSplit.SwapAree(); + var args = new DataUpdateSplit(){ + currSplit = CurrSplit + }; + await EC_ReqResetDictShape.InvokeAsync(true); + await EC_UpdatePreview.InvokeAsync(args); } /// @@ -90,19 +82,110 @@ namespace WebWindowComplex.Compo await EC_RemoveArea.InvokeAsync(item); } + /// + /// Proprietà per restituire o selezionare shape split + /// + /// + protected int SplitShapeIndex + { + get => CurrSplit.SelSplitShapeIndex; + set + { + if (CurrSplit.SelSplitShapeIndex != value) + { + CurrSplit.SelSplitShapeIndex = value; + var args = new DataUpdateSplit() + { + currSplit = CurrSplit + }; + _ = EC_UpdatePreview.InvokeAsync(args); + } + } + } + + /// + /// Proprietà per restituire o selezionare numero di split verticali + /// + /// + protected int SplitQtyVert + { + get => CurrSplit.nSplitQtyVert; + set + { + if (CurrSplit.nSplitQtyVert != value) + { + CurrSplit.nSplitQtyVert = value; + var args = new DataUpdateSplit() + { + currSplit = CurrSplit + }; + _ = EC_UpdatePreview.InvokeAsync(args); + } + } + } + + /// + /// Proprietà per restituire o selezionare numero di split verticali + /// + /// + protected int SplitQtyHoriz + { + get => CurrSplit.nSplitQtyHoriz; + set + { + if (CurrSplit.nSplitQtyHoriz != value) + { + CurrSplit.nSplitQtyHoriz = value; + var args = new DataUpdateSplit() + { + currSplit = CurrSplit + }; + _ = EC_UpdatePreview.InvokeAsync(args); + } + } + } + + protected async Task UpdateDimension(DataUpdateSplitDimension updRec) + { + SplitDimension currSplitDim = updRec.currSplit; + SplitDimension currRec = null; + // cerco il record + if (currSplitDim.bIsVertListDim) + currRec = CurrSplit.SplitVertList.ElementAt(updRec.index); + else + currRec = CurrSplit.SplitHorizList.ElementAt(updRec.index); + // lo aggiorno + if (currSplitDim != null) + { + currRec = currSplitDim; + var args = new DataUpdateSplit() + { + currSplit = CurrSplit + }; + await EC_ReqResetDictShape.InvokeAsync(); + await EC_UpdatePreview.InvokeAsync(args); + } + } + /// /// Sollevo evento per rimuovere split /// /// split corrente /// - protected async Task ChangeStartVert(ChangeEventArgs e, Split item) + protected async Task ChangeStartVert(ChangeEventArgs e) { - var Args = new DataChangeStartVert + foreach (Split s in SplitList) { - eventArg = e, - currItem = item, + if (s.Equals(CurrSplit)) + { + s.SetSplitStartVert((bool)e.Value); + } + } + var args = new DataUpdateSplit() + { + currSplit = CurrSplit }; - await EC_ChangeStartVert.InvokeAsync(Args); + await EC_UpdatePreview.InvokeAsync(args); } /// @@ -155,18 +238,29 @@ namespace WebWindowComplex.Compo protected async Task SetMeasureType(MeasureTypes type) { isOpen = !isOpen; - foreach (var item in CurrItem.SplitVertList) + foreach (var item in CurrSplit.SplitVertList) { item.SetSelMeasureType(type); } - foreach (var item in CurrItem.SplitHorizList) + foreach (var item in CurrSplit.SplitHorizList) { item.SetSelMeasureType(type); } - await EC_UpdateSplit.InvokeAsync(CurrItem); + var args = new DataUpdateSplit() + { + currSplit = CurrSplit + }; + await EC_UpdatePreview.InvokeAsync(args); } } + /// + /// Classe per raggruppare oggetti che servono per aggiornare split + /// + public class DataUpdateSplit + { + public Split currSplit { get; set; } = null!; + } public class DataChangeStartVert { public ChangeEventArgs eventArg { get; set; } = null!; diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor index 9e7c659..ad3f3d5 100644 --- a/WebWindowComplex/Compo/CardTree.razor +++ b/WebWindowComplex/Compo/CardTree.razor @@ -37,6 +37,11 @@ } + @* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || + ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) + { + + } *@ } else diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index 923541a..4a67deb 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -42,6 +42,20 @@ namespace WebWindowComplex.Compo await EC_NextStep.InvokeAsync(Args); } + /// + /// Sollevo evento richiesta prossimo step + /// + /// + private async Task Remove(CompileStep cs, int indexStep) + { + var Args = new DataNextStep + { + currCompileStep = cs, + index = indexStep, + }; + await EC_NextStep.InvokeAsync(Args); + } + /// /// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura /// diff --git a/WebWindowComplex/Compo/EditDimensions.razor b/WebWindowComplex/Compo/EditFrameDimensions.razor similarity index 100% rename from WebWindowComplex/Compo/EditDimensions.razor rename to WebWindowComplex/Compo/EditFrameDimensions.razor diff --git a/WebWindowComplex/Compo/EditDimensions.razor.cs b/WebWindowComplex/Compo/EditFrameDimensions.razor.cs similarity index 94% rename from WebWindowComplex/Compo/EditDimensions.razor.cs rename to WebWindowComplex/Compo/EditFrameDimensions.razor.cs index d94acb8..b0cb573 100644 --- a/WebWindowComplex/Compo/EditDimensions.razor.cs +++ b/WebWindowComplex/Compo/EditFrameDimensions.razor.cs @@ -3,7 +3,7 @@ using WebWindowComplex.Models; namespace WebWindowComplex.Compo { - public partial class EditDimensions + public partial class EditFrameDimensions { #region Public Properties diff --git a/WebWindowComplex/Compo/EditSplitDimensions.razor b/WebWindowComplex/Compo/EditSplitDimensions.razor new file mode 100644 index 0000000..dd35957 --- /dev/null +++ b/WebWindowComplex/Compo/EditSplitDimensions.razor @@ -0,0 +1,32 @@ + +
+
+ @Name + + +
+
diff --git a/WebWindowComplex/Compo/EditSplitDimensions.razor.cs b/WebWindowComplex/Compo/EditSplitDimensions.razor.cs new file mode 100644 index 0000000..5b2f4e3 --- /dev/null +++ b/WebWindowComplex/Compo/EditSplitDimensions.razor.cs @@ -0,0 +1,78 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class EditSplitDimensions + { + #region Public Properties + + [Parameter] + public SplitDimension CurrRec { get; set; } = null!; + + [Parameter] + public string Name { get; set; } = null!; + + [Parameter] + public int Index { get; set; } = -1; + + [Parameter] + public EventCallback EC_Update { get; set; } + + #endregion Public Properties + + #region Private Properties + + private double CurrVal + { + get => CurrRec.dDimension; + set + { + if (CurrRec.dDimension != value) + { + CurrRec.dDimension = value; + var args = new DataUpdateSplitDimension() + { + currSplit = CurrRec, + index = Index + }; + _ = EC_Update.InvokeAsync(args); + } + } + } + + private int CurrType + { + get => CurrRec.SelMeasureTypeIndex; + set + { + if (CurrRec.SelMeasureTypeIndex != value) + { + CurrRec.SelMeasureTypeIndex = value; + var args = new DataUpdateSplitDimension() + { + currSplit = CurrRec, + index=Index + }; + _ = EC_Update.InvokeAsync(args); + } + } + } + + private string SplitDimCss() + { + if (CurrRec.Parent.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID)) + return ""; + else + return "col-md-12 col-lg-6"; + } + + #endregion Private Properties + } + + public class DataUpdateSplitDimension + { + public SplitDimension currSplit { get; set; } = null!; + public int index { get; set; } = -1; + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index 6833f1c..edbc265 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -138,7 +138,7 @@ namespace WebWindowComplex.Models ParentArea.AreaList.Remove(this); } } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + //m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } @@ -229,7 +229,7 @@ namespace WebWindowComplex.Models ParentArea.AreaList.Remove(this); } } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + //m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } @@ -277,7 +277,7 @@ namespace WebWindowComplex.Models newFill.SetAreaType(AreaTypes.FILL); AreaList[SplitIndex].AreaList.Add(newFill); } - m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + //m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } } diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f6cf387..3d6fee2 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -101,12 +101,10 @@ diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 1f79077..a43ba14 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1471,6 +1471,24 @@ namespace WebWindowComplex } } + /// + /// Aggiornamento Frame + /// + /// nuovo frame + /// + private async Task UpdatePreviewSplit(DataUpdateSplit args) + { + Split newSplit = args.currSplit; + if (newSplit != null) + { + // cerco il record + var currRec = SearchArea(FrameWindow, newSplit.GroupId, newSplit); + // lo aggiorno + currRec = newSplit; + await DoPreviewSvg(true, true); + } + } + /// /// Metodo per aggiornare Splitted /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 2ac0d81..ced4217 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.2610 + 2.7.11.2612 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -150,6 +150,18 @@ + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 50db489..e154130 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.11.2610 + 2.7.11.2612 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -222,6 +222,24 @@ + + + + + + + + + + + + + + + + + +