- Corretto calcolo dimensione split

- Corretto copia sash in interfaccia
This commit is contained in:
Annamaria Sassi
2025-09-30 15:22:43 +02:00
parent 86fe2e6404
commit c33525d5bc
9 changed files with 129 additions and 347 deletions
+1 -97
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.7.9.3011</Version>
<Version>2.7.9.3015</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -16,99 +16,3 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
</Target>
</Project>
+35 -21
View File
@@ -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;
}
<div class="col-sm-6">
<div class="border mb-2">
<div class="card-body py-2">
@@ -547,28 +555,34 @@
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel@(i * 2 + j + 1)">Handle</label>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit(anta)">Aggiungi split</button>
</div>
</div>
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm">Aggiungi inglesina</button>
</div>
</div>
</div>
<div class="row d-grid d-md-flex justify-content-center">
@for (int k = 1; k <= i * 2 + j; k++)
{
int IndexCopy = k;
int IndexModify = i * 2 + j;
<div class="col-sm-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CopyContentSash(item, IndexCopy, IndexModify)">Copy sash @(k)</button>
@if (!(anta.AreaList[0] is Split))
{
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit(anta)">Aggiungi split</button>
</div>
</div>
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm">Aggiungi inglesina</button>
</div>
</div>
</div>
}
<div class="row d-grid d-md-flex justify-content-center">
@for (int k = 0; k <= item.SashList.Count - 1; k++)
{
@if (k != i * 2 + j)
{
int IndexCopy = k;
int IndexModify = i * 2 + j;
<div class="col-sm-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CopyContentSash(item, IndexCopy, IndexModify)">Copy sash @(k + 1)</button>
</div>
</div>
}
}
</div>
</div>
+5 -5
View File
@@ -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();
+2 -60
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.9.3011</Version>
<Version>2.7.9.3015</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -32,62 +32,4 @@
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
</Target>
</Project>
</Project>
+11 -10
View File
@@ -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
{
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.9.3011</Version>
<Version>2.7.9.3015</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -38,101 +38,4 @@
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
</Target>
</Project>
</Project>
+35 -21
View File
@@ -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;
}
<div class="col-sm-6">
<div class="border mb-2">
<div class="card-body py-2">
@@ -547,28 +555,34 @@
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel@(i * 2 + j + 1)">Handle</label>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit(anta)">Aggiungi split</button>
</div>
</div>
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" >Aggiungi inglesina</button>
</div>
</div>
</div>
<div class="row d-grid d-md-flex justify-content-center">
@for (int k = 1; k <= i * 2 + j; k++)
{
int IndexCopy = k;
int IndexModify = i * 2 + j;
<div class="col-sm-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CopyContentSash(item, IndexCopy, IndexModify)">Copy sash @(k)</button>
@if (!(anta.AreaList[0] is Split))
{
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit(anta)">Aggiungi split</button>
</div>
</div>
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm">Aggiungi inglesina</button>
</div>
</div>
</div>
}
<div class="row d-grid d-md-flex justify-content-center">
@for (int k = 0; k <= item.SashList.Count - 1; k++)
{
@if (k != i * 2 + j)
{
int IndexCopy = k;
int IndexModify = i * 2 + j;
<div class="col-sm-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CopyContentSash(item, IndexCopy, IndexModify)">Copy sash @(k + 1)</button>
</div>
</div>
}
}
</div>
</div>
+5 -5
View File
@@ -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();
+33 -29
View File
@@ -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
{