diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 58c5c92..51c3441 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -151,9 +151,9 @@ Unità misura diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 9f45f79..909017c 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -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 } diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index 7dd889a..0a8c083 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -31,9 +31,9 @@ Unità misura - @* *@
diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index 09484ba..e9a056e 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -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"; + } } /// diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs index 1717a5a..9ba2193 100644 --- a/WebWindowComplex/Models/ElementDimension.cs +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -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 elemList = new List(); 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"); + } + } } } } diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 4f6f73b..4060095 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -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; } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 1dcba9e..2cb6872 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1915 + 3.1.2.2013 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -206,6 +206,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 54f71d8..5f25609 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1915 + 3.1.2.2013 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -191,6 +191,12 @@ + + + + + +