From c33525d5bca7f02f407095244e44d5c87ea81d33 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 30 Sep 2025 15:22:43 +0200 Subject: [PATCH] - Corretto calcolo dimensione split - Corretto copia sash in interfaccia --- WebWindow.Base/WebWindow.Base.csproj | 98 +---------------- WebWindowComplex/TableComp.razor | 56 ++++++---- WebWindowComplex/TableComp.razor.cs | 10 +- WebWindowComplex/WebWindowComplex.csproj | 62 +---------- WebWindowComplex/Window.cs | 21 ++-- .../WebWindowConfigurator.csproj | 101 +----------------- WebWindowTest/Test.razor | 56 ++++++---- WebWindowTest/Test.razor.cs | 10 +- WebWindowTest/Window.cs | 62 ++++++----- 9 files changed, 129 insertions(+), 347 deletions(-) diff --git a/WebWindow.Base/WebWindow.Base.csproj b/WebWindow.Base/WebWindow.Base.csproj index 9e8530a..474b0a2 100644 --- a/WebWindow.Base/WebWindow.Base.csproj +++ b/WebWindow.Base/WebWindow.Base.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.3011 + 2.7.9.3015 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -16,99 +16,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 0236d89..2ae82aa 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -505,7 +505,15 @@ for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) { SashDimension sash = item.SashList[i * 2 + j]; - Area anta = item.AreaList[i * 2 + j]; + Area anta; + @if (item.AreaList[i * 2 + j] is Splitted) + { + anta = item.AreaList[i * 2 + j]; + } + else + { + anta = item; + }
@@ -547,28 +555,34 @@
-
-
-
- -
-
-
-
- -
-
-
-
- @for (int k = 1; k <= i * 2 + j; k++) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- + @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; +
+
+ +
+
+ } }
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index cd848ee..70658b2 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -543,9 +543,9 @@ namespace WebWindowComplex { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", maxRow, col, i, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", maxRow, col, i, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, 0)); } } maxCol++; @@ -554,9 +554,9 @@ namespace WebWindowComplex { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", row, col, 0, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", row, col, 0, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, 0)); maxCol++; } row++; @@ -760,7 +760,7 @@ namespace WebWindowComplex // Rimuovo riempimento da anta selezionata sashSplitted.AreaList.RemoveAt(0); // Creo la copia dell'anta scelta - Area a = sashItem.AreaList[IndexCopy - 1].AreaList[0].Copy(sashSplitted); + Area a = sashItem.AreaList[IndexCopy].AreaList[0].Copy(sashSplitted); // Aggiungo copia all'anta selezionata sashItem.AreaList[IndexModify].AreaList.Add(a); await DoPreviewSvg(); diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index a556bc4..8de707f 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.3011 + 2.7.9.3015 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -32,62 +32,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/WebWindowComplex/Window.cs b/WebWindowComplex/Window.cs index 5cbc801..4763686 100644 --- a/WebWindowComplex/Window.cs +++ b/WebWindowComplex/Window.cs @@ -2710,8 +2710,13 @@ namespace WebWindowComplex for (var nInd = 0; nInd <= nIndex - 1; nInd++) dRes += RelativeDimList[nInd].dDimension; dRes = (100 - dRes) / (RelativeDimList.Count - nIndex - 1); - for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - RelativeDimList[Ind].SetDimension(dRes); + if (dRes != 0) + { + for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) + RelativeDimList[Ind].SetDimension(dRes); + } + else + return; } else if (RelativeDimList.Count > 1) { @@ -2721,14 +2726,10 @@ namespace WebWindowComplex dRes += RelativeDimList[Ind].dDimension; } dRes = (100 - dRes); - RelativeDimList[nIndex - 1].SetDimension(dRes); - //for (var nInd = 0; nInd <= nIndex - 1; nInd++) - // RelativeDimList[nInd].SetDimension(dRes); - //for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - // dRes += RelativeDimList[Ind].dDimension; - //dRes = (100 - dRes) / (nIndex - 1); - //for (var nInd = 0; nInd <= nIndex - 1; nInd++) - // RelativeDimList[nInd].SetDimension(dRes); + if (dRes != 0) + RelativeDimList[nIndex - 1].SetDimension(dRes); + else + return; } else { diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index b86a03a..b10eac8 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.3011 + 2.7.9.3015 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -38,101 +38,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/WebWindowTest/Test.razor b/WebWindowTest/Test.razor index 1eb7ad8..fa6f094 100644 --- a/WebWindowTest/Test.razor +++ b/WebWindowTest/Test.razor @@ -505,7 +505,15 @@ for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) { SashDimension sash = item.SashList[i * 2 + j]; - Area anta = item.AreaList[i * 2 + j]; + Area anta; + @if (item.AreaList[i * 2 + j] is Splitted) + { + anta = item.AreaList[i * 2 + j]; + } + else + { + anta = item; + }
@@ -547,28 +555,34 @@
-
-
-
- -
-
-
-
- -
-
-
-
- @for (int k = 1; k <= i * 2 + j; k++) - { - int IndexCopy = k; - int IndexModify = i * 2 + j; -
-
- + @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; +
+
+ +
+
+ } }
diff --git a/WebWindowTest/Test.razor.cs b/WebWindowTest/Test.razor.cs index d409a29..a3e0798 100644 --- a/WebWindowTest/Test.razor.cs +++ b/WebWindowTest/Test.razor.cs @@ -543,9 +543,9 @@ namespace WebWindowTest { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", maxRow, col, i, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", maxRow, col, i, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", maxRow, col, i, 0)); } } maxCol++; @@ -554,9 +554,9 @@ namespace WebWindowTest { // Se il nodo ha figli, salvo il numero nell'oggetto if (node.AreaList.Count >= 1) - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", row, col, 0, node.AreaList.Count)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, node.AreaList.Count)); else - ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SH", row, col, 0, 0)); + ItemTableList.Add(new ItemTable(AreaTypes.SASH, "WIN", row, col, 0, 0)); maxCol++; } row++; @@ -760,7 +760,7 @@ namespace WebWindowTest // Rimuovo riempimento da anta selezionata sashSplitted.AreaList.RemoveAt(0); // Creo la copia dell'anta scelta - Area a = sashItem.AreaList[IndexCopy - 1].AreaList[0].Copy(sashSplitted); + Area a = sashItem.AreaList[IndexCopy].AreaList[0].Copy(sashSplitted); // Aggiungo copia all'anta selezionata sashItem.AreaList[IndexModify].AreaList.Add(a); await DoPreviewSvg(); diff --git a/WebWindowTest/Window.cs b/WebWindowTest/Window.cs index c357f8f..b93baea 100644 --- a/WebWindowTest/Window.cs +++ b/WebWindowTest/Window.cs @@ -689,7 +689,7 @@ namespace WebWindowTest } set { - if (value >= 0) + if (value >= 0 && value <= 4) { if (value > m_SashList.Count) { @@ -824,27 +824,30 @@ namespace WebWindowTest } 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); } } @@ -2710,8 +2713,13 @@ namespace WebWindowTest for (var nInd = 0; nInd <= nIndex - 1; nInd++) dRes += RelativeDimList[nInd].dDimension; dRes = (100 - dRes) / (RelativeDimList.Count - nIndex - 1); - for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - RelativeDimList[Ind].SetDimension(dRes); + if (dRes != 0) + { + for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) + RelativeDimList[Ind].SetDimension(dRes); + } + else + return; } else if (RelativeDimList.Count > 1) { @@ -2721,14 +2729,10 @@ namespace WebWindowTest dRes += RelativeDimList[Ind].dDimension; } dRes = (100 - dRes); - RelativeDimList[nIndex - 1].SetDimension(dRes); - //for (var nInd = 0; nInd <= nIndex - 1; nInd++) - // RelativeDimList[nInd].SetDimension(dRes); - //for (var Ind = nIndex + 1; Ind <= RelativeDimList.Count - 1; Ind++) - // dRes += RelativeDimList[Ind].dDimension; - //dRes = (100 - dRes) / (nIndex - 1); - //for (var nInd = 0; nInd <= nIndex - 1; nInd++) - // RelativeDimList[nInd].SetDimension(dRes); + if(dRes != 0) + RelativeDimList[nIndex - 1].SetDimension(dRes); + else + return; } else {