This commit is contained in:
2008-03-25 12:31:19 +00:00
parent f3d20d1e5d
commit 1515b5ed9b
15 changed files with 203 additions and 117 deletions

View File

@@ -28,7 +28,7 @@ namespace Volian.Controls.Library
Done = 16
}
#endregion
public partial class DisplayItem : UserControl
public partial class StepItem : UserControl
{
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#region Events
@@ -36,12 +36,12 @@ namespace Volian.Controls.Library
#region Private Fields
private bool _ChildrenLoaded=false;
private StepSectionLayoutData _Layout;
private DisplayPanel _Panel;
private StepPanel _Panel;
private ChildRelation _Relation;
private bool _Loading = true;
private List<DisplayItem> _Before;
private List<DisplayItem> _After;
private List<DisplayItem> _RNO;
private List<StepItem> _Before;
private List<StepItem> _After;
private List<StepItem> _RNO;
private StepData _StepData;
#endregion
// TODO: Look at modules to see if any should be made static
@@ -67,7 +67,7 @@ namespace Volian.Controls.Library
ChangeBar = true;
}
}
public DisplayRTB MyDisplayRTB
public StepRTB MyDisplayRTB
{
get { return _DisplayRTB; }
}
@@ -77,8 +77,8 @@ namespace Volian.Controls.Library
this._DisplayRTB.MyItem = _MyItem;
}
private static int __WidthAdjust = 3;
private DisplayItem _MyParent = null;
public DisplayItem MyParent
private StepItem _MyParent = null;
public StepItem MyParent
{
get { return _MyParent; }
set
@@ -162,7 +162,7 @@ namespace Volian.Controls.Library
}
return max;
}
private Point TableLocation(DisplayItem parent, StepSectionLayoutData layout, int width)
private Point TableLocation(StepItem parent, StepSectionLayoutData layout, int width)
{
int x = parent.TextLeft;
int y = parent.Bottom;
@@ -265,12 +265,12 @@ namespace Volian.Controls.Library
get
{
int count = 1;
for (DisplayItem tmp = this; tmp.Previous != null; tmp = tmp.Previous) count++;
for (StepItem tmp = this; tmp.Previous != null; tmp = tmp.Previous) count++;
return count;
}
}
private DisplayItem _Previous = null;
public DisplayItem Previous
private StepItem _Previous = null;
public StepItem Previous
{
get { return _Previous; }
set
@@ -298,8 +298,8 @@ namespace Volian.Controls.Library
}
}
}
private DisplayItem _Next = null;
public DisplayItem Next
private StepItem _Next = null;
public StepItem Next
{
get { return _Next; }
set
@@ -315,7 +315,7 @@ namespace Volian.Controls.Library
}
}
}
public DisplayItem TopMost
public StepItem TopMost
{
get
{
@@ -330,13 +330,13 @@ namespace Volian.Controls.Library
return Top + (Visible ? Height : 0);
}
}
public DisplayItem BottomMost
public StepItem BottomMost
{
get
{
DisplayItem tmpr = null;
StepItem tmpr = null;
if ((Expanding != ExpandingStatus.No || Expanded) && _RNO != null) tmpr = _RNO[_RNO.Count - 1].BottomMost;
DisplayItem tmpa = this;
StepItem tmpa = this;
if ((Expanding != ExpandingStatus.No || Expanded) & _After != null) tmpa = _After[_After.Count - 1].BottomMost;
if (tmpr == null)
return tmpa;
@@ -345,11 +345,11 @@ namespace Volian.Controls.Library
return tmpr;
}
}
private DisplayItem FirstSibling
private StepItem FirstSibling
{
get
{
DisplayItem tmp = this;
StepItem tmp = this;
while (tmp.Previous != null)
tmp = tmp.Previous;
return tmp;
@@ -357,11 +357,11 @@ namespace Volian.Controls.Library
}
private int _ExpandPrefix = 0;
private int _ExpandSuffix = 0;
private DisplayItem LastSibling
private StepItem LastSibling
{
get
{
DisplayItem tmp = this;
StepItem tmp = this;
while (tmp.Next != null)
tmp = tmp.Next;
return tmp;
@@ -418,7 +418,7 @@ namespace Volian.Controls.Library
private int _Type;
#endregion
#region Constructors
public DisplayItem(ItemInfo item, DisplayPanel panel, DisplayItem parent, ChildRelation relationType, bool expand)
public StepItem(ItemInfo item, StepPanel panel, StepItem parent, ChildRelation relationType, bool expand)
{
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
@@ -641,36 +641,36 @@ namespace Volian.Controls.Library
}
#endregion
#region AddItem
public void AddItem(DisplayItem parent, ref List<DisplayItem> siblings)
public void AddItem(StepItem parent, ref List<StepItem> siblings)
{
if (siblings == null)
{
siblings = new List<DisplayItem>();
siblings = new List<StepItem>();
siblings.Add(this);
MyParent = parent;
}
else
{
DisplayItem lastChild = LastChild(siblings);
StepItem lastChild = LastChild(siblings);
siblings.Add(this);
Previous = lastChild;
}
TabFormat = TemporaryFormat.TabFormat(this);
}
public DisplayItem AddNext(ItemInfo item,bool expand)
public StepItem AddNext(ItemInfo item,bool expand)
{
DisplayItem tmp = new DisplayItem(item, _Panel,MyParent, ChildRelation.None,expand);
StepItem tmp = new StepItem(item, _Panel,MyParent, ChildRelation.None,expand);
Next = tmp;
return tmp;
}
#region Add Children
public DisplayItem LastChild(List<DisplayItem> children)
public StepItem LastChild(List<StepItem> children)
{
return children[children.Count - 1];
}
public void AddChildBefore(ItemInfo item,bool expand)
{
DisplayItem child = new DisplayItem(item, _Panel,this, ChildRelation.Before,expand);
StepItem child = new StepItem(item, _Panel,this, ChildRelation.Before,expand);
}
public void AddChildBefore(ItemInfoList itemList, bool expand)
{
@@ -680,7 +680,7 @@ namespace Volian.Controls.Library
}
public void AddChildRNO(ItemInfo item,bool expand)
{
DisplayItem child = new DisplayItem(item, _Panel,this, ChildRelation.RNO,expand);
StepItem child = new StepItem(item, _Panel,this, ChildRelation.RNO,expand);
}
public void AddChildRNO(ItemInfoList itemList,bool expand)
{
@@ -690,7 +690,7 @@ namespace Volian.Controls.Library
}
public void AddChildAfter(ItemInfo item,bool expand)
{
DisplayItem child = new DisplayItem(item, _Panel, this, ChildRelation.After,expand);
StepItem child = new StepItem(item, _Panel, this, ChildRelation.After,expand);
child.RNOLevel = this.RNOLevel;
}
public void AddChildAfter(ItemInfoList itemList,bool expand)
@@ -734,11 +734,11 @@ namespace Volian.Controls.Library
HideChildren(_RNO);
HideChildren(_After);
}
private void HideChildren(List<DisplayItem> children)
private void HideChildren(List<StepItem> children)
{
if (children != null)
{
foreach (DisplayItem child in children)
foreach (StepItem child in children)
{
if (child.Expanded) child.HideChildren();
child.Visible = false;
@@ -753,11 +753,11 @@ namespace Volian.Controls.Library
if(!vlnExp.Expanded)
vlnExp.ShowExpanded();
}
private void UnhideChildren(List<DisplayItem> children,bool expand)
private void UnhideChildren(List<StepItem> children,bool expand)
{
if (children != null)
{
foreach (DisplayItem child in children)
foreach (StepItem child in children)
{
if (child.Expanded)
child.UnhideChildren(expand);
@@ -773,11 +773,11 @@ namespace Volian.Controls.Library
AdjustChildren(_RNO);
AdjustChildren(_After);
}
private void AdjustChildren(List<DisplayItem> children)
private void AdjustChildren(List<StepItem> children)
{
if (children != null)
{
foreach (DisplayItem child in children)
foreach (StepItem child in children)
{
child.AdjustLocation();
if (child.Expanded) child.AdjustChildren();
@@ -836,11 +836,11 @@ namespace Volian.Controls.Library
Expand(_Type >= 20000);
Cursor.Current = tmp;
}
private void ExpandChildren(List<DisplayItem> children)
private void ExpandChildren(List<StepItem> children)
{
if (children != null)
{
foreach (DisplayItem child in children)
foreach (StepItem child in children)
{
if (child.CanExpand)
{
@@ -857,11 +857,11 @@ namespace Volian.Controls.Library
ExpandChildren(_RNO);
ExpandChildren(_After);
}
public DisplayItem NextItem
public StepItem NextItem
{
get
{
DisplayItem tmp = this;
StepItem tmp = this;
if (tmp.Next == null && FirstSibling._Relation == ChildRelation.Before)
return UpOne;
if (Expanded && tmp._After != null)
@@ -873,7 +873,7 @@ namespace Volian.Controls.Library
return null;
if (tmp.Expanding == ExpandingStatus.Expanding || tmp.Moving) // Parent Expanding or Moving - Wait
return null;
DisplayItem btm = tmp.BottomMost;
StepItem btm = tmp.BottomMost;
if (this != btm)
{
if (tmp.Next != null && tmp.Next.TopMost.Top != btm.Bottom)
@@ -890,11 +890,11 @@ namespace Volian.Controls.Library
return null;
}
}
private DisplayItem UpOne
private StepItem UpOne
{
get
{
DisplayItem tmp = this;
StepItem tmp = this;
while (tmp != null && tmp.MyParent == null) tmp = tmp.Previous;
if (tmp != null) return tmp.MyParent;
return null;
@@ -902,7 +902,7 @@ namespace Volian.Controls.Library
}
private void AdjustLocation()
{
DisplayItem tmp = NextItem;
StepItem tmp = NextItem;
if (tmp == null) return;
if (tmp != null && !tmp.Moving && tmp.Top != Bottom )
{
@@ -926,7 +926,7 @@ namespace Volian.Controls.Library
if (_MyItem == null) return;
if (Expanding == ExpandingStatus.Expanding) return;
_Moving = true;
DisplayItem tmp = (DisplayItem)sender;
StepItem tmp = (StepItem)sender;
if (tmp._Previous == null && tmp._MyParent == null)
{
return;
@@ -939,7 +939,7 @@ namespace Volian.Controls.Library
//if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("\r\n'Adjust RNO',{0},'Move',{1}", MyID, _RNO[0].MyID);
if (RNOLevel >= _Panel.MaxRNO)
{
DisplayItem tmpBottom = this;
StepItem tmpBottom = this;
if (_After != null) tmpBottom = _After[_After.Count - 1].BottomMost;
_Panel.Scrolling++;
_RNO[0].TopMost.Top = tmpBottom.Bottom;