Update settings & altro
This commit is contained in:
+105
-18
@@ -34,20 +34,51 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Larghezza gruppo ante
|
||||
/// </summary>
|
||||
public double Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Width;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Width = value;
|
||||
}
|
||||
}
|
||||
///// <summary>
|
||||
///// Larghezza gruppo ante
|
||||
///// </summary>
|
||||
//public double Width
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_Width;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// if (m_Width != value && m_Width != 0)
|
||||
// {
|
||||
// // Se larghezza aumentata
|
||||
// if (SashList.Sum(x => x.CalculateAbsolutValue(m_Width)) < value)
|
||||
// {
|
||||
// if (SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).ToList().Count == 0 &&
|
||||
// SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).ToList().Count != SashList.Count)
|
||||
// {
|
||||
// double res = value - m_Width;
|
||||
// foreach (var item in SashList)
|
||||
// item.SetDimension(item.ConvertIn(item.CalculateAbsolutValue(m_Width) + res / SashList.Count, (MeasureTypes)item.SelMeasureTypeIndex, value));
|
||||
// }
|
||||
// }
|
||||
// // Larghezza diminuita
|
||||
// else if (SashList.Sum(x => x.CalculateAbsolutValue(m_Width)) > value)
|
||||
// {
|
||||
// if (SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).ToList().Count == 0 &&
|
||||
// SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).ToList().Count != SashList.Count)
|
||||
// {
|
||||
// double res = m_Width - value;
|
||||
// foreach (var item in SashList)
|
||||
// item.SetDimension(item.ConvertIn(item.CalculateAbsolutValue(m_Width) - res / SashList.Count, (MeasureTypes)item.SelMeasureTypeIndex, value));
|
||||
// }
|
||||
// }
|
||||
// m_Width = value;
|
||||
// m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_Width = value;
|
||||
// m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
public bool bIsMeasureGlass
|
||||
{
|
||||
@@ -158,7 +189,8 @@ namespace WebWindowComplex.Models
|
||||
itemDelete = m_SashList[SplitIndex];
|
||||
SashList.RemoveAt(SplitIndex);
|
||||
}
|
||||
double deleteDim = itemDelete.ConvertDimension(itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType);
|
||||
double widthTot = CalculateWidthSashGroup(ParentWindow.AreaList.First(), ParentWindow.AreaList.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dValue);
|
||||
double deleteDim = itemDelete.ConvertDimension(itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot);
|
||||
//dLastDimension += m_SashList[SashList.Count - 1].dDimension;
|
||||
dLastDimension = deleteDim + m_SashList[SashList.Count - 1].dDimension;
|
||||
SashList[SashList.Count - 1].SetDimension(dLastDimension);
|
||||
@@ -570,7 +602,64 @@ namespace WebWindowComplex.Models
|
||||
#endregion Public Methods
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal double CalculateWidthSashGroup(Area area, double width)
|
||||
{
|
||||
if (area.Equals(this))
|
||||
return width;
|
||||
for (int i = 0; i < area.AreaList.Count; i++)
|
||||
{
|
||||
Area item = area.AreaList[i];
|
||||
if (area is Split)
|
||||
{
|
||||
Split split = (Split)area;
|
||||
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
{
|
||||
CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
//CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension * width / 100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (area is Sash)
|
||||
{
|
||||
Sash sash = (Sash)area;
|
||||
switch (sash.SashList.ElementAt(i).SelMeasureType)
|
||||
{
|
||||
case MeasureTypes.ABSOLUT:
|
||||
{
|
||||
CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
//CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension * width / 100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CalculateWidthSashGroup(item, width);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
internal static Sash CreateSash(Area Area)
|
||||
{
|
||||
Sash newSash = new Sash(Area, Area.ParentWindow);
|
||||
@@ -909,8 +998,6 @@ namespace WebWindowComplex.Models
|
||||
private Hardware m_SelHardware;
|
||||
private OrientationSash m_SelOrientationSashType;
|
||||
|
||||
private double m_Width = 0;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
Reference in New Issue
Block a user