From e1b2c143e2a7814ac97bd819d21674f3caad1b92 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Thu, 2 Oct 2025 14:44:15 +0200 Subject: [PATCH] WebWindowTest e WebWindowComplex: - aggiunta navigazione separata per ogni Fill - aggiunte ombre dei bordi --- WebWindow.Base/WebWindow.Base.csproj | 56 +- WebWindowComplex/ItemTable.cs | 20 +- WebWindowComplex/TableComp.razor | 865 +++++++++-------- WebWindowComplex/TableComp.razor.cs | 85 +- WebWindowComplex/TableComp.razor.css | 10 + WebWindowComplex/WebWindowComplex.csproj | 5 +- WebWindowComplex/Window.cs | 48 +- .../WebWindowConfigurator.csproj | 5 +- WebWindowTest/ItemTable.cs | 20 +- WebWindowTest/Test.razor | 889 +++++++++--------- WebWindowTest/Test.razor.cs | 78 +- WebWindowTest/Test.razor.css | 10 + WebWindowTest/Window.cs | 3 + 13 files changed, 1149 insertions(+), 945 deletions(-) diff --git a/WebWindow.Base/WebWindow.Base.csproj b/WebWindow.Base/WebWindow.Base.csproj index 474b0a2..79c0055 100644 --- a/WebWindow.Base/WebWindow.Base.csproj +++ b/WebWindow.Base/WebWindow.Base.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.3015 + 2.7.10.214 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -16,3 +16,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowComplex/ItemTable.cs b/WebWindowComplex/ItemTable.cs index 7c6e185..b437138 100644 --- a/WebWindowComplex/ItemTable.cs +++ b/WebWindowComplex/ItemTable.cs @@ -61,6 +61,23 @@ namespace WebWindowComplex } } + /// + /// Indica l'indice rispetto al vettore dei fill + /// Se non è un fill vale -1 + /// + private int m_numFill; + public int NumFill + { + get + { + return m_numFill; + } + set + { + m_numFill = value; + } + } + /// /// Indica l'indice rispetto al vettore delle sash /// Se non è una sash vale -1 @@ -95,12 +112,13 @@ namespace WebWindowComplex } } - public ItemTable(AreaTypes elementType, string s_description, int n_row, int n_col, int n_numSash, int n_numChild) + public ItemTable(AreaTypes elementType, string s_description, int n_row, int n_col, int n_numFill, int n_numSash, int n_numChild) { Type = elementType; m_desc = s_description; Row = n_row; Col = n_col; + NumFill = n_numFill; NumSash = n_numSash; NumChild = n_numChild; } diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 2ae82aa..de68516 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -1,6 +1,6 @@ 
-
+
@@ -23,7 +23,7 @@ - @if (SplitList.Count > 0) @@ -42,9 +42,17 @@ } } - + @if(FillList.Count > 0) + { + @for (int i = 0; i < FillList.Count; i++) + { + int Index = i; + + } + } + *@ @@ -52,12 +60,12 @@
- @if (currStep != CompileStep.Template) - { -
+
+ @if (currStep != CompileStep.Template) + { -
- } + } +
@@ -129,6 +137,7 @@ else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) { cs = CompileStep.Fill; + indSash = ItemTableList[i].NumFill; } @@ -156,93 +165,122 @@
-
-
- - -
-
-
-
-
-
+
+
-
Dimension
- @foreach (FrameDimension dimension in FrameWindow.DimensionList) - { -
- @dimension.sName - - mm +
+
+

Frame

- } -
-
-
-
-
-
-
Threshold
-
- - +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
Dimension
+ @foreach (FrameDimension dimension in FrameWindow.DimensionList) + { +
+ @dimension.sName + + mm +
+ } +
+
+
Threshold
+
+ + +
+
+
+
+
+
+
+
+
Joints
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ @foreach (Joint joint in FrameWindow.JointList) + { +
+ + +
+ } +
+
+
+ @if (m_SashList.Count == 0) + { +
+
Bottom rail
+
+
+
+ Quantity + +
+
+ } +
+
-
-
-
-
Frame joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- @foreach (Joint joint in FrameWindow.JointList) - { -
- - -
- } -
-
-
+ @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) {
-
+
Area frame
@@ -268,22 +306,7 @@
}
- @if (m_SashList.Count == 0) - { -
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
- } +
@@ -298,7 +321,7 @@ { Split currSplit = SplitList[i];
-
+
@(descParentSplit(currSplit))
@@ -415,9 +438,9 @@ { Splitted currSplitted = SplittedList[i];
-
+
-
Area split
+
Area split @(i + 1)
@@ -457,186 +480,99 @@
-
-
-
- -
-
-
-
-
-
- Qty sash - -
-
-
-
-
-
+
+
-
Orientation
-
- - -
-
-
-
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
-
- @for (int i = 0; i <= item.SashList.Count / 2; i++) - { - for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) - { - SashDimension sash = item.SashList[i * 2 + j]; - Area anta; - @if (item.AreaList[i * 2 + j] is Splitted) - { - anta = item.AreaList[i * 2 + j]; - } - else - { - anta = item; - } -
-
-
- @if (item.SashList.Count == 1) +
+
+ @if (SashList.Count > 1) { -
Opening
+

Window @(currSash + 1)

} else { -
Sash opening @(i * 2 + j + 1)
+

Window

} +
+
+
+ +
+
+
+
+
- - +
+
+
+
+
+
+ +
+
+
- Dimension - - % + Qty bottom rail +
-
-
- +
+
+
+
+
+
+
+
Joints
-
- -
-
- @if (!(anta.AreaList[0] is Split)) - { -
-
-
- -
+
+
+
-
-
- -
+
+
+
+ +
+
+
+
+ +
+
+
+ @foreach (Joint joint in item.JointList) + { +
+
+ +
} -
- @for (int k = 0; k <= item.SashList.Count - 1; k++) - { - @if (k != i * 2 + j) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- -
-
- } - } + +
+
+
+
+
Hardware
+
+
+
-
-
-
- } - } -
-
-
-
-
-
Sash joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- @foreach (Joint joint in item.JointList) - { -
- - -
- } -
-
-
-
-
-
-
-
-
Hardware
-
-
- +
-
-
+ + + + + + + + + + + + + + +
+
+ Dimension + + % +
+
+
+ +
+
+ +
+
+ @if (!(anta.AreaList[0] is Split)) + { +
+
+
+ +
+
+
+
+ +
+
+
+ } +
+ @for (int k = 0; k <= item.SashList.Count - 1; k++) + { + @if (k != i * 2 + j) + { + int IndexCopy = k; + int IndexModify = i * 2 + j; +
+
+ +
+
+ } + } +
+
+ + } + } +
+
+
+
+
@@ -667,22 +699,56 @@ } else if (currStep == CompileStep.Fill) { -
-
-
-
-
-
-
Area Fill
-
-
-
- + @if (currFill >= FillList.Count || currFill == -1) + { + currStep = CompileStep.Gerarchia; + } + else + { + Fill item = FillList[currFill]; +
+
+
+
+
+
+
+
+

Fill @(currFill + 1)

+
+ @*
+
+ +
+
*@ +
+
+ +
+
+
+
+ +
-
-
- +
+
+
+
Selected all fill
+
+
+
+ +
+
+
+
+ +
@@ -690,58 +756,8 @@
-
- @for (int i = 0; i < FillList.Count; i += 2) - { - Fill currFill = FillList[i]; -
-
-
- @if (FillList.Count == 1) - { -
Fill
- } - else - { -
Fill @(FillList.IndexOf(currFill) + 1)
- } -
- -
-
-
-
- @if (i + 1 < FillList.Count) - { - Fill nextFill = FillList[i + 1]; -
-
-
- @if (FillList.Count == 1) - { -
Fill
- } - else - { -
Fill @(FillList.IndexOf(nextFill) + 1)
- } -
- -
-
-
-
- } - } -
-
+ } } else if (currStep == CompileStep.General) { @@ -749,119 +765,90 @@
-
-
+
+
-
Generic
-
- - +
+
+
General
+
-
- - -
-
-
-
-
-
-
-
Fill type
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
Color
-
- - +
+
+ + +
+
+ + +
-
- - +
+
+
+
+
Fill type
+
+
+
+ + +
+
+ + +
+
+
+
+
+
Color
+
+
+
+ + +
+
+ + +
+
+
- @if (m_SashList.Count > 0) - { -
-
-
-
-
Hardware
-
- - -
-
- - -
-
- - -
-
-
-
-
- }
@@ -873,7 +860,9 @@ @if (currStep != CompileStep.Template) {
- @outSvg +
+ @outSvg +
}
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 70658b2..201d188 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Components; +using Egw.Window.Data; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using Microsoft.Net.Http.Headers; using Newtonsoft.Json; @@ -6,7 +7,7 @@ using Newtonsoft.Json.Linq; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; using System.Runtime.InteropServices; -using Egw.Window.Data; +using WebWindowComplex; using WebWindowComplex.DTO; using WebWindowComplex.Json; using static WebWindowComplex.Json.WindowConst; @@ -264,6 +265,8 @@ namespace WebWindowComplex { currStep = CompileStep.Gerarchia; } + if (SashList.Count > 0) + currAnta = 0; await DoPreviewSvg(); } @@ -342,6 +345,7 @@ namespace WebWindowComplex // Aggiorante liste sash, split, splitted, fill e itemTable UpdateLists(); currSash = -1; + currFill = -1; currStep = CompileStep.Gerarchia; await DoPreviewSvg(); } @@ -522,9 +526,9 @@ namespace WebWindowComplex case AreaTypes.FRAME: { if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, -1, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, -1, 0)); row++; col++; maxRow++; @@ -533,6 +537,7 @@ namespace WebWindowComplex } case AreaTypes.SASH: { + string nWIndow; // Se ha fratelli if ((node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1) || (node.ParentArea != null && node.ParentArea.AreaList.Count > 1)) @@ -541,11 +546,12 @@ namespace WebWindowComplex { if (SashList[i].Equals(node)) { + nWIndow = SashList.Count == 1 ? "" : $"{i + 1}"; // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN" + nWIndow, maxRow, col, -1, i, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN" + nWIndow, maxRow, col, -1, i, 0)); } } maxCol++; @@ -554,9 +560,9 @@ namespace WebWindowComplex { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, -1, 0, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, -1, 0, 0)); maxCol++; } row++; @@ -569,7 +575,16 @@ namespace WebWindowComplex if ((node.ParentArea.AreaList.Count > 1 && node.ParentArea.AreaList[0].Equals(node)) || (node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1 && node.ParentArea.ParentArea.AreaList[0].AreaList[0].Equals(node))) maxCol++; - ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL", maxRow, col, -1, 0)); + int nFill; + for (int i = 0; i < FillList.Count; i++) + { + if (FillList[i].Equals(node)) + { + nFill = i + 1; + ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL" + nFill, maxRow, col, i, -1, 0)); + break; + } + } row++; col++; maxRow++; @@ -582,16 +597,16 @@ namespace WebWindowComplex if (node.ParentArea.AreaList[0].Equals(node) || node.ParentArea.ParentArea.AreaList[0].Equals(node)) maxCol++; if (node.AreaList.Count >= 1 || node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, -1, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, -1, 0)); } else { if (node.AreaList.Count >= 1 || node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, -1, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, -1, 0)); maxCol++; } row++; @@ -738,15 +753,27 @@ namespace WebWindowComplex ///
/// tipo di riempimento (GLASS o WOOD) /// - private async Task ChangeAllFill(WindowConst.FillTypes type) + private async Task ChangeAllFill(FillTypes type) { - foreach (Fill currFill in m_FillList) + foreach (Fill currFill in FillList) { currFill.SetFillType(type); } await DoPreviewSvg(); } + /// + /// Metodo per settare tutti i Fill in contemporanea + /// + /// tipo di riempimento (GLASS o WOOD) + /// + private async Task ChangeOneFill(FillTypes type) + { + Fill fillChange = FillList.ElementAt(currFill); + fillChange.SetFillType(type); + await DoPreviewSvg(); + } + /// /// Metodo per copiare contenuto di un'anta in un'altra anta /// @@ -790,7 +817,9 @@ namespace WebWindowComplex #region Private Fields private CompileStep currStep; + private int currAnta = 0; private int currSash = -1; + private int currFill = -1; private Frame? m_Frame; private List m_SashList = new List(); private List m_SplitList = new List(); @@ -851,6 +880,10 @@ namespace WebWindowComplex currSash = Index; else currSash = -1; + if (newStep == CompileStep.Fill) + currFill = Index; + else + currFill = -1; await DoPreviewSvg(); } @@ -862,6 +895,7 @@ namespace WebWindowComplex { currStep = newStep; currSash = -1; + currFill = -1; } private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e) @@ -886,6 +920,13 @@ namespace WebWindowComplex else return "nav-link text-secondary"; } + else if (testStep == CompileStep.Fill) + { + if ((currFill == 0 && Index == 0) || (currFill == 1 && Index == 1)) + return "nav-link active fw-bold"; + else + return "nav-link text-secondary"; + } return (testStep == currStep) ? "nav-link active fw-bold" : "nav-link text-secondary"; } @@ -922,7 +963,7 @@ namespace WebWindowComplex /// private string headerCss() { - return (currStep == CompileStep.Template) ? "col-8 d-grid gap-1 px-2 d-md-flex justify-content-md-start" : "col-8 d-grid gap-1 px-2 d-md-flex justify-content-md-start"; + return (currStep == CompileStep.Template) ? "col-8 d-grid gap-2 d-md-flex justify-content-md-start" : "col-8 d-grid gap-2 d-md-flex justify-content-md-start"; } /// @@ -934,6 +975,18 @@ namespace WebWindowComplex return (currStep == CompileStep.Template) ? "col-4 d-grid gap-1 d-md-flex justify-content-md-end" : "col-4 d-grid gap-1 d-md-flex justify-content-md-end"; } + /// + /// Calcola bottone selezionato per il Fill + /// + /// + private string buttonFillCss(FillTypes currFillTypes) + { + if (FillList.ElementAt(currFill).SelFillType == currFillTypes) + return "btn btn-secondary btn-sm shadow"; + else + return "btn btn-outline-secondary btn-sm"; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor.css b/WebWindowComplex/TableComp.razor.css index 0b64414..0513846 100644 --- a/WebWindowComplex/TableComp.razor.css +++ b/WebWindowComplex/TableComp.razor.css @@ -25,3 +25,13 @@ color: black; border-color: rgba(255,255,255,0.5); } + +hr { + margin-top: 1rem; + margin-bottom: 1rem; + margin-left: 1rem; + margin-right: 1rem; + max-width: 42rem; + border: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 8de707f..33294a8 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.3015 + 2.7.10.214 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -32,4 +32,5 @@ - \ No newline at end of file + + diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index 4763686..b1d5fdc 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using Egw.Window.Data; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections; using System.Collections.ObjectModel; @@ -8,7 +9,6 @@ using System.Runtime.Intrinsics.Arm; using System.Xml.Linq; using System.Xml.Serialization; using WebWindowComplex.Json; -using Egw.Window.Data; using static WebWindowComplex.Json.WindowConst; using static WebWindowComplex.ParametriOpzioni; @@ -689,7 +689,7 @@ namespace WebWindowComplex } set { - if (value >= 0) + if (value >= 0 && value <= 4) { if (value > m_SashList.Count) { @@ -722,6 +722,8 @@ namespace WebWindowComplex } dLastDimension += m_SashList[SashList.Count - 1].dDimension; SashList[SashList.Count - 1].SetDimension(dLastDimension); + if (value == 1) + SashList[0].SetHasHandle(true); } else { @@ -824,27 +826,30 @@ namespace WebWindowComplex } internal void SetSashQty(int Qty) { - if (Qty > m_SashList.Count) + if (Qty >= 0 && Qty <= 4) { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SashList.Count > 0) + if (Qty > m_SashList.Count) { - dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; - dNewDimension = dLastDimension / (Qty + 1 - nSashQty); - m_SashList[m_SashList.Count - 1].dDimension = dNewDimension; + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SashList.Count > 0) + { + dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; + dNewDimension = dLastDimension / (Qty + 1 - nSashQty); + m_SashList[m_SashList.Count - 1].dDimension = dNewDimension; + } + else + dNewDimension = dLastDimension / (Qty + 1 - nSashQty); + // aggiungo area Sash di default + for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++) + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); + } + else if (Qty < m_SashList.Count) + { + for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= Qty; SplitIndex += -1) + SashList.RemoveAt(SplitIndex); } - else - dNewDimension = dLastDimension / (Qty + 1 - nSashQty); - // aggiungo area Sash di default - for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++) - SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex + 1)); - } - else if (Qty < m_SashList.Count) - { - for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= Qty; SplitIndex += -1) - SashList.RemoveAt(SplitIndex); } } @@ -1928,6 +1933,7 @@ namespace WebWindowComplex internal void SetFillType(FillTypes value) { m_SelFillType = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } public int SelFillTypeIndex { diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index b10eac8..3afa217 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.3015 + 2.7.10.214 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -38,4 +38,5 @@ - \ No newline at end of file + + diff --git a/WebWindowTest/ItemTable.cs b/WebWindowTest/ItemTable.cs index 5b77d64..a45e804 100644 --- a/WebWindowTest/ItemTable.cs +++ b/WebWindowTest/ItemTable.cs @@ -61,6 +61,23 @@ namespace WebWindowTest } } + /// + /// Indica l'indice rispetto al vettore dei fill + /// Se non è un fill vale -1 + /// + private int m_numFill; + public int NumFill + { + get + { + return m_numFill; + } + set + { + m_numFill = value; + } + } + /// /// Indica l'indice rispetto al vettore delle sash /// Se non è una sash vale -1 @@ -95,12 +112,13 @@ namespace WebWindowTest } } - public ItemTable(AreaTypes elementType, string s_description,int n_row, int n_col, int n_numSash, int n_numChild) + public ItemTable(AreaTypes elementType, string s_description,int n_row, int n_col,int n_numFill, int n_numSash, int n_numChild) { Type = elementType; m_desc = s_description; Row = n_row; Col = n_col; + NumFill = n_numFill; NumSash = n_numSash; NumChild = n_numChild; } diff --git a/WebWindowTest/Test.razor b/WebWindowTest/Test.razor index fa6f094..faeefde 100644 --- a/WebWindowTest/Test.razor +++ b/WebWindowTest/Test.razor @@ -1,6 +1,6 @@ 
-
+
@@ -23,7 +23,7 @@ - @if (SplitList.Count > 0) @@ -42,9 +42,17 @@ } } - + @if(FillList.Count > 0) + { + @for (int i = 0; i < FillList.Count; i++) + { + int Index = i; + + } + } + *@ @@ -52,12 +60,12 @@
- @if (currStep != CompileStep.Template) - { -
+
+ @if (currStep != CompileStep.Template) + { -
- } + } +
@@ -129,6 +137,7 @@ else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) { cs = CompileStep.Fill; + indSash = ItemTableList[i].NumFill; } @@ -156,93 +165,122 @@
-
-
- - -
-
-
-
-
-
+
+
-
Dimension
- @foreach (FrameDimension dimension in FrameWindow.DimensionList) - { -
- @dimension.sName - - mm +
+
+

Frame

- } -
-
-
-
-
-
-
Threshold
-
- - +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
Dimension
+ @foreach (FrameDimension dimension in FrameWindow.DimensionList) + { +
+ @dimension.sName + + mm +
+ } +
+
+
Threshold
+
+ + +
+
+
+
+
+
+
+
+
Joints
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ @foreach (Joint joint in FrameWindow.JointList) + { +
+ + +
+ } +
+
+
+ @if (m_SashList.Count == 0) + { +
+
Bottom rail
+
+
+
+ Quantity + +
+
+ } +
+
-
-
-
-
Frame joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- @foreach (Joint joint in FrameWindow.JointList) - { -
- - -
- } -
-
-
+ @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) {
-
+
Area frame
@@ -254,7 +292,7 @@
}
- @if(SashList.Count == 0 && SplitList.Count == 0) + @if (SashList.Count == 0 && SplitList.Count == 0) {
@@ -268,22 +306,7 @@
}
- @if (m_SashList.Count == 0) - { -
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
- } +
@@ -298,7 +321,7 @@ { Split currSplit = SplitList[i];
-
+
@(descParentSplit(currSplit))
@@ -325,7 +348,7 @@ }
-
+
@@ -375,19 +398,19 @@ @if (currSplit.SplitHorizList.Count > 0) {
- @foreach (var dim in currSplit.SplitHorizList) - { -
- Height - - % -
- - } + @foreach (var dim in currSplit.SplitHorizList) + { +
+ Height + + % +
+ + }
}
- @if(currSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) + @if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) {
@@ -415,9 +438,9 @@ { Splitted currSplitted = SplittedList[i];
-
+
-
Area split
+
Area split @(i + 1)
@@ -457,186 +480,99 @@
-
-
-
- -
-
-
-
-
-
- Qty sash - -
-
-
-
-
-
+
+
-
Orientation
-
- - -
-
-
-
-
-
-
-
Bottom rail
-
- Quantity - -
-
-
-
-
-
- @for (int i = 0; i <= item.SashList.Count / 2; i++) - { - for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) - { - SashDimension sash = item.SashList[i * 2 + j]; - Area anta; - @if (item.AreaList[i * 2 + j] is Splitted) - { - anta = item.AreaList[i * 2 + j]; - } - else - { - anta = item; - } -
-
-
- @if (item.SashList.Count == 1) +
+
+ @if (SashList.Count > 1) { -
Opening
+

Window @(currSash + 1)

} else { -
Sash opening @(i * 2 + j + 1)
+

Window

} +
+
+
+ +
+
+
+
+
- - +
+
+
+
+
+
+ +
+
+
- Dimension - - % + Qty bottom rail +
-
-
- +
+
+
+
+
+
+
+
Joints
-
- -
-
- @if (!(anta.AreaList[0] is Split)) - { -
-
-
- -
+
+
+
-
-
- -
+
+
+
+ +
+
+
+
+ +
+
+
+ @foreach (Joint joint in item.JointList) + { +
+
+ +
} -
- @for (int k = 0; k <= item.SashList.Count - 1; k++) - { - @if (k != i * 2 + j) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- -
-
- } - } + +
+
+
+
+
Hardware
+
+
+
-
-
-
- } - } -
-
-
-
-
-
Sash joints
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- @foreach (Joint joint in item.JointList) - { -
- - -
- } -
-
-
-
-
-
-
-
-
Hardware
-
-
- +
-
-
+ + + + + + + + + + + + + + +
+
+ Dimension + + % +
+
+
+ +
+
+ +
+
+ @if (!(anta.AreaList[0] is Split)) + { +
+
+
+ +
+
+
+
+ +
+
+
+ } +
+ @for (int k = 0; k <= item.SashList.Count - 1; k++) + { + @if (k != i * 2 + j) + { + int IndexCopy = k; + int IndexModify = i * 2 + j; +
+
+ +
+
+ } + } +
+
+ + } + } +
+
+
+
+
@@ -667,22 +699,56 @@ } else if (currStep == CompileStep.Fill) { -
-
-
-
-
-
-
Area Fill
-
-
-
- + @if (currFill >= FillList.Count || currFill == -1) + { + currStep = CompileStep.Gerarchia; + } + else + { + Fill item = FillList[currFill]; +
+
+
+
+
+
+
+
+

Fill @(currFill + 1)

+
+ @*
+
+ +
+
*@ +
+
+ +
+
+
+
+ +
-
-
- +
+
+
+
Selected all fill
+
+
+
+ +
+
+
+
+ +
@@ -690,58 +756,8 @@
-
- @for (int i = 0; i < FillList.Count; i += 2) - { - Fill currFill = FillList[i]; -
-
-
- @if (FillList.Count == 1) - { -
Fill
- } - else - { -
Fill @(FillList.IndexOf(currFill) + 1)
- } -
- -
-
-
-
- @if (i + 1 < FillList.Count) - { - Fill nextFill = FillList[i + 1]; -
-
-
- @if (FillList.Count == 1) - { -
Fill
- } - else - { -
Fill @(FillList.IndexOf(nextFill) + 1)
- } -
- -
-
-
-
- } - } -
-
+ } } else if (currStep == CompileStep.General) { @@ -749,119 +765,90 @@
-
-
+
+
-
Generic
-
- - +
+
+
General
+
-
- - -
-
-
-
-
-
-
-
Fill type
-
- - -
-
- - -
-
-
-
-
-
-
-
-
-
Color
-
- - +
+
+ + +
+
+ + +
-
- - +
+
+
+
+
Fill type
+
+
+
+ + +
+
+ + +
+
+
+
+
+
Color
+
+
+
+ + +
+
+ + +
+
+
- @if (m_SashList.Count > 0) - { -
-
-
-
-
Hardware
-
- - -
-
- - -
-
- - -
-
-
-
-
- }
@@ -873,7 +860,9 @@ @if (currStep != CompileStep.Template) {
- @outSvg +
+ @outSvg +
}
diff --git a/WebWindowTest/Test.razor.cs b/WebWindowTest/Test.razor.cs index a3e0798..f542469 100644 --- a/WebWindowTest/Test.razor.cs +++ b/WebWindowTest/Test.razor.cs @@ -264,6 +264,8 @@ namespace WebWindowTest { currStep = CompileStep.Gerarchia; } + if (SashList.Count > 0) + currAnta = 0; await DoPreviewSvg(); } @@ -342,6 +344,7 @@ namespace WebWindowTest // Aggiorante liste sash, split, splitted, fill e itemTable UpdateLists(); currSash = -1; + currFill = -1; currStep = CompileStep.Gerarchia; await DoPreviewSvg(); } @@ -522,9 +525,9 @@ namespace WebWindowTest case AreaTypes.FRAME: { if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, -1, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.FRAME, "FR", row, col, -1, -1, 0)); row++; col++; maxRow++; @@ -533,6 +536,7 @@ namespace WebWindowTest } case AreaTypes.SASH: { + string nWIndow; // Se ha fratelli if ((node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1) || (node.ParentArea != null && node.ParentArea.AreaList.Count > 1)) @@ -541,11 +545,12 @@ namespace WebWindowTest { if (SashList[i].Equals(node)) { + nWIndow = SashList.Count == 1 ? "" : $"{i + 1}"; // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN" + nWIndow, maxRow, col, -1, i, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN" + nWIndow, maxRow, col, -1, i, 0)); } } maxCol++; @@ -554,9 +559,9 @@ namespace WebWindowTest { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, -1, 0, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, -1, 0, 0)); maxCol++; } row++; @@ -569,7 +574,16 @@ namespace WebWindowTest if ((node.ParentArea.AreaList.Count > 1 && node.ParentArea.AreaList[0].Equals(node)) || (node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1 && node.ParentArea.ParentArea.AreaList[0].AreaList[0].Equals(node))) maxCol++; - ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL", maxRow, col, -1, 0)); + int nFill; + for (int i = 0; i < FillList.Count; i++) + { + if (FillList[i].Equals(node)) + { + nFill = i + 1; + ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL" + nFill, maxRow, col, i, -1, 0)); + break; + } + } row++; col++; maxRow++; @@ -582,16 +596,16 @@ namespace WebWindowTest if (node.ParentArea.AreaList[0].Equals(node) || node.ParentArea.ParentArea.AreaList[0].Equals(node)) maxCol++; if (node.AreaList.Count >= 1 || node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, -1, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", maxRow, col, -1, -1, 0)); } else { if (node.AreaList.Count >= 1 || node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, -1, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SPLIT, "SP", row, col, -1, -1, 0)); maxCol++; } row++; @@ -738,15 +752,27 @@ namespace WebWindowTest ///
/// tipo di riempimento (GLASS o WOOD) /// - private async Task ChangeAllFill(WindowConst.FillTypes type) + private async Task ChangeAllFill(FillTypes type) { - foreach (Fill currFill in m_FillList) + foreach (Fill currFill in FillList) { currFill.SetFillType(type); } await DoPreviewSvg(); } + /// + /// Metodo per settare tutti i Fill in contemporanea + /// + /// tipo di riempimento (GLASS o WOOD) + /// + private async Task ChangeOneFill(FillTypes type) + { + Fill fillChange = FillList.ElementAt(currFill); + fillChange.SetFillType(type); + await DoPreviewSvg(); + } + /// /// Metodo per copiare contenuto di un'anta in un'altra anta /// @@ -790,7 +816,9 @@ namespace WebWindowTest #region Private Fields private CompileStep currStep; + private int currAnta = 0; private int currSash = -1; + private int currFill = -1; private Frame? m_Frame; private List m_SashList = new List(); private List m_SplitList = new List(); @@ -851,6 +879,10 @@ namespace WebWindowTest currSash = Index; else currSash = -1; + if (newStep == CompileStep.Fill) + currFill = Index; + else + currFill = -1; await DoPreviewSvg(); } @@ -862,6 +894,7 @@ namespace WebWindowTest { currStep = newStep; currSash = -1; + currFill = -1; } private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e) @@ -886,6 +919,13 @@ namespace WebWindowTest else return "nav-link text-secondary"; } + else if (testStep == CompileStep.Fill) + { + if ((currFill == 0 && Index == 0) || (currFill == 1 && Index == 1)) + return "nav-link active fw-bold"; + else + return "nav-link text-secondary"; + } return (testStep == currStep) ? "nav-link active fw-bold" : "nav-link text-secondary"; } @@ -934,6 +974,18 @@ namespace WebWindowTest return (currStep == CompileStep.Template) ? "col-4 d-grid gap-1 d-md-flex justify-content-md-end" : "col-4 d-grid gap-1 d-md-flex justify-content-md-end"; } + /// + /// Calcola bottone selezionato per il Fill + /// + /// + private string buttonFillCss(FillTypes currFillTypes) + { + if (FillList.ElementAt(currFill).SelFillType == currFillTypes) + return "btn btn-secondary btn-sm"; + else + return "btn btn-outline-secondary btn-sm"; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowTest/Test.razor.css b/WebWindowTest/Test.razor.css index c3d90e3..b0f6d8f 100644 --- a/WebWindowTest/Test.razor.css +++ b/WebWindowTest/Test.razor.css @@ -24,3 +24,13 @@ color: black; border-color: rgba(255,255,255,0.5); } + +hr { + margin-top: 1rem; + margin-bottom: 1rem; + margin-left: 1rem; + margin-right: 1rem; + max-width: 42rem; + border: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} \ No newline at end of file diff --git a/WebWindowTest/Window.cs b/WebWindowTest/Window.cs index b93baea..657aa2a 100644 --- a/WebWindowTest/Window.cs +++ b/WebWindowTest/Window.cs @@ -722,6 +722,8 @@ namespace WebWindowTest } dLastDimension += m_SashList[SashList.Count - 1].dDimension; SashList[SashList.Count - 1].SetDimension(dLastDimension); + if(value == 1) + SashList[0].SetHasHandle(true); } else { @@ -1931,6 +1933,7 @@ namespace WebWindowTest internal void SetFillType(FillTypes value) { m_SelFillType = value; + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } public int SelFillTypeIndex {