Aggiornato modo per sollevare gli eventi di Frame, Fill, Splitted, Joint

This commit is contained in:
Annamaria Sassi
2025-11-26 10:30:53 +01:00
parent f56ed1052d
commit 30e69bde86
20 changed files with 356 additions and 403 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ namespace WebWindowComplex.Models
// All'area Split aggiunto le due aree Splitted
for (int i = 0; i < 2; i++)
AreaList[0].AreaList.Add(newSplittedList[i]);
ParentWindow.OnUpdatePreview(ParentWindow.sSerialized());
//ParentWindow.OnUpdatePreview(ParentWindow.sSerialized());
}
public abstract Area Copy(Area ParentArea);
-2
View File
@@ -52,7 +52,6 @@ namespace WebWindowComplex.Models
set
{
m_SelFillType = (FillTypes)IdNameStruct.IdFromInd(value, m_FillTypeList);
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
}
@@ -97,7 +96,6 @@ namespace WebWindowComplex.Models
internal void SetSelFillType(FillTypes value)
{
m_SelFillType = value;
//m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
internal void SetFillType(FillTypes value)
{
-5
View File
@@ -29,7 +29,6 @@ namespace WebWindowComplex.Models
set
{
m_bBottomRail = value;
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
}
@@ -53,7 +52,6 @@ namespace WebWindowComplex.Models
m_bBottomRail = false;
}
}
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
}
@@ -79,12 +77,10 @@ namespace WebWindowComplex.Models
{
get
{
//return IdNameStruct.IndFromId((int)m_Shape, m_ShapeList);
return (int)m_Shape;
}
set
{
//Shapes SelShape = (Shapes)IdNameStruct.IdFromInd(value, m_ShapeList);
Shapes SelShape = (Shapes)value;
if (m_Shape != SelShape)
{
@@ -213,7 +209,6 @@ namespace WebWindowComplex.Models
}
m_Shape = SelShape;
}
//m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
}
+22 -15
View File
@@ -33,18 +33,20 @@ namespace WebWindowComplex.Models
}
set
{
m_dValue = value;
if (value > MaxDim)
if(m_dValue != value)
{
m_dValue = MaxDim;
m_dValue = value;
if (value > MaxDim)
{
m_dValue = MaxDim;
}
else if (value < MinDim && !m_sName.Equals("Radius"))
{
m_dValue = MinDim;
}
if (ParentFrame.AreaList.Count > 0)
SearchAreaList(ParentFrame);
}
else if (value < MinDim && !m_sName.Equals("Radius"))
{
m_dValue = MinDim;
}
if (ParentFrame.AreaList.Count > 0)
SearchAreaList(ParentFrame);
m_ParentFrame.ParentWindow.OnUpdatePreview(m_ParentFrame.ParentWindow.sSerialized());
}
}
@@ -85,9 +87,9 @@ namespace WebWindowComplex.Models
if (node != null)
{
if (node.AreaType.Equals(AreaTypes.SASH))
calculateWidth((Sash)node);
updateDimSubArea((Sash)node);
else if (node.AreaType.Equals(AreaTypes.SPLIT))
calculateWidth((Split)node);
updateDimSubArea((Split)node);
foreach (var item in node.AreaList)
{
SearchAreaList(item);
@@ -95,17 +97,17 @@ namespace WebWindowComplex.Models
}
}
protected void calculateWidth(Area area)
protected void updateDimSubArea(Area area)
{
if(area is Sash && sName.Equals("Width"))
{
Sash sash = (Sash)area;
int countAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUT)).Count();
if(countAbsolute == sash.SashList.Count)
if (countAbsolute == sash.SashList.Count)
{
double sum = sash.SashList.Sum(x => x.dDimension);
double res = dValue - sum;
if(res > 0)
if (res > 0)
{
foreach (var sashDim in sash.SashList)
{
@@ -154,6 +156,11 @@ namespace WebWindowComplex.Models
}
}
internal void SetDimension(double dValue)
{
m_dValue = dValue;
}
internal JsonFrameDimension Serialize()
{
JsonFrameDimension JsonFrameDimension = new JsonFrameDimension(m_nIndex, m_sName, m_dValue);
+1 -3
View File
@@ -63,14 +63,12 @@ namespace WebWindowComplex.Models
{
get
{
//return IdNameStruct.IndFromId((int)m_SelJointType, m_JointTypeList);
return (int)m_SelJointType;
}
set
{
//m_SelJointType = (Joints)IdNameStruct.IdFromInd(value, m_JointTypeList);
m_SelJointType = (Joints)value;
m_ParentArea.ParentWindow.OnUpdatePreview(m_ParentArea.ParentWindow.sSerialized());
//m_ParentArea.ParentWindow.OnUpdatePreview(m_ParentArea.ParentWindow.sSerialized());
}
}
+1 -1
View File
@@ -356,7 +356,7 @@ namespace WebWindowComplex.Models
{
SelHwOptionList.Clear();
}
ReqRefreshHwOption();
//ReqRefreshHwOption();
//ParentWindow.OnUpdatePreview(ParentWindow.sSerialized());
}
}
+1 -1
View File
@@ -216,7 +216,7 @@ namespace WebWindowComplex.Models
m_dDimension = value;
}
// Le dimensioni sono miste o solo in assoluto
else
else
{
double valueInAbsolute = 0;
switch (MeasureType)