- Modificato ricalcolo aree per modifica elemento

- Testo selezionato in grassetto nei dropdown
This commit is contained in:
Annamaria Sassi
2026-02-20 13:08:54 +01:00
parent e0bb0ddb20
commit 82df3857fb
8 changed files with 143 additions and 72 deletions
+5 -5
View File
@@ -151,9 +151,9 @@
Unità misura
</button>
<ul class="dropdown-menu" style="min-width:5rem; max-width:10rem">
<li><button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">Absolute</button></li>
<li><button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">Proportional</button></li>
<li><button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">Percentage</button></li>
<li><button class="@MeasureTypeCss(MeasureTypes.ABSOLUTE)" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">Absolute</button></li>
<li><button class="@MeasureTypeCss(MeasureTypes.PROPORTIONAL)" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">Proportional</button></li>
<li><button class="@MeasureTypeCss(MeasureTypes.PERCENTAGE)" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">Percentage</button></li>
</ul>
</div>
<div class="dropdown">
@@ -161,8 +161,8 @@
Measure type
</button>
<ul class="dropdown-menu" style="min-width:7rem; max-width:10rem">
<li><button class="dropdown-item" @onclick="() => ChangeTypeDimension(false)">Sash</button></li>
<li><button class="dropdown-item" @onclick="() => ChangeTypeDimension(true)">Glass</button></li>
<li><button class="@TypeDimensionCss(false)" @onclick="() => ChangeTypeDimension(false)">Sash</button></li>
<li><button class="@TypeDimensionCss(true)" @onclick="() => ChangeTypeDimension(true)">Glass</button></li>
</ul>
</div>
</div>
@@ -437,6 +437,23 @@ namespace WebWindowComplex.Compo
return "row mt-2";
}
private string MeasureTypeCss(MeasureTypes type)
{
for (int i = 0; i < CurrSashGroup.SashList.Count; i++)
{
if (!CurrSashGroup.SashList.ElementAt(i).MeasureType.Equals(type))
return "dropdown-item";
}
return "dropdown-item fw-bold";
}
private string TypeDimensionCss(bool type)
{
if(CurrSashGroup.bIsDimensionLight && type)
return "dropdown-item fw-bold";
else if(!CurrSashGroup.bIsDimensionLight && !type)
return "dropdown-item fw-bold";
return "dropdown-item";
}
#endregion Private Methods
}
+4 -26
View File
@@ -31,9 +31,9 @@
Unità misura
</button>
<ul class="dropdown-menu" style="min-width:5rem; max-width:10rem">
<li><button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">Absolute</button></li>
<li><button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">Proportional</button></li>
<li><button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">Percentage</button></li>
<li><button class="@MeasureTypeCss(MeasureTypes.ABSOLUTE)" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">Absolute</button></li>
<li><button class="@MeasureTypeCss(MeasureTypes.PROPORTIONAL)" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">Proportional</button></li>
<li><button class="@MeasureTypeCss(MeasureTypes.PERCENTAGE)" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">Percentage</button></li>
</ul>
</div>
<div class="dropdown">
@@ -41,31 +41,9 @@
Measure type
</button>
<ul class="dropdown-menu" style="min-width:7rem; max-width:10rem">
<li><button class="dropdown-item">Glass</button></li>
<li><button class="dropdown-item fw-bold">Glass</button></li>
</ul>
</div>
@* <div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
Measure
</button>
<ul class="dropdown-menu @(isOpen ? "show" : "")" style="min-width:5rem; max-width:10rem">
<li>
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">
Absolute
</button>
</li>
<li>
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">
Proportional
</button>
</li>
<li>
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">
Percentage
</button>
</li>
</ul>
</div> *@
</div>
<div class="row">
<div class="col-md-12 col-lg-6">
+15
View File
@@ -365,6 +365,21 @@ namespace WebWindowComplex.Compo
int subAreaMin = CurrSplit.ElemDimVertList.Min(x => x.nSubArea);
return CurrSplit.ElemDimVertList.Where(x => x.nSubArea == subAreaMin).ToList();
}
private string MeasureTypeCss(MeasureTypes type)
{
for (int i = 0; i < CurrSplit.SplitVertList.Count; i++)
{
if (!CurrSplit.SplitVertList.ElementAt(i).MeasureType.Equals(type))
return "dropdown-item";
}
for (int i = 0; i < CurrSplit.SplitHorizList.Count; i++)
{
if (!CurrSplit.SplitHorizList.ElementAt(i).MeasureType.Equals(type))
return "dropdown-item";
}
return "dropdown-item fw-bold";
}
}
/// <summary>
+66 -36
View File
@@ -34,12 +34,14 @@ namespace WebWindowComplex.Models
{
if(dDimension != value)
{
if (value > m_dMax)
m_dDimension = m_dMax;
else if (value < m_dMin)
m_dDimension = m_dMin;
else
m_dDimension = value;
if (m_ParentArea is Split split)
{
if (value > m_dMax)
value = m_dMax;
else if (value < m_dMin)
value = m_dMin;
SplitElementDimension splitElem = (SplitElementDimension)this;
List<SplitDimension> elemList = new List<SplitDimension>();
Frame? frame = split.ParentWindow.AreaList.First();
@@ -65,45 +67,73 @@ namespace WebWindowComplex.Models
if(elemList.ElementAt(m_nIndex).MeasureType is MeasureTypes.ABSOLUTE)
elemList.ElementAt(m_nIndex).SetDimension(elemList.ElementAt(m_nIndex).dDimension + diff);
}
}
else if(m_ParentArea is Sash sash && (m_nIndex == 2 || m_nIndex == 4))
{
if (value > m_dMax)
value = m_dMax;
else if (value < m_dMin)
value = m_dMin;
if (sash.bIsDimensionLight)
if (split.SplitHorizList.Count > 0)
{
int indSash = -1;
for(int i = 0; i < sash.SashList.Count; i++)
for (int i = 0; i < split.AreaList.Count; i++)
{
if (sash.SashList.ElementAt(i).ElementDimensionList.Contains(this))
{
indSash = i;
break;
}
if (i < split.SplitHorizList.Count)
split.AreaList.ElementAt(i).SearchAreaList(split.AreaList.ElementAt(i), split.SplitHorizList.ElementAt(i).dDimension, "Width");
}
if(sash.SashList.ElementAt(indSash).MeasureType is MeasureTypes.ABSOLUTE)
}
if (split.SplitVertList.Count > 0)
{
for (int i = 0; i < split.AreaList.Count; i++)
{
if (value > m_dDimension)
{
double diff = (value - m_dDimension);
sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension - diff);
}
else
{
double diff = m_dDimension - value;
sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension + diff);
}
if (i < split.SplitVertList.Count)
split.AreaList.ElementAt(i).SearchAreaList(split.AreaList.ElementAt(i), split.SplitVertList.ElementAt(i).dDimension, "Height");
}
}
}
if (value > m_dMax)
m_dDimension = m_dMax;
else if (value < m_dMin)
m_dDimension = m_dMin;
else
m_dDimension = value;
else if(m_ParentArea is Sash sash)
{
if(m_nIndex == 2 || m_nIndex == 4)
{
if (sash.bIsDimensionLight)
{
int indSash = -1;
for(int i = 0; i < sash.SashList.Count; i++)
{
if (sash.SashList.ElementAt(i).ElementDimensionList.Contains(this))
{
indSash = i;
break;
}
}
if(sash.SashList.ElementAt(indSash).MeasureType is MeasureTypes.ABSOLUTE)
{
if (value > m_dDimension)
{
double diff = (value - m_dDimension);
sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension - diff);
}
else
{
double diff = m_dDimension - value;
sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension + diff);
}
for (int i = 0; i < sash.AreaList.Count; i++)
sash.AreaList.ElementAt(i).SearchAreaList(sash.AreaList.ElementAt(i), sash.SashList.ElementAt(i).dDimension, "Width");
}
}
}
else
{
Frame? frame = sash.ParentWindow.AreaList.FirstOrDefault();
if(frame != null)
{
for (int i = 0; i < sash.AreaList.Count; i++)
sash.AreaList.ElementAt(i).SearchAreaList(sash.AreaList.ElementAt(i), sash.AreaList.ElementAt(i).CalculateHeightArea(frame, frame.AvailHeightArea()), "Height");
}
}
}
else if(m_ParentArea is Frame frame)
{
for (int i = 0; i < frame.AreaList.Count; i++)
{
frame.AreaList.ElementAt(i).SearchAreaList(frame, frame.AvailWidthArea(), "Width");
frame.AreaList.ElementAt(i).SearchAreaList(frame, frame.AvailHeightArea(), "Height");
}
}
}
}
}
+3 -3
View File
@@ -433,8 +433,8 @@ namespace WebWindowComplex.Models
if (AreaList.First() is Sash)
overlap = ElementDimensionList.First().dOverlap +
ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dOverlap;
return dim - ElementDimensionList.ElementAt(0).dDimension -
ElementDimensionList.Last().dDimension +
return dim - ElementDimensionList.First().dDimension -
ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dDimension +
overlap;
}
@@ -462,7 +462,7 @@ namespace WebWindowComplex.Models
overlap = ElementDimensionList.ElementAt(1).dOverlap +
ElementDimensionList.Last().dOverlap;
}
return dim - ElementDimensionList.ElementAt(0).dDimension -
return dim - ElementDimensionList.ElementAt(1).dDimension -
ElementDimensionList.Last().dDimension +
overlap;
}
+26 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.2.1915</Version>
<Version>3.1.2.2013</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -206,6 +206,31 @@