Merge branch 'develop'
This commit is contained in:
@@ -162,7 +162,7 @@ namespace Test.UI.Components.Pages
|
||||
{"Frame_Sash_Top_DimMin", 70},
|
||||
{"Frame_Sash_Top_DimStd", 78},
|
||||
{"Frame_Sash_Vertical_DimMax", 110},
|
||||
{"Frame_Sash_Vertical_DimMin", 75},
|
||||
{"Frame_Sash_Vertical_DimMin", 85},
|
||||
{"Frame_Sash_Vertical_DimStd", 95},
|
||||
{"Frame_Slide_Bottom_DimMax", 60},
|
||||
{"Frame_Slide_Bottom_DimMin", 50},
|
||||
|
||||
@@ -119,12 +119,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@* <div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddSplitToSash()">Add split</button>
|
||||
</div>
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddInglesinaToSash()">Add inglesina</button>
|
||||
</div> *@
|
||||
}
|
||||
<button type="button" class="btn-close" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
|
||||
</div>
|
||||
|
||||
@@ -115,6 +115,8 @@ namespace WebWindowComplex.Compo
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = false
|
||||
};
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
_ = EC_ReqElement.InvokeAsync(CurrFrameWindow);
|
||||
_ = EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
@@ -315,7 +317,7 @@ namespace WebWindowComplex.Compo
|
||||
|
||||
private string EditDimensionCss()
|
||||
{
|
||||
if(CurrFrameWindow.DimensionList.Count == 2)
|
||||
if(CurrFrameWindow.DimensionList.Count % 2 == 0)
|
||||
return "col-md-12 col-lg-6";
|
||||
else
|
||||
return "col-md-12 col-lg-4";
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace WebWindowComplex.Compo
|
||||
.ToList();
|
||||
foreach (var item in ElemIndexList)
|
||||
{
|
||||
item.dDimension = updRec.dDimension;
|
||||
item.SetDimension(updRec.dDimension);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<span class="input-group-text">@(name())</span>
|
||||
@if (User)
|
||||
{
|
||||
<input type="text" readonly class="form-control" value="@(CurrRec.dDimension)">
|
||||
<input type="text" readonly class="form-control" title="@Title()" value="@(CurrRec.dDimension)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="text" class="form-control" @bind="@(updateVal)">
|
||||
<input type="text" class="form-control" title="@Title()" @bind="@(updateVal)">
|
||||
}
|
||||
</div>
|
||||
@@ -150,6 +150,11 @@ namespace WebWindowComplex.Compo
|
||||
}
|
||||
}
|
||||
|
||||
private string Title()
|
||||
{
|
||||
return "Max: " + CurrRec.dMaxDim + ", Min: " + CurrRec.dMinDim;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
<span class="input-group-text">@CurrRec.nIndex</span>
|
||||
@if (User)
|
||||
{
|
||||
<input type="text" readonly class="form-control" value="@(CurrRec.dDimension)">
|
||||
<input type="text" readonly class="form-control" title="@Title()" value="@(CurrRec.dDimension)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="text" class="form-control" @bind="@(updateVal)">
|
||||
<input type="text" class="form-control" title="@Title()" @bind="@(updateVal)">
|
||||
}
|
||||
</div>
|
||||
@@ -43,6 +43,11 @@ namespace WebWindowComplex.Compo
|
||||
}
|
||||
}
|
||||
|
||||
private string Title()
|
||||
{
|
||||
return "Max: " + CurrRec.dMaxDim + ", Min: " + CurrRec.dMinDim;
|
||||
}
|
||||
|
||||
//private string name()
|
||||
//{
|
||||
// string ans = "";
|
||||
|
||||
@@ -171,6 +171,12 @@ namespace WebWindowComplex.Models
|
||||
// All'area Split aggiunto le due aree Splitted
|
||||
for (int i = 0; i < 2; i++)
|
||||
AreaList[0].AreaList.Add(newSplittedList[i]);
|
||||
Frame frame = ParentWindow.AreaList.First();
|
||||
if(frame != null)
|
||||
{
|
||||
frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
|
||||
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddInglesina()
|
||||
@@ -271,10 +277,40 @@ namespace WebWindowComplex.Models
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var item in s.SashList)
|
||||
dimList.Add(new AreaDimension(item.dDimension, item.MeasureType, item.Parent));
|
||||
if(nameDim.Equals("Width"))
|
||||
SearchAreaList(node.AreaList.ElementAt(i), s.SashList.ElementAt(i).CalculateAbsoluteValue(dimList, dim), nameDim);
|
||||
else
|
||||
if (nameDim.Equals("Width") && s.SashList.First().ElementDimensionList.Count > 0)
|
||||
{
|
||||
double widthSash = dim;
|
||||
if (s.ParentArea.ParentArea is Split)
|
||||
widthSash = dim + s.SashList.First().ElementDimensionList.Last().dOverlap
|
||||
+ s.SashList.Last().ElementDimensionList.ElementAt(1).dOverlap;
|
||||
double widthAnta = s.SashList.ElementAt(i).CalculateAbsoluteValue(dimList, widthSash);
|
||||
if(s.bIsDimensionLight || s.AreaList.ElementAt(i) is Split)
|
||||
widthAnta = widthAnta - s.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension
|
||||
- s.SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
else if(s.AreaList.ElementAt(i).AreaList != null || s.AreaList.ElementAt(i).AreaList.Count > 0)
|
||||
{
|
||||
if(s.AreaList.ElementAt(i).AreaList.FirstOrDefault() is Split)
|
||||
widthAnta = widthAnta - s.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension
|
||||
- s.SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
|
||||
}
|
||||
SearchAreaList(node.AreaList.ElementAt(i), widthAnta, nameDim);
|
||||
}
|
||||
else if(s.SashList.First().ElementDimensionList.Count > 0)
|
||||
{
|
||||
if(s.ParentArea is Split split && split.SplitHorizList.Count > 0)
|
||||
dim = dim + s.SashList.ElementAt(i).ElementDimensionList.First().dOverlap
|
||||
+ s.SashList.ElementAt(i).ElementDimensionList.ElementAt(s.SashList.ElementAt(i).ElementDimensionList.Count() - 2).dOverlap;
|
||||
if(s.SashBottomRailQty > 0)
|
||||
{
|
||||
foreach (var bottomRail in s.BottomRailElemDimList)
|
||||
dim = dim - bottomRail.dDimension
|
||||
+ bottomRail.dOverlap;
|
||||
}
|
||||
dim = dim - s.SashList.ElementAt(i).ElementDimensionList.First().dDimension
|
||||
- s.SashList.ElementAt(i).ElementDimensionList.ElementAt(s.SashList.ElementAt(i).ElementDimensionList.Count() - 2).dDimension;
|
||||
SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim);
|
||||
}
|
||||
}
|
||||
else if (node.AreaType.Equals(AreaTypes.SPLIT))
|
||||
{
|
||||
@@ -284,8 +320,14 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
foreach (var item in s.SplitHorizList)
|
||||
dimList.Add(new AreaDimension(item.dDimension, item.MeasureType, item.Parent));
|
||||
if(nameDim.Equals("Width"))
|
||||
SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim);
|
||||
if (nameDim.Equals("Width"))
|
||||
{
|
||||
double widthTot = dim;
|
||||
if(s.AreaList.ElementAt(i).AreaList.First() is Sash sash && sash != null)
|
||||
widthTot = widthTot + sash.SashList.Last().ElementDimensionList.ElementAt(1).dOverlap
|
||||
+ sash.SashList.First().ElementDimensionList.Last().dOverlap;
|
||||
SearchAreaList(node.AreaList.ElementAt(i), widthTot, nameDim);
|
||||
}
|
||||
else
|
||||
SearchAreaList(node.AreaList.ElementAt(i), s.SplitHorizList.ElementAt(i).CalculateAbsoluteValue(dimList, dim), nameDim);
|
||||
}
|
||||
@@ -293,8 +335,13 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
foreach (var item in s.SplitVertList)
|
||||
dimList.Add(new AreaDimension(item.dDimension, item.MeasureType, item.Parent));
|
||||
if(nameDim.Equals("Width"))
|
||||
SearchAreaList(node.AreaList.ElementAt(i), s.SplitVertList.ElementAt(i).CalculateAbsoluteValue(dimList, dim), nameDim);
|
||||
if (nameDim.Equals("Width"))
|
||||
{
|
||||
double width = dim;
|
||||
foreach (var elem in s.ElemDimVertList)
|
||||
width = width - elem.dDimension;
|
||||
SearchAreaList(node.AreaList.ElementAt(i), s.SplitVertList.ElementAt(i).CalculateAbsoluteValue(dimList, width), nameDim);
|
||||
}
|
||||
else
|
||||
SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim);
|
||||
}
|
||||
@@ -335,6 +382,22 @@ namespace WebWindowComplex.Models
|
||||
if (countAbsolute == sash.SashList.Count)
|
||||
{
|
||||
double sum = sash.SashList.Sum(x => x.dDimension);
|
||||
if ((sash.ParentArea.ParentArea is Split && split.SplitHorizList.Count > 0))
|
||||
{
|
||||
//Frame? frame = sash.m_ParentWindow.AreaList.FirstOrDefault();
|
||||
//if (frame != null)
|
||||
// dim = dim + frame.ElementDimensionList.ElementAt(1).dOverlap
|
||||
// + frame.ElementDimensionList.Last().dOverlap;
|
||||
//if(sash.SashList.Count == 1)
|
||||
// dim = dim + sash.SashList.First().ElementDimensionList.ElementAt(1).dOverlap;
|
||||
for (int i = 1; i < sash.SashList.Count; i++)
|
||||
dim = dim + sash.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
else if (sash.ParentArea.ParentArea is Split && split.SplitVertList.Count > 0)
|
||||
{
|
||||
dim = dim + sash.SashList.First().ElementDimensionList.ElementAt(1).dOverlap
|
||||
+ sash.SashList.First().ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
if (sash.bIsDimensionLight)
|
||||
{
|
||||
dim = dim - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension
|
||||
@@ -346,27 +409,17 @@ namespace WebWindowComplex.Models
|
||||
+ sash.SashList[i].ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (sash.SashList.Count > 1)
|
||||
{
|
||||
for (int i = 1; i < sash.SashList.Count; i++)
|
||||
dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap
|
||||
+ sash.SashList.First().ElementDimensionList.Last().dOverlap;
|
||||
{
|
||||
dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
}
|
||||
double res = dim - sum;
|
||||
if (res > 0)
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
else if (res < 0)
|
||||
{
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
// Sommo perchè res è negativo
|
||||
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
|
||||
}
|
||||
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
else if (countAbsolute < sash.SashList.Count && countPercentage != sash.SashList.Count && countProportional != sash.SashList.Count)
|
||||
@@ -385,39 +438,36 @@ namespace WebWindowComplex.Models
|
||||
else if (area is Split split)
|
||||
{
|
||||
List<SplitDimension> splitList = new List<SplitDimension>();
|
||||
List<SplitElementDimension> elemList = new List<SplitElementDimension>();
|
||||
double sum = 0;
|
||||
if (nameDim.Equals("Width"))
|
||||
{
|
||||
splitList = split.SplitVertList;
|
||||
foreach (var item in split.ElemDimVertList)
|
||||
sum = sum + item.dDimension;
|
||||
elemList = split.ElemDimVertList;
|
||||
//foreach (var item in split.ElemDimVertList)
|
||||
// sum = sum + item.dDimension;
|
||||
}
|
||||
else
|
||||
{
|
||||
splitList = split.SplitHorizList;
|
||||
foreach (var item in split.ElemDimHorizList)
|
||||
sum = sum + item.dDimension;
|
||||
elemList = split.ElemDimHorizList;
|
||||
//foreach (var item in split.ElemDimHorizList)
|
||||
// sum = sum + item.dDimension;
|
||||
}
|
||||
int countAbsolute = splitList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count();
|
||||
if (countAbsolute != 0 && countAbsolute == splitList.Count)
|
||||
{
|
||||
sum = sum + splitList.Sum(x => x.dDimension);
|
||||
double res = 0;
|
||||
res = dim - sum;
|
||||
if (res > 0)
|
||||
List<AreaDimension> dimensionList = new List<AreaDimension>();
|
||||
foreach (var i in splitList)
|
||||
dimensionList.Add(new AreaDimension(i.dDimension, i.MeasureType, i.Parent));
|
||||
double widthGlass = dim;
|
||||
foreach (var item in elemList)
|
||||
widthGlass = widthGlass - item.dDimension;
|
||||
foreach (var item in splitList)
|
||||
{
|
||||
foreach (var item in splitList)
|
||||
{
|
||||
item.SetDimension(item.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in splitList)
|
||||
{
|
||||
// Sommo perchè res è negativo
|
||||
item.SetDimension(item.dDimension + res / countAbsolute);
|
||||
}
|
||||
double widthPerc = item.ConvertDimension(dimensionList, item.MeasureType, MeasureTypes.PERCENTAGE, sum, splitList.IndexOf(item));
|
||||
item.SetDimension(widthGlass * widthPerc / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace WebWindowComplex.Models
|
||||
/// <param name="oldType"> Vecchio tipo </param>
|
||||
/// <param name="newType"> Nuovo tipo </param>
|
||||
/// <returns></returns>
|
||||
public double ConvertDimension(List<AreaDimension> itemList, MeasureTypes oldType, MeasureTypes newType, double widthTot, int indexSash, double overlap)
|
||||
public double ConvertDimension(List<AreaDimension> itemList, MeasureTypes oldType, MeasureTypes newType, double dimTot, int indexSash)
|
||||
{
|
||||
switch (oldType)
|
||||
{
|
||||
@@ -131,11 +131,11 @@ namespace WebWindowComplex.Models
|
||||
if (newType.Equals(MeasureTypes.PERCENTAGE))
|
||||
{
|
||||
//return Double.Round((m_dDimension / m_Parent.Width) * 100, 1);
|
||||
return (dDimension / widthTot) * 100;
|
||||
return (dDimension / dimTot) * 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Double.Round(CalculatePropVal(itemList, indexSash, widthTot));
|
||||
return Double.Round(CalculatePropVal(itemList, indexSash, dimTot));
|
||||
}
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
@@ -143,12 +143,12 @@ namespace WebWindowComplex.Models
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
//return Double.Round(ConvertFromPropVal(newType), 2);
|
||||
return ConvertFromPropVal(itemList, newType, widthTot);
|
||||
return ConvertFromPropVal(itemList, newType, dimTot);
|
||||
}
|
||||
else
|
||||
{
|
||||
//return Double.Round(ConvertFromPropVal(newType), 1);
|
||||
return ConvertFromPropVal(itemList, newType, widthTot);
|
||||
return ConvertFromPropVal(itemList, newType, dimTot);
|
||||
}
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
@@ -156,11 +156,11 @@ namespace WebWindowComplex.Models
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
//return Double.Round((m_dDimension * m_Parent.Width) / 100, 2);
|
||||
return (dDimension * widthTot) / 100;
|
||||
return (dDimension * dimTot) / 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Double.Round(CalculatePropVal(itemList, indexSash, widthTot));
|
||||
return Double.Round(CalculatePropVal(itemList, indexSash, dimTot));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,8 +262,13 @@ namespace WebWindowComplex.Models
|
||||
else
|
||||
indexSash = itemList.IndexOf(this);
|
||||
int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1;
|
||||
if (!s.bIsDimensionLight)
|
||||
overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2;
|
||||
if (!s.bIsDimensionLight && s.SashList.ElementAt(indexSash).ElementDimensionList.Count > 0)
|
||||
{
|
||||
if(s.SashList.Count > 0)
|
||||
overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2;
|
||||
else
|
||||
overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap;
|
||||
}
|
||||
}
|
||||
return dDimension;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
if(dDimension != value)
|
||||
{
|
||||
double dimensioneOld = m_dDimension;
|
||||
if (value > m_dMax)
|
||||
m_dDimension = m_dMax;
|
||||
else if (value < m_dMin)
|
||||
@@ -53,15 +54,15 @@ namespace WebWindowComplex.Models
|
||||
if(elemList.ElementAt(m_nIndex).MeasureType is MeasureTypes.ABSOLUTE ||
|
||||
elemList.ElementAt(m_nIndex - 1).MeasureType is MeasureTypes.ABSOLUTE)
|
||||
{
|
||||
if (value > m_dDimension)
|
||||
if (m_dDimension > dimensioneOld)
|
||||
{
|
||||
dimTot = dimTot - (value - m_dDimension);
|
||||
dimTot = dimTot - (m_dDimension - dimensioneOld);
|
||||
}
|
||||
else
|
||||
{
|
||||
dimTot = dimTot + (m_dDimension - value);
|
||||
dimTot = dimTot + (dimensioneOld - m_dDimension);
|
||||
}
|
||||
double diff = (m_dDimension - value)/2;
|
||||
double diff = (dimensioneOld - m_dDimension) /2;
|
||||
if(elemList.ElementAt(m_nIndex - 1).MeasureType is MeasureTypes.ABSOLUTE)
|
||||
elemList.ElementAt(m_nIndex - 1).SetDimension(elemList.ElementAt(m_nIndex - 1).dDimension + diff);
|
||||
if(elemList.ElementAt(m_nIndex).MeasureType is MeasureTypes.ABSOLUTE)
|
||||
@@ -69,18 +70,44 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
if (split.SplitHorizList.Count > 0)
|
||||
{
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in split.SplitHorizList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
double height = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailHeightArea());
|
||||
List<SplitElementDimension> horizElemList = split.ElemDimHorizList.Where(x=>x.m_nIndex== 1).ToList();
|
||||
foreach (var elem in horizElemList)
|
||||
height = height - elem.dDimension;
|
||||
for (int i = 0; i < split.AreaList.Count; i++)
|
||||
{
|
||||
if (i < split.SplitHorizList.Count)
|
||||
split.AreaList.ElementAt(i).SearchAreaList(split.AreaList.ElementAt(i), split.SplitHorizList.ElementAt(i).dDimension, "Width");
|
||||
{
|
||||
SplitDimension currSplitDim = split.SplitHorizList[i];
|
||||
double dim = currSplitDim.dDimension;
|
||||
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, height, -1);
|
||||
split.AreaList.ElementAt(i).SearchAreaList(split.AreaList.ElementAt(i), dim, "Height");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (split.SplitVertList.Count > 0)
|
||||
{
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in split.SplitVertList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
double width = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailWidthArea());
|
||||
List<SplitElementDimension> vertElemList = split.ElemDimVertList.Where(x => x.m_nIndex == 1).ToList();
|
||||
foreach (var elem in vertElemList)
|
||||
width = width - elem.dDimension;
|
||||
for (int i = 0; i < split.AreaList.Count; i++)
|
||||
{
|
||||
if (i < split.SplitVertList.Count)
|
||||
split.AreaList.ElementAt(i).SearchAreaList(split.AreaList.ElementAt(i), split.SplitVertList.ElementAt(i).dDimension, "Height");
|
||||
{
|
||||
SplitDimension currSplitDim = split.SplitVertList[i];
|
||||
double dim = currSplitDim.dDimension;
|
||||
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, width, -1);
|
||||
split.AreaList.ElementAt(i).SearchAreaList(split.AreaList.ElementAt(i), dim, "Width");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,18 +128,18 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
if(sash.SashList.ElementAt(indSash).MeasureType is MeasureTypes.ABSOLUTE)
|
||||
{
|
||||
if (value > m_dDimension)
|
||||
if (m_dDimension > dimensioneOld)
|
||||
{
|
||||
double diff = (value - m_dDimension);
|
||||
double diff = (m_dDimension - dimensioneOld);
|
||||
sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension - diff);
|
||||
}
|
||||
else
|
||||
{
|
||||
double diff = m_dDimension - value;
|
||||
double diff = dimensioneOld - m_dDimension;
|
||||
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");
|
||||
for (int i = 0; i < sash.AreaList.Count; i++)
|
||||
sash.AreaList.ElementAt(i).SearchAreaList(sash.AreaList.ElementAt(i), sash.SashList.ElementAt(i).dDimension, "Width");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,6 +199,20 @@ namespace WebWindowComplex.Models
|
||||
return m_dOverlap;
|
||||
}
|
||||
}
|
||||
public double dMaxDim
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dMax;
|
||||
}
|
||||
}
|
||||
public double dMinDim
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dMin;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -213,6 +254,39 @@ namespace WebWindowComplex.Models
|
||||
return newElementDimension;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as ElementDimension);
|
||||
}
|
||||
|
||||
public bool Equals(ElementDimension other)
|
||||
{
|
||||
if (other is null)
|
||||
return false;
|
||||
if (dDimension != other.dDimension)
|
||||
return false;
|
||||
if (dOverlap != other.dOverlap)
|
||||
return false;
|
||||
if (ParentArea != other.ParentArea)
|
||||
return false;
|
||||
if (nIndex != other.nIndex)
|
||||
return false;
|
||||
if (sName != other.sName)
|
||||
return false;
|
||||
if (dMaxDim != other.dMaxDim)
|
||||
return false;
|
||||
if (dMinDim != other.dMinDim)
|
||||
return false;
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
@@ -85,7 +85,27 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SelThreshold = m_ThresholdList.Where(x => x.Type.Equals(value)).First();
|
||||
Threshold? newThreshold = m_ThresholdList.Where(x => x.Type.Equals(value)).FirstOrDefault();
|
||||
if (newThreshold != null)
|
||||
m_SelThreshold = newThreshold;
|
||||
else
|
||||
m_SelThreshold = new Threshold(3, "Bottom");
|
||||
string profileName = "";
|
||||
if (m_SelThreshold.Name.Equals("Threshold"))
|
||||
profileName = "Frame_Sash_Threshold";
|
||||
else
|
||||
profileName = "Frame_Sash_Bottom";
|
||||
ElementDimensionList.First().SetNameElement(profileName);
|
||||
ElementDimensionList.First().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimMin"));
|
||||
ElementDimensionList.First().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimMax"));
|
||||
ElementDimensionList.First().SetDimension(Window.m_ParameterList.GetValueOrDefault(profileName + "_DimStd"));
|
||||
string overlapName = "Sash_Bottom_Overlap";
|
||||
ElementDimensionList.First().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName));
|
||||
if (AreaList.Count > 0)
|
||||
{
|
||||
SearchAreaList(this, AvailWidthArea(), "Width");
|
||||
SearchAreaList(this, AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,6 +453,11 @@ namespace WebWindowComplex.Models
|
||||
if (AreaList.First() is Sash)
|
||||
overlap = ElementDimensionList.First().dOverlap +
|
||||
ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dOverlap;
|
||||
if(BottomRailQty > 0)
|
||||
{
|
||||
foreach (var bottomRail in BottomRailElemDimList)
|
||||
dim = dim - bottomRail.dDimension;
|
||||
}
|
||||
return dim - ElementDimensionList.First().dDimension -
|
||||
ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dDimension +
|
||||
overlap;
|
||||
@@ -456,12 +481,12 @@ namespace WebWindowComplex.Models
|
||||
if(AreaList.First() is Sash)
|
||||
overlap = ElementDimensionList.ElementAt(1).dOverlap +
|
||||
ElementDimensionList.Last().dOverlap;
|
||||
if (AreaList.First() is Split split)
|
||||
{
|
||||
if(split.SplitHorizList.Count > 0)
|
||||
overlap = ElementDimensionList.ElementAt(1).dOverlap +
|
||||
ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
//if (AreaList.First() is Split split)
|
||||
//{
|
||||
// if(split.SplitHorizList.Count > 0)
|
||||
// overlap = ElementDimensionList.ElementAt(1).dOverlap +
|
||||
// ElementDimensionList.Last().dOverlap;
|
||||
//}
|
||||
return dim - ElementDimensionList.ElementAt(1).dDimension -
|
||||
ElementDimensionList.Last().dDimension +
|
||||
overlap;
|
||||
@@ -694,7 +719,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SelThreshold = m_ThresholdList.FirstOrDefault() ?? new Threshold(1, "Bottom");
|
||||
m_SelThreshold = m_ThresholdList.FirstOrDefault() ?? new Threshold(3, "Bottom");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,18 +123,10 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
}
|
||||
Frame? f = (Frame)Parent;
|
||||
double dimAvail = 0;
|
||||
if (ParentFrame.AreaList.Count > 0 && sName.Equals("Width") && f != null)
|
||||
{
|
||||
dimAvail = f.AvailWidthArea();
|
||||
ParentFrame.SearchAreaList(ParentFrame, dimAvail, "Width");
|
||||
}
|
||||
else if(f != null)
|
||||
{
|
||||
dimAvail = f.AvailHeightArea();
|
||||
ParentFrame.SearchAreaList(ParentFrame, dimAvail, "Height");
|
||||
}
|
||||
if (ParentFrame.AreaList.Count > 0 && sName.Equals("Width") && ParentFrame != null)
|
||||
ParentFrame.SearchAreaList(ParentFrame, ParentFrame.AvailWidthArea(), "Width");
|
||||
else if(ParentFrame != null)
|
||||
ParentFrame.SearchAreaList(ParentFrame, ParentFrame.AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,14 +345,17 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
|
||||
}
|
||||
deleteDim = ad.ConvertDimension(adList, itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot, m_SashList.IndexOf(itemDelete), SashList.Last().ElementDimensionList.Last().dOverlap);
|
||||
deleteDim = ad.ConvertDimension(adList, itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot, m_SashList.IndexOf(itemDelete));
|
||||
}
|
||||
else
|
||||
{
|
||||
deleteDim = itemDelete.dDimension;
|
||||
}
|
||||
dLastDimension = deleteDim + m_SashList[SashList.Count - 1].dDimension + splitDelete;
|
||||
SashList[SashList.Count - 1].SetDimension(dLastDimension);
|
||||
if(SashList[SashList.Count - 1].SelMeasureType is MeasureTypes.PROPORTIONAL && SashList.Count == 1)
|
||||
SashList[SashList.Count - 1].SetDimension(1);
|
||||
else
|
||||
SashList[SashList.Count - 1].SetDimension(dLastDimension);
|
||||
if (value == 1)
|
||||
SashList.First().SetHasHandle(true);
|
||||
}
|
||||
@@ -430,7 +433,13 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), SashList.ElementAt(i).dDimension, "Width");
|
||||
{
|
||||
double width = SashList.ElementAt(i).dDimension;
|
||||
if(SashList.ElementAt(i).ElementDimensionList.Count > 0)
|
||||
width = width - SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension
|
||||
- SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), width, "Width");
|
||||
}
|
||||
}
|
||||
RefreshHardwareList();
|
||||
ClearHardwareOptionList();
|
||||
@@ -484,6 +493,7 @@ namespace WebWindowComplex.Models
|
||||
BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin"));
|
||||
BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax"));
|
||||
BottomRailElemDimList.Last().SetDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimStd"));
|
||||
BottomRailElemDimList.Last().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault("Sash_BottomRail_Overlap"));
|
||||
if (value > 1 && BottomRailElemDimList.Count - 2 >= 0)
|
||||
{
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetNameElement("Sash_Rail");
|
||||
@@ -514,6 +524,10 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
m_bSashBottomRail = false;
|
||||
}
|
||||
Frame frame = ParentWindow.AreaList.First();
|
||||
if (frame.AreaList.Count > 0 && frame != null)
|
||||
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
//ParentWindow.AreaList.First().SearchAreaList(ParentWindow.AreaList.First(), ParentWindow.AreaList.First().AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1135,32 +1149,22 @@ namespace WebWindowComplex.Models
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash)
|
||||
{
|
||||
string overlapName = string.Join("_", split.ElemDimVertList.First().sName.Split('_').Skip(1)) + "_Top_Overlap";
|
||||
if (i == 0)
|
||||
{
|
||||
dim = dim + frame.ElementDimensionList.Last().dOverlap
|
||||
+ Window.m_ParameterList.GetValueOrDefault(overlapName);
|
||||
}
|
||||
else if (i == split.SplitVertList.Count - 1)
|
||||
{
|
||||
dim = dim + frame.ElementDimensionList.ElementAt(1).dOverlap
|
||||
+ Window.m_ParameterList.GetValueOrDefault(overlapName);
|
||||
}
|
||||
else
|
||||
{
|
||||
dim = dim + Window.m_ParameterList.GetValueOrDefault(overlapName)
|
||||
+ Window.m_ParameterList.GetValueOrDefault(overlapName);
|
||||
}
|
||||
}
|
||||
if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash sash)
|
||||
dim = dim + sash.SashList.First().ElementDimensionList.Last().dOverlap
|
||||
+ sash.SashList.Last().ElementDimensionList.ElementAt(1).dOverlap;
|
||||
res = CalculateWidthSashGroup(item, dim, res);
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CalculateWidthSashGroup(item, width, res);
|
||||
double dim = width;
|
||||
if(split.SplitHorizList.Count > 0 && split.AreaList.First().AreaList.First() is Sash sash)
|
||||
{
|
||||
dim = dim + sash.SashList.First().ElementDimensionList.Last().dOverlap
|
||||
+ sash.SashList.Last().ElementDimensionList.ElementAt(1).dOverlap;
|
||||
}
|
||||
res = CalculateWidthSashGroup(item, dim, res);
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
}
|
||||
@@ -1195,12 +1199,6 @@ namespace WebWindowComplex.Models
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
}
|
||||
else if (area is Frame frame)
|
||||
{
|
||||
res = CalculateWidthSashGroup(item, frame.AvailWidthArea(), res);
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CalculateWidthSashGroup(item, width, res);
|
||||
|
||||
@@ -289,12 +289,6 @@ namespace WebWindowComplex.Models
|
||||
break;
|
||||
}
|
||||
}
|
||||
double overlapCurrSash = 0;
|
||||
if (!Parent.bIsDimensionLight)
|
||||
{
|
||||
int j = nIndex == 0 ? 1 : Parent.SashList.ElementAt(nIndex).ElementDimensionList.Count - 1;
|
||||
overlapCurrSash = Parent.SashList.ElementAt(nIndex).ElementDimensionList.ElementAt(j).dOverlap / 2;
|
||||
}
|
||||
int indexDimChange = 0;
|
||||
// L'anta modificata non è l'ultima
|
||||
if (nIndex < absoluteValList.Count - 1)
|
||||
@@ -302,20 +296,14 @@ namespace WebWindowComplex.Models
|
||||
// L'anta modificata è l'ultima
|
||||
else if (dimensions.Count > 1)
|
||||
indexDimChange = nIndex - 1;
|
||||
double overlap = 0;
|
||||
if (!Parent.bIsDimensionLight)
|
||||
{
|
||||
int j = indexDimChange == 0 ? 1 : Parent.SashList.ElementAt(nIndex + 1).ElementDimensionList.Count - 1;
|
||||
overlap = Parent.SashList.ElementAt(indexDimChange).ElementDimensionList.ElementAt(j).dOverlap / 2;
|
||||
}
|
||||
if (value < m_dDimension)
|
||||
{
|
||||
absoluteValList[indexDimChange] = absoluteValList[indexDimChange] + (absoluteValList[nIndex] - (valueInAbsolute - overlapCurrSash)) + overlap;
|
||||
absoluteValList[indexDimChange] = absoluteValList[indexDimChange] + (absoluteValList[nIndex] - valueInAbsolute);
|
||||
absoluteValList[nIndex] = valueInAbsolute;
|
||||
}
|
||||
else
|
||||
{
|
||||
absoluteValList[indexDimChange] = absoluteValList[indexDimChange] - ((valueInAbsolute - overlapCurrSash) - absoluteValList[nIndex]) + overlap;
|
||||
absoluteValList[indexDimChange] = absoluteValList[indexDimChange] - (valueInAbsolute - absoluteValList[nIndex]);
|
||||
absoluteValList[nIndex] = valueInAbsolute;
|
||||
}
|
||||
if (MeasureType.Equals(MeasureTypes.PROPORTIONAL))
|
||||
@@ -327,7 +315,27 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
foreach(var item in m_Parent.AreaList)
|
||||
item.SearchAreaList(item, dDimension, "Width");
|
||||
{
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in Parent.SashList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
double dim = dDimension;
|
||||
if (!(MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
{
|
||||
double width = Parent.CalculateWidthArea(frame, frame.AvailWidthArea());
|
||||
dim = ConvertDimension(dimList, MeasureType, MeasureTypes.ABSOLUTE, width, -1);
|
||||
}
|
||||
if (item.AreaList.First() is Split s)
|
||||
{
|
||||
if (s.SplitVertList.Count > 0)
|
||||
{
|
||||
int indexSash = m_Parent.AreaList.IndexOf(item);
|
||||
dim = dim - Parent.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(1).dDimension
|
||||
- Parent.SashList.ElementAt(indexSash).ElementDimensionList.Last().dDimension;
|
||||
}
|
||||
}
|
||||
item.SearchAreaList(item, dim, "Width");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,15 +437,15 @@ namespace WebWindowComplex.Models
|
||||
adList.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType, it.Parent));
|
||||
}
|
||||
double overlap = 0;
|
||||
if (!Parent.bIsDimensionLight)
|
||||
{
|
||||
int index = m_Parent.SashList.IndexOf(this);
|
||||
if (index == 0)
|
||||
overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.ElementAt(1).dOverlap;
|
||||
else
|
||||
overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(adList, SelMeasureType, newType, widthTot, nSashId - 1, overlap);
|
||||
//if (!Parent.bIsDimensionLight)
|
||||
//{
|
||||
// int index = m_Parent.SashList.IndexOf(this);
|
||||
// if (index == 0)
|
||||
// overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.ElementAt(1).dOverlap;
|
||||
// else
|
||||
// overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap;
|
||||
//}
|
||||
m_dDimension = ad.ConvertDimension(adList, SelMeasureType, newType, widthTot, nSashId - 1);
|
||||
SelMeasureType = (MeasureTypes)value;
|
||||
}
|
||||
}
|
||||
@@ -540,27 +548,23 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent);
|
||||
//if(SelMeasureType is MeasureTypes.ABSOLUTE)
|
||||
// ad = new AreaDimension(dDimension - ElementDimensionList.ElementAt(1).dOverlap, SelMeasureType);
|
||||
//else
|
||||
// ad = new AreaDimension(dDimension, SelMeasureType);
|
||||
List<AreaDimension> newDimensions = new List<AreaDimension>();
|
||||
foreach(var item in m_Parent.SashList)
|
||||
{
|
||||
newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent));
|
||||
}
|
||||
int index = m_Parent.SashList.IndexOf(this);
|
||||
double overlap = 0;
|
||||
if (index == 0)
|
||||
overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.ElementAt(1).dOverlap;
|
||||
else
|
||||
overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap;
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, indexSash, overlap);
|
||||
if (newType is MeasureTypes.PROPORTIONAL)
|
||||
{
|
||||
for (int i = 0; i < newDimensions.Count; i++)
|
||||
m_Parent.SashList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
}
|
||||
//double overlap = 0;
|
||||
//if (index == 0)
|
||||
// overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.ElementAt(1).dOverlap;
|
||||
//else
|
||||
// overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap;
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, indexSash);
|
||||
//if (newType is MeasureTypes.PROPORTIONAL)
|
||||
//{
|
||||
// for (int i = 0; i < newDimensions.Count; i++)
|
||||
// m_Parent.SashList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
//}
|
||||
SelMeasureType = (MeasureTypes)value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,22 +205,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SplitHorizList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
{
|
||||
if (i < SplitHorizList.Count)
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), SplitHorizList.ElementAt(i).dDimension, "Width");
|
||||
}
|
||||
}
|
||||
if (SplitVertList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
{
|
||||
if (i < SplitVertList.Count)
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), SplitVertList.ElementAt(i).dDimension, "Height");
|
||||
}
|
||||
}
|
||||
//UpdateSubAreaSplit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,22 +356,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
}
|
||||
if(SplitHorizList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
{
|
||||
if(i < SplitHorizList.Count)
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), SplitHorizList.ElementAt(i).dDimension, "Width");
|
||||
}
|
||||
}
|
||||
if (SplitVertList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
{
|
||||
if(i < SplitVertList.Count)
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), SplitVertList.ElementAt(i).dDimension, "Height");
|
||||
}
|
||||
}
|
||||
//UpdateSubAreaSplit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -438,6 +408,7 @@ namespace WebWindowComplex.Models
|
||||
AreaList[SplitIndex].AreaList.Add(newFill);
|
||||
}
|
||||
}
|
||||
UpdateSubAreaSplit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,6 +733,56 @@ namespace WebWindowComplex.Models
|
||||
return dim;
|
||||
}
|
||||
|
||||
internal void UpdateSubAreaSplit()
|
||||
{
|
||||
if (SplitHorizList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
{
|
||||
if (i < SplitHorizList.Count)
|
||||
{
|
||||
SplitDimension currSplitDim = SplitHorizList[i];
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in SplitHorizList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
double width = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailWidthArea());
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), width, "Width");
|
||||
double dim = currSplitDim.dDimension;
|
||||
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
{
|
||||
double height = ParentArea.CalculateHeightArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailHeightArea());
|
||||
foreach (var elem in ElemDimHorizList)
|
||||
height = height - elem.dDimension;
|
||||
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, height, -1);
|
||||
}
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), dim, "Height");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SplitVertList.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < AreaList.Count; i++)
|
||||
{
|
||||
if (i < SplitVertList.Count)
|
||||
{
|
||||
SplitDimension currSplitDim = SplitVertList[i];
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in SplitVertList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
double dim = currSplitDim.dDimension;
|
||||
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
{
|
||||
double width = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailWidthArea());
|
||||
foreach (var elem in ElemDimVertList)
|
||||
width = width - elem.dDimension;
|
||||
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, width, -1);
|
||||
}
|
||||
AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), dim, "Width");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -51,17 +51,27 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
double dimensionTot = 0;
|
||||
List<SplitDimension> dimensions = new List<SplitDimension>();
|
||||
Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault()?? new Frame(null, Parent.ParentWindow);
|
||||
Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault() ?? new Frame(null, Parent.ParentWindow);
|
||||
double width = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
|
||||
foreach (var item in m_Parent.ElemDimVertList)
|
||||
{
|
||||
width = width - item.dDimension;
|
||||
}
|
||||
double height = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
|
||||
foreach (var item in m_Parent.ElemDimHorizList)
|
||||
{
|
||||
height = height - item.dDimension;
|
||||
}
|
||||
if (bIsVertListDim)
|
||||
{
|
||||
dimensions = m_Parent.SplitVertList;
|
||||
dimensionTot = CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension;
|
||||
dimensionTot = width;
|
||||
}
|
||||
else
|
||||
{
|
||||
dimensions = m_Parent.SplitHorizList;
|
||||
//dimensionTot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
dimensionTot = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
|
||||
dimensionTot = height;
|
||||
|
||||
}
|
||||
double valMinAbsolute = 100;
|
||||
double valMaxAbsolute = dimensionTot - valMinAbsolute * (dimensions.Count - 1);
|
||||
@@ -221,9 +231,27 @@ namespace WebWindowComplex.Models
|
||||
for (int i = 0; i < m_Parent.AreaList.Count; i++)
|
||||
{
|
||||
if (m_Parent.SplitHorizList.Count > 0 && i < m_Parent.SplitHorizList.Count)
|
||||
m_Parent.AreaList.ElementAt(i).SearchAreaList(m_Parent.AreaList.ElementAt(i), m_Parent.SplitHorizList.ElementAt(i).dDimension, "Height");
|
||||
{
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in m_Parent.SplitHorizList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
SplitDimension currSplitDim = m_Parent.SplitHorizList[i];
|
||||
double dim = currSplitDim.dDimension;
|
||||
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, height, -1);
|
||||
m_Parent.AreaList.ElementAt(i).SearchAreaList(m_Parent.AreaList.ElementAt(i), dim, "Height");
|
||||
}
|
||||
if (m_Parent.SplitVertList.Count > 0 && i < m_Parent.SplitVertList.Count)
|
||||
m_Parent.AreaList.ElementAt(i).SearchAreaList(m_Parent.AreaList.ElementAt(i), m_Parent.SplitVertList.ElementAt(i).dDimension, "Width");
|
||||
{
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
foreach (var itemDim in m_Parent.SplitVertList)
|
||||
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
|
||||
SplitDimension currSplitDim = m_Parent.SplitVertList[i];
|
||||
double dim = currSplitDim.dDimension;
|
||||
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
|
||||
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, width, -1);
|
||||
m_Parent.AreaList.ElementAt(i).SearchAreaList(m_Parent.AreaList.ElementAt(i), dim, "Width");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +310,7 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(adList, m_SelMeasureType, newType, tot, splitList.IndexOf(this), 0);
|
||||
m_dDimension = ad.ConvertDimension(adList, m_SelMeasureType, newType, tot, splitList.IndexOf(this));
|
||||
m_SelMeasureType = (MeasureTypes)value;
|
||||
}
|
||||
}
|
||||
@@ -326,6 +354,9 @@ namespace WebWindowComplex.Models
|
||||
if(split.SplitVertList.Count > 0)
|
||||
{
|
||||
int index = i;
|
||||
double widthGlass = width;
|
||||
foreach (var elem in split.ElemDimVertList)
|
||||
widthGlass = widthGlass - elem.dDimension;
|
||||
if (split.SelSplitShape is SplitShapes.GRID)
|
||||
index = i % split.SplitHorizList.Count;
|
||||
switch (split.SplitVertList.ElementAt(index).SelMeasureType)
|
||||
@@ -343,12 +374,12 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
|
||||
}
|
||||
res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width), res);
|
||||
res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthGlass), res);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension * width / 100, res);
|
||||
res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension * widthGlass / 100, res);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -364,16 +395,34 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
else if (area is Sash sash)
|
||||
{
|
||||
double widthTot = width;
|
||||
double dim = 0;
|
||||
if (sash.ParentArea.ParentArea is Split)
|
||||
widthTot = widthTot + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap
|
||||
+ sash.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap;
|
||||
if (sash.bIsDimensionLight)
|
||||
{
|
||||
widthTot = widthTot - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension
|
||||
- sash.SashList.First().ElementDimensionList.Last().dDimension;
|
||||
for (int anta = 1; anta < sash.SashList.Count; anta++)
|
||||
{
|
||||
widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension
|
||||
- sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension
|
||||
+ sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int anta = 1; anta < sash.SashList.Count; anta++)
|
||||
{
|
||||
widthTot = widthTot + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
}
|
||||
switch (sash.SashList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
double dim = sash.SashList.ElementAt(i).dDimension;
|
||||
if (!sash.bIsDimensionLight)
|
||||
dim = dim -
|
||||
sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension -
|
||||
sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
res = CalculateWidthSplitGroup(item, dim, res);
|
||||
dim = sash.SashList.ElementAt(i).dDimension;
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
@@ -381,50 +430,20 @@ namespace WebWindowComplex.Models
|
||||
AreaDimension ad = new AreaDimension(sash.SashList.ElementAt(i).dDimension, sash.SashList.ElementAt(i).SelMeasureType, sash.SashList.ElementAt(i).Parent);
|
||||
List<AreaDimension> adList = new List<AreaDimension>();
|
||||
foreach (var it in sash.SashList)
|
||||
{
|
||||
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
|
||||
}
|
||||
double widthTot = width;
|
||||
int index = adList.IndexOf(ad) == 0 ? 1 : adList.Count - 1; ;
|
||||
double dim = 0;
|
||||
if (sash.bIsDimensionLight)
|
||||
{
|
||||
for (int anta = 0; anta < sash.SashList.Count; anta++)
|
||||
{
|
||||
if (anta == 0)
|
||||
widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension
|
||||
- sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension;
|
||||
else
|
||||
widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension
|
||||
- sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension
|
||||
+ sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot);
|
||||
}
|
||||
else
|
||||
{
|
||||
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot)
|
||||
+ sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(index).dOverlap / 2;
|
||||
dim = dim -
|
||||
sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension -
|
||||
sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
}
|
||||
res = CalculateWidthSplitGroup(item, dim, res);
|
||||
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
double overlapElem = 0;
|
||||
int indElem = i == 0 ? 1 : sash.SashList.ElementAt(i).ElementDimensionList.Count - 1;
|
||||
if (!sash.bIsDimensionLight)
|
||||
overlapElem = sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(indElem).dOverlap / 2;
|
||||
double dim = sash.SashList.ElementAt(i).dDimension * width / 100 + overlapElem -
|
||||
sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension -
|
||||
sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
res = CalculateWidthSplitGroup(item, dim, res);
|
||||
dim = sash.SashList.ElementAt(i).dDimension * widthTot / 100;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!sash.bIsDimensionLight)
|
||||
dim = dim - sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension
|
||||
- sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension;
|
||||
res = CalculateWidthSplitGroup(item, dim, res);
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
}
|
||||
@@ -469,7 +488,6 @@ namespace WebWindowComplex.Models
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
dim = split.SplitHorizList.ElementAt(index).dDimension;
|
||||
//res = CalculateHeightSplitGroup(item, heightItemGroup, res);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
@@ -478,15 +496,10 @@ namespace WebWindowComplex.Models
|
||||
AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType, split.SplitHorizList.ElementAt(index).Parent);
|
||||
List<AreaDimension> adList = new List<AreaDimension>();
|
||||
foreach (var it in split.SplitHorizList)
|
||||
{
|
||||
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
|
||||
}
|
||||
foreach (var elem in split.ElemDimHorizList)
|
||||
{
|
||||
heigthGlass = heigthGlass - elem.dDimension;
|
||||
}
|
||||
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, heigthGlass);
|
||||
//res = CalculateHeightSplitGroup(item, heightItemGroup, res);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
@@ -494,29 +507,13 @@ namespace WebWindowComplex.Models
|
||||
foreach(var elem in split.ElemDimHorizList)
|
||||
dim = dim - elem.dDimension;
|
||||
dim = split.SplitHorizList.ElementAt(index).dDimension * dim / 100;
|
||||
//res = CalculateHeightSplitGroup(item, heightItemGroup, res);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash)
|
||||
if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash sash)
|
||||
{
|
||||
string pos = i == 0 ? "_Top_Overlap" : "_Bottom_Overlap";
|
||||
string overlapName = string.Join("_", split.ElemDimHorizList.First().sName.Split('_').Skip(1));
|
||||
if (i == 0)
|
||||
{
|
||||
dim = dim + frame.ElementDimensionList.First().dOverlap
|
||||
+ Window.m_ParameterList.GetValueOrDefault(overlapName + "_Bottom_Overlap");
|
||||
}
|
||||
else if (i == split.SplitHorizList.Count - 1)
|
||||
{
|
||||
dim = dim + frame.ElementDimensionList.ElementAt(frame.ElementDimensionList.Count - 2).dOverlap
|
||||
+ Window.m_ParameterList.GetValueOrDefault(overlapName + "_Top_Overlap");
|
||||
}
|
||||
else
|
||||
{
|
||||
dim = dim + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Top_Overlap")
|
||||
+ Window.m_ParameterList.GetValueOrDefault(overlapName + "_Bottom_Overlap");
|
||||
}
|
||||
dim = dim + sash.SashList.First().ElementDimensionList.First().dOverlap
|
||||
+ sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dOverlap;
|
||||
}
|
||||
res = CalculateHeightSplitGroup(item, dim, res);
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
@@ -531,8 +528,23 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
else if (area is Sash sash)
|
||||
{
|
||||
double overlap = 0;
|
||||
double bottomRail = 0;
|
||||
//if (sash.ParentArea is Split)
|
||||
// overlap = sash.SashList.First().ElementDimensionList.First().dOverlap
|
||||
// + sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dOverlap;
|
||||
//if (sash.ParentArea.ParentArea is Split)
|
||||
// overlap = sash.SashList.First().ElementDimensionList.First().dOverlap
|
||||
// + sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dOverlap;
|
||||
if(sash.SashBottomRailQty > 0)
|
||||
{
|
||||
foreach (var bottom in sash.BottomRailElemDimList)
|
||||
bottomRail = bottomRail + bottom.dDimension
|
||||
- bottom.dOverlap;
|
||||
}
|
||||
double dim = height - sash.SashList.First().ElementDimensionList.First().dDimension
|
||||
- sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dDimension;
|
||||
- sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dDimension
|
||||
- bottomRail;
|
||||
res = CalculateHeightSplitGroup(item, dim, res);
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
@@ -590,28 +602,25 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent));
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitVertList.IndexOf(this), 0);
|
||||
if (newType is MeasureTypes.PROPORTIONAL)
|
||||
{
|
||||
for (int i = 0; i < m_Parent.SplitVertList.Count; i++)
|
||||
{
|
||||
m_Parent.SplitVertList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
}
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitVertList.IndexOf(this));
|
||||
//if (newType is MeasureTypes.PROPORTIONAL)
|
||||
//{
|
||||
// for (int i = 0; i < m_Parent.SplitVertList.Count; i++)
|
||||
// {
|
||||
// m_Parent.SplitVertList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
//tot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
|
||||
List<SplitElementDimension> elemList = new List<SplitElementDimension>();
|
||||
if (Parent.bSplitStartVert || Parent.nSplitQtyVert == 0)
|
||||
if (Parent.bSplitStartVert)
|
||||
{
|
||||
for (int i = 0; i < m_Parent.ElemDimHorizList.Count; i++)
|
||||
{
|
||||
if( i == i + m_Parent.ElemDimVertList.Count * i && m_Parent.ElemDimHorizList.ElementAtOrDefault(i) != null)
|
||||
elemList.Add(m_Parent.ElemDimHorizList.ElementAtOrDefault(i)!);
|
||||
}
|
||||
elemList = m_Parent.ElemDimHorizList.Where(x => x.nSubArea == 1).ToList();
|
||||
}
|
||||
else
|
||||
elemList = m_Parent.ElemDimHorizList;
|
||||
foreach (var item in elemList)
|
||||
{
|
||||
dimSplitGroup = dimSplitGroup - item.dDimension;
|
||||
@@ -622,14 +631,14 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent));
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitHorizList.IndexOf(this), 0);
|
||||
if(newType is MeasureTypes.PROPORTIONAL)
|
||||
{
|
||||
for(int i = 0; i < m_Parent.SplitHorizList.Count; i++)
|
||||
{
|
||||
m_Parent.SplitHorizList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
}
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitHorizList.IndexOf(this));
|
||||
//if(newType is MeasureTypes.PROPORTIONAL)
|
||||
//{
|
||||
// for(int i = 0; i < m_Parent.SplitHorizList.Count; i++)
|
||||
// {
|
||||
// m_Parent.SplitHorizList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
m_SelMeasureType = (MeasureTypes)value;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using WebWindowComplex.Compo;
|
||||
using WebWindowComplex.DTO;
|
||||
@@ -827,6 +828,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
if (LiveData.ProfElementList.Count > 0)
|
||||
{
|
||||
//List <AreaProfiles> OrderedListProf = LiveData.ProfElementList.OrderBy(x => x.GroupId).ToList();
|
||||
// Inserisco i profili ricevuti nei rispettivi Element
|
||||
foreach (var item in LiveData.ProfElementList)
|
||||
{
|
||||
@@ -834,7 +836,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Metodo che resetta le liste (sash, split, splitted, fill e itemTable) e le crea nuovamente
|
||||
/// </summary>
|
||||
@@ -1237,6 +1239,15 @@ namespace WebWindowComplex
|
||||
for (int index = profileNameList.Count; index < frame.ElementDimensionList.Count; index++)
|
||||
frame.ElementDimensionList.RemoveAt(index);
|
||||
elemList = frame.ElementDimensionList;
|
||||
foreach (var item in elemList)
|
||||
{
|
||||
string overlapName = string.Join("_", item.sName.Split('_').Skip(1));
|
||||
item.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
|
||||
}
|
||||
foreach (var elem in frame.BottomRailElemDimList)
|
||||
{
|
||||
elem.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault("Frame_BottomRail_Overlap"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SASH:
|
||||
@@ -1254,7 +1265,7 @@ namespace WebWindowComplex
|
||||
{
|
||||
anta.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
}
|
||||
elemList = anta.ElementDimensionList;
|
||||
SetOverlapSash(sash, anta, EntityIdSearch - 1, elemList);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SPLIT:
|
||||
@@ -1266,9 +1277,29 @@ namespace WebWindowComplex
|
||||
SpElemList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
SpElemList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMin"));
|
||||
SpElemList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMax"));
|
||||
if (SpElemList.ElementAt(i).dDimension > SpElemList.ElementAt(i).dMaxDim)
|
||||
{
|
||||
SpElemList.ElementAt(i).SetDimension(SpElemList.ElementAt(i).dMaxDim);
|
||||
Frame frame = split.ParentWindow.AreaList.First();
|
||||
if (frame != null)
|
||||
{
|
||||
frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
|
||||
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
else if (SpElemList.ElementAt(i).dDimension < SpElemList.ElementAt(i).dMinDim)
|
||||
{
|
||||
SpElemList.ElementAt(i).SetDimension(SpElemList.ElementAt(i).dMinDim);
|
||||
Frame frame = split.ParentWindow.AreaList.First();
|
||||
if (frame != null)
|
||||
{
|
||||
frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
|
||||
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
string overlapName = string.Join("_", SpElemList.ElementAt(i).sName.Split('_').Skip(1));
|
||||
SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1276,12 +1307,243 @@ namespace WebWindowComplex
|
||||
{
|
||||
item.SetMinDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMin"));
|
||||
item.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMax"));
|
||||
string overlapName = string.Join("_", item.sName.Split('_').Skip(1));
|
||||
item.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
|
||||
if (item.dDimension > item.dMaxDim)
|
||||
item.SetDimension(item.dMaxDim);
|
||||
else if (item.dMaxDim < item.dMinDim)
|
||||
item.SetDimension(item.dMinDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetOverlapSash(Sash sash, SashDimension anta, int indexAnta, List<ElementDimension> elemList)
|
||||
{
|
||||
string overlapNameBottom = "";
|
||||
string overlapNameTop = "";
|
||||
string overlapNameSx = "";
|
||||
string overlapNameDx = "";
|
||||
elemList = anta.ElementDimensionList;
|
||||
List<ElementDimension> elemOld = elemList;
|
||||
foreach(var elem in sash.BottomRailElemDimList)
|
||||
{
|
||||
elem.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault("Sash_BottomRail_Overlap"));
|
||||
}
|
||||
if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split split && split.nSplitQtyHoriz == 0))
|
||||
{
|
||||
Frame frame = sash.ParentWindow.AreaList.First();
|
||||
if(frame.SelThreshold.Name.Contains("Threshold"))
|
||||
overlapNameBottom = "Sash_Threshold";
|
||||
else
|
||||
overlapNameBottom = "Sash_Bottom";
|
||||
overlapNameTop = "Sash_Top";
|
||||
if(sash.ParentArea is Frame)
|
||||
{
|
||||
if(sash.SashList.Count == 1)
|
||||
{
|
||||
overlapNameDx = "Sash_Top";
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else if (indexAnta == sash.SashList.Count - 1)
|
||||
{
|
||||
overlapNameDx = "Sash_Top";
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Split s = (Split)sash.ParentArea.ParentArea;
|
||||
int indexAreaSplit = s.AreaList.IndexOf(sash.ParentArea);
|
||||
int indexSplit = indexAreaSplit == 0 ? 0 : indexAreaSplit - 1;
|
||||
if (indexAreaSplit == 0)
|
||||
{
|
||||
if (sash.SashList.Count == 1)
|
||||
{
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameDx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameDx = "Sash_Vertical";
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else if (indexAnta == sash.SashList.Count - 1)
|
||||
{
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameDx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameDx = "Sash_Vertical";
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (indexAreaSplit == s.AreaList.Count() - 1)
|
||||
{
|
||||
if (sash.SashList.Count == 1)
|
||||
{
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameSx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameSx = "Sash_Vertical";
|
||||
overlapNameDx = "Sash_Top";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameSx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameSx = "Sash_Vertical";
|
||||
}
|
||||
else if (indexAnta == sash.SashList.Count - 1)
|
||||
{
|
||||
overlapNameDx = "Sash_Top";
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sash.SashList.Count == 1)
|
||||
{
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameDx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameDx = "Sash_Vertical_Top";
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameSx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameSx = "Sash_Vertical";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameSx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameSx = "Sash_Vertical";
|
||||
}
|
||||
else if (indexAnta == sash.SashList.Count - 1)
|
||||
{
|
||||
if (s.ElemDimVertList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameDx = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameDx = "Sash_Vertical";
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sash.ParentArea.ParentArea is Split s && s.nSplitQtyHoriz > 0)
|
||||
{
|
||||
int indexAreaSplit = s.AreaList.IndexOf(sash.ParentArea);
|
||||
int indexSplit = indexAreaSplit == 0 ? 0 : indexAreaSplit - 1;
|
||||
if (indexAreaSplit == 0)
|
||||
{
|
||||
overlapNameBottom = "Sash_Bottom";
|
||||
overlapNameTop = "Mixed_Split_Top";
|
||||
}
|
||||
else if (indexAreaSplit == s.AreaList.Count() - 1)
|
||||
{
|
||||
if (s.ElemDimHorizList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameBottom = "Mixed_Split_Bottom";
|
||||
else
|
||||
overlapNameBottom = "Sash_Horizontal_Bottom";
|
||||
overlapNameTop = "Sash_Top";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s.ElemDimHorizList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameBottom = "Mixed_Split_Bottom";
|
||||
else
|
||||
overlapNameBottom = "Sash_Horizontal_Bottom";
|
||||
if (s.ElemDimHorizList.ElementAt(indexSplit).sName.Contains("Mixed"))
|
||||
overlapNameTop = "Mixed_Split_Top";
|
||||
else
|
||||
overlapNameTop = "Sash_Horizontal_Top";
|
||||
}
|
||||
if (sash.SashList.Count == 1)
|
||||
{
|
||||
overlapNameDx = "Sash_Top";
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else if (indexAnta == sash.SashList.Count - 1)
|
||||
{
|
||||
overlapNameDx = "Sash_Top";
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = string.Join("_", elemList.Last().sName.Split('_').Skip(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
elemList.First().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapNameBottom + "_Overlap"));
|
||||
elemList.ElementAt(1).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapNameDx + "_Overlap"));
|
||||
for (int elem = 2; elem <= elemList.Count - 2; elem++)
|
||||
elemList.ElementAt(elem).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapNameTop + "_Overlap"));
|
||||
elemList.Last().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapNameSx + "_Overlap"));
|
||||
//bool recalcDim = false;
|
||||
//for(int i = 0; i < elemList.Count; i++)
|
||||
//{
|
||||
// if (!elemList.ElementAt(i).Equals(elemOld.ElementAt(i)))
|
||||
// recalcDim = true;
|
||||
//}
|
||||
//if (recalcDim)
|
||||
//{
|
||||
// Frame frame = sash.ParentWindow.AreaList.First();
|
||||
// if (frame != null)
|
||||
// {
|
||||
// frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
|
||||
// frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare valori della sezione General
|
||||
/// </summary>
|
||||
@@ -1503,26 +1765,37 @@ namespace WebWindowComplex
|
||||
m_SplitList = new List<Split>();
|
||||
m_SplittedList = new List<Splitted>();
|
||||
CreateWindowsList((m_CurrWindow!).AreaList.First(), false);
|
||||
// richiedo update element della sash (se presenti)
|
||||
if (SashList.Count > 0)
|
||||
{
|
||||
foreach (var item in SashList)
|
||||
{
|
||||
reqList.Add(item.GroupId);
|
||||
}
|
||||
}
|
||||
// richiedo update element degli split (se presenti)
|
||||
if (SplitList.Count > 0)
|
||||
{
|
||||
foreach (var item in SplitList)
|
||||
{
|
||||
reqList.Add(item.GroupId);
|
||||
}
|
||||
}
|
||||
ReqListGroupId(FrameWindow, reqList);
|
||||
//// richiedo update element della sash (se presenti)
|
||||
//if (SashList.Count > 0)
|
||||
//{
|
||||
// foreach (var item in SashList)
|
||||
// {
|
||||
// reqList.Add(item.GroupId);
|
||||
// }
|
||||
//}
|
||||
//// richiedo update element degli split (se presenti)
|
||||
//if (SplitList.Count > 0)
|
||||
//{
|
||||
// foreach (var item in SplitList)
|
||||
// {
|
||||
// reqList.Add(item.GroupId);
|
||||
// }
|
||||
//}
|
||||
await DoReqElement(reqList);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReqListGroupId(Area node, List<int> groupId)
|
||||
{
|
||||
if (node.AreaList == null)
|
||||
return;
|
||||
if(node is Sash || node is Split)
|
||||
groupId.Add(node.GroupId);
|
||||
foreach (var child in node.AreaList)
|
||||
ReqListGroupId(child, groupId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento opzioni data nuova sash group
|
||||
/// </summary>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.2.2013</Version>
|
||||
<Version>3.1.3.218</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -232,6 +232,24 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.2.2013</Version>
|
||||
<Version>3.1.3.218</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -187,6 +187,22 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user