Deviation Document 3 Column Format (Dev_Format) support.

Auto-expand HLS for Deviation Document format.
	Corrected width of notes and cautions.
	B2012-265
Reduced updates to the location of an item that do not move the item.
This commit is contained in:
Rich 2012-10-25 00:40:46 +00:00
parent f63b9d3ace
commit 762f1a9916

View File

@ -118,12 +118,6 @@ namespace Volian.Controls.Library
get { return _ExpandPrefix; } get { return _ExpandPrefix; }
set { _ExpandPrefix = value; } set { _ExpandPrefix = value; }
} }
private int _ExpandSuffix = 0;
public int ExpandSuffix
{
get { return _ExpandSuffix; }
set { _ExpandSuffix = value; }
}
private bool _Colapsing = false; private bool _Colapsing = false;
/// <summary> /// <summary>
/// Gets or sets colapsing /// Gets or sets colapsing
@ -1033,7 +1027,7 @@ namespace Volian.Controls.Library
} }
public void AddChild(string text, E_FromType fromType, int type, VlnFlexGrid vfGrid) public void AddChild(string text, E_FromType fromType, int type, VlnFlexGrid vfGrid)
{ {
if (_MyItemInfo.IsHigh || _MyItemInfo.IsSection) if ((_MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) || _MyItemInfo.IsSection)
CanExpand = true; CanExpand = true;
this.Expanded = true; this.Expanded = true;
_WatchThis = 1; _WatchThis = 1;
@ -1332,7 +1326,8 @@ namespace Volian.Controls.Library
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Right {0}", rnoTop.MyID)); rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Right {0}", rnoTop.MyID));
//rnoTop.Top = tmpBottom.Bottom; //rnoTop.Top = tmpBottom.Bottom;
rnoTop.Top = Top; if(rnoTop.Top != Top)
rnoTop.Top = Top;
rnoTop.LastMethodsPop(); rnoTop.LastMethodsPop();
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
} }
@ -1340,7 +1335,8 @@ namespace Volian.Controls.Library
{ {
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Below {0} {1} {2}", rnoTop.MyID, BottomMostEditItemNoRNOs.MyID, BottomMostEditItemNoRNOs.Bottom)); rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Below {0} {1} {2}", rnoTop.MyID, BottomMostEditItemNoRNOs.MyID, BottomMostEditItemNoRNOs.Bottom));
rnoTop.Top = BottomMostEditItemNoRNOs.Bottom; if(rnoTop.Top != BottomMostEditItemNoRNOs.Bottom)
rnoTop.Top = BottomMostEditItemNoRNOs.Bottom;
rnoTop.LastMethodsPop(); rnoTop.LastMethodsPop();
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
} }
@ -1353,6 +1349,7 @@ namespace Volian.Controls.Library
get { return _TryAgainLater; } get { return _TryAgainLater; }
set { _TryAgainLater = value; } set { _TryAgainLater = value; }
} }
int _LastTop = 0;
/// <summary> /// <summary>
/// Handles movement of the EditItems /// Handles movement of the EditItems
/// </summary> /// </summary>
@ -1360,6 +1357,9 @@ namespace Volian.Controls.Library
/// <param name="e"></param> /// <param name="e"></param>
private void EditItem_Move(object sender, EventArgs e) private void EditItem_Move(object sender, EventArgs e)
{ {
int newTop = Top - MyStepPanel.TopMostEditItem.Top;
if (_LastTop == newTop) return;
_LastTop = newTop;
int watchThis = _WatchThis; int watchThis = _WatchThis;
//if (MyID == 136) //if (MyID == 136)
//{ //{
@ -1648,12 +1648,11 @@ namespace Volian.Controls.Library
return null; return null;
} }
} }
/// <summary> /// <summary>
/// Adjust the Location of all items below the current item. /// Adjust the Location of all items below the current item.
/// </summary> /// </summary>
internal void AdjustLocation() internal void AdjustLocation()
{ {
//Console.WriteLine("'AdjustLocation',{0},{1},'{2}'", MyID, MyItemInfo.DBSequence, Volian.Base.Library.vlnStackTrace.CalledFrom4);
if (RNORight) MoveRNO(); // This is needed when an AER is Deleted that has an RNO. if (RNORight) MoveRNO(); // This is needed when an AER is Deleted that has an RNO.
if (RNOLevel > 0 && AEREditItem != null) if (RNOLevel > 0 && AEREditItem != null)
AEREditItem.AdjustLocation(); AEREditItem.AdjustLocation();
@ -1664,7 +1663,12 @@ namespace Volian.Controls.Library
// _NextDownEditItemPath); // _NextDownEditItemPath);
if (nextEditItem != null) if (nextEditItem != null)
{ {
if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.MyHLS.ItemID != MyStepPanel.ExpandingHLS.ItemID)
return;
int bottom = nextEditItem.FindTop(Bottom); int bottom = nextEditItem.FindTop(Bottom);
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
if (MyItemInfo.IsCaution || MyItemInfo.IsNote)
bottom = Top;
if (nextEditItem.Top != bottom) if (nextEditItem.Top != bottom)
{ {
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
@ -1678,31 +1682,13 @@ namespace Volian.Controls.Library
nextEditItem.Top = bottom; nextEditItem.Top = bottom;
if (nextEditItem.Top != bottom) if (nextEditItem.Top != bottom)
{ {
nextEditItem.TryAgainNow(bottom); _MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
if (nextEditItem.Top != bottom) oldTop, nextEditItem.Top, bottom, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
{ nextEditItem.TryAgainLater = true;
_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
oldTop, nextEditItem.Top, bottom, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
nextEditItem.TryAgainLater = true;
MyStepPanel.Height += 12;
}
}
else if ((nextEditItem.Bottom + MyStepPanel.VerticalScroll.Value + 1) > MyStepPanel.VerticalScroll.Maximum)
{
if (nextEditItem.Visible)
{
_MyLog.InfoFormat("Refresh Edit Item '{0}',{1},{2},{3},{4}", nextEditItem.MyItemInfo.ShortPath,
nextEditItem.Bottom, MyStepPanel.Height, MyStepPanel.VerticalScroll.Maximum, MyStepPanel.VerticalScroll.Value);
MyStepPanel.AddToRefreshList(nextEditItem);
}
} }
nextEditItem.LastMethodsPop(); nextEditItem.LastMethodsPop();
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
} }
else
{
Console.WriteLine("{0}** No Adjustment next = {1}, moving = {2}", WatchThisIndent, nextEditItem, nextEditItem == null ? false : nextEditItem.Moving);
}
} }
} }
public void TryAgainNow(int bottom) public void TryAgainNow(int bottom)
@ -1715,7 +1701,7 @@ namespace Volian.Controls.Library
{ {
Top = offset; Top = offset;
if (Top != offset) if (Top != offset)
_MyLog.InfoFormat("Didn't work - Top {0} != offset {1}", Top, offset); _MyLog.InfoFormat("Didn't work - Top {0} != offset {1} {2}", Top, offset,MyStepPanel.VerticalScroll.Value);
} }
/// <summary> /// <summary>
/// Automatically expands Steps if not currently expanded /// Automatically expands Steps if not currently expanded
@ -1725,7 +1711,7 @@ namespace Volian.Controls.Library
if (CanExpand && Expanded == false)// TODO: May need to do some additional checking for subsections if (CanExpand && Expanded == false)// TODO: May need to do some additional checking for subsections
{ {
//vlnStackTrace.ShowStack(">AutoExpand ID {0} - Can {1} Expanded {2}", _MyItem.ItemID, CanExpand, Expanded); //vlnStackTrace.ShowStack(">AutoExpand ID {0} - Can {1} Expanded {2}", _MyItem.ItemID, CanExpand, Expanded);
Expand(_ContentType >= 20000); Expand((_ContentType >= 20000) || MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format);
//Console.WriteLine("<AutoExpand ID {0} - Can {1} Expanded {2}",_MyItem.ItemID, CanExpand, Expanded); //Console.WriteLine("<AutoExpand ID {0} - Can {1} Expanded {2}",_MyItem.ItemID, CanExpand, Expanded);
} }
} }
@ -1748,7 +1734,8 @@ namespace Volian.Controls.Library
if (ExpandPrefix != 0) if (ExpandPrefix != 0)
{ {
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
TopMostEditItem.Top = Top; if(TopMostEditItem.Top != Top)
TopMostEditItem.Top = Top;
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
} }
else else
@ -1759,6 +1746,7 @@ namespace Volian.Controls.Library
} }
else else
{ {
if (MyItemInfo.IsHigh) MyStepPanel.ExpandingHLS = MyItemInfo;
MyExpandingStatus = ExpandingStatus.Expanding; MyExpandingStatus = ExpandingStatus.Expanding;
_ChildrenLoaded = true; _ChildrenLoaded = true;
//_Panel.SuspendLayout(); //_Panel.SuspendLayout();
@ -1782,6 +1770,7 @@ namespace Volian.Controls.Library
AddChildRNO(MyItemInfo.RNOs, expand); AddChildRNO(MyItemInfo.RNOs, expand);
AddChildAfter(MyItemInfo.Sections, expand); AddChildAfter(MyItemInfo.Sections, expand);
MatchExpanded(); MatchExpanded();
if (MyItemInfo.IsHigh) MyStepPanel.ExpandingHLS = null;
} }
MyExpandingStatus = ExpandingStatus.Done; MyExpandingStatus = ExpandingStatus.Done;
BottomMostEditItem.AdjustLocation(); BottomMostEditItem.AdjustLocation();
@ -1921,7 +1910,8 @@ namespace Volian.Controls.Library
//Console.WriteLine("{0}***Move in NextDownEditItem {1},{2} From {3} To {4}",WatchThisIndent, btmNext.MyID, btmNext, btmNext.Top, btm.Bottom); //Console.WriteLine("{0}***Move in NextDownEditItem {1},{2} From {3} To {4}",WatchThisIndent, btmNext.MyID, btmNext, btmNext.Top, btm.Bottom);
btmNext.LastMethodsPush(string.Format("NextDownEditItem {0} {1}", MyID, EditItem.MyID)); btmNext.LastMethodsPush(string.Format("NextDownEditItem {0} {1}", MyID, EditItem.MyID));
//ShowMe(string.Format("FindTop = {0}", btmNext.FindTop(btm.Bottom))); //ShowMe(string.Format("FindTop = {0}", btmNext.FindTop(btm.Bottom)));
btmNext.Top = bottom; if(btmNext.Top != bottom)
btmNext.Top = bottom;
btmNext.LastMethodsPop(); btmNext.LastMethodsPop();
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
} }
@ -2035,11 +2025,19 @@ namespace Volian.Controls.Library
{ {
case 0: // Procedure case 0: // Procedure
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom);
ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); int widt = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT);
int wids = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0);
int width = Math.Max(widt, wids);
ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + width;
break; break;
case 1: // Section case 1: // Section
if (this == TopMostEditItem) if (this == TopMostEditItem)
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); {
if(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
ItemLocation = new Point(MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS)+50, _MyParentEditItem.Bottom);
else
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom);
}
else else
TopMostEditItem.ItemLocation = new Point(TopMostEditItem.ItemLocation.X, _MyParentEditItem.Bottom); TopMostEditItem.ItemLocation = new Point(TopMostEditItem.ItemLocation.X, _MyParentEditItem.Bottom);
//TextWidth = _WidthAdjust + borderWidth + MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); //TextWidth = _WidthAdjust + borderWidth + MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1);
@ -2077,7 +2075,7 @@ namespace Volian.Controls.Library
if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1) if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1)
ContentWidth = ovrRNOWidth; ContentWidth = ovrRNOWidth;
else else
ContentWidth =_MyParentEditItem.ContentWidth; ContentWidth = _MyParentEditItem.ContentWidth;
_IgnoreResize = false; _IgnoreResize = false;
if (RNOLevel <= MyItemInfo.ColumnMode) if (RNOLevel <= MyItemInfo.ColumnMode)
{ {
@ -2093,6 +2091,7 @@ namespace Volian.Controls.Library
if (top != _MyParentEditItem.Top) if (top != _MyParentEditItem.Top)
{ {
_MyParentEditItem.LastMethodsPush(string.Format("set_MyParentRTBItem RNO Right {0}", MyID)); _MyParentEditItem.LastMethodsPush(string.Format("set_MyParentRTBItem RNO Right {0}", MyID));
if(_MyParentEditItem.Top != top)
_MyParentEditItem.Top = top; _MyParentEditItem.Top = top;
_MyParentEditItem.LastMethodsPop(); _MyParentEditItem.LastMethodsPop();
Top = top; Top = top;
@ -2119,12 +2118,23 @@ namespace Volian.Controls.Library
//Location = new Point(_MyParentRTBItem.Left + 20, max(_MyParentRTBItem.Top, (_MyNextRTBItem == null ? 0 : _MyNextRTBItem.Top )) ?? 0); //Location = new Point(_MyParentRTBItem.Left + 20, max(_MyParentRTBItem.Top, (_MyNextRTBItem == null ? 0 : _MyNextRTBItem.Top )) ?? 0);
_IgnoreResize = true; _IgnoreResize = true;
Width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); int spaceToRTB = 23;
Width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB;
_IgnoreResize = false; _IgnoreResize = false;
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
//Location = new Point(_MyParentRTBItem.Left + 20, FindTop(_MyParentRTBItem.Top)); //Location = new Point(_MyParentRTBItem.Left + 20, FindTop(_MyParentRTBItem.Top));
int myTop = MyNextEditItem == null ? _MyParentEditItem.Top : MyNextEditItem.Top; int myTop = MyNextEditItem == null ? _MyParentEditItem.Top : MyNextEditItem.Top;
Location = new Point(_MyParentEditItem.Left + 20, FindTop(myTop)); if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote ))
{
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
if (MyItemInfo.ItemID == 1 || MyItemInfo.ItemID == 52)
Console.WriteLine("here");
if(MyItemInfo.IsNote)
x += Width + 6;
Location = new Point(x, FindTop(myTop));
}
else
Location = new Point(_MyParentEditItem.Left + 20, FindTop(myTop));
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
//_MyParentRTBItem.Top = Bottom; //_MyParentRTBItem.Top = Bottom;
// Could be a Caution or Note - Need to get WidT // Could be a Caution or Note - Need to get WidT
@ -2160,10 +2170,29 @@ namespace Volian.Controls.Library
else else
{ {
Width = MyPreviousEditItem.Width; Width = MyPreviousEditItem.Width;
if (TopMostEditItem == this) if (TopMostEditItem == this)
Location = new Point(_MyPreviousEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); {
else if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsNote || MyItemInfo.IsCaution))
TopMostEditItem.Location = new Point(TopMostEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); {
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
if (MyItemInfo.IsNote)
x += Width + 6;
Location = new Point(x, _MyPreviousEditItem.Top);
}
else
{
int top = FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom);
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && _MyPreviousEditItem.MyItemInfo.IsHigh)
{
if (_MyPreviousEditItem.MyBeforeEditItems != null)
foreach(EditItem ei in _MyPreviousEditItem.MyBeforeEditItems)
top=Math.Max(top, ei.Bottom);
}
Location = new Point(_MyPreviousEditItem.Left, top);
}
}
else
TopMostEditItem.Location = new Point(TopMostEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom));
} }
_IgnoreResize = false; _IgnoreResize = false;
//ShowMe(""); //ShowMe("");
@ -2196,6 +2225,7 @@ namespace Volian.Controls.Library
} }
protected void SetupEditItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, bool addFirstChld) protected void SetupEditItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, bool addFirstChld)
{ {
if (myStepPanel.TopMostEditItem == null) myStepPanel.TopMostEditItem = this;
//if (itemInfo.ItemID == 10366) Console.WriteLine("Here"); //if (itemInfo.ItemID == 10366) Console.WriteLine("Here");
//if (itemInfo.ItemID == 225) _MyStepRTB.Resize += new EventHandler(_MyStepRTB_Resize); //if (itemInfo.ItemID == 225) _MyStepRTB.Resize += new EventHandler(_MyStepRTB_Resize);
//_MyStepRTB.MyRTBItem = this; //_MyStepRTB.MyRTBItem = this;
@ -2276,7 +2306,9 @@ namespace Volian.Controls.Library
if (ContentType == 0 && MyStepSectionLayoutData != null) if (ContentType == 0 && MyStepSectionLayoutData != null)
{ {
LastMethodsPush(string.Format("SetupRTBItem {0}", MyID)); LastMethodsPush(string.Format("SetupRTBItem {0}", MyID));
Width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); int widt = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT);
int wids = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0);
ItemWidth = Math.Max(widt, wids);
} }
} }
} }
@ -2299,6 +2331,9 @@ namespace Volian.Controls.Library
//// TIMING: DisplayItem.TimeIt("CSLARTB before Controls Add"); //// TIMING: DisplayItem.TimeIt("CSLARTB before Controls Add");
//myStepPanel.Controls.Add(this); //myStepPanel.Controls.Add(this);
int top = FindTop(0); int top = FindTop(0);
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
if (MyItemInfo.IsCaution || MyItemInfo.IsNote)
top = myParentEditItem.TopMostEditItem.Top;
if (Top < top) if (Top < top)
{ {
LastMethodsPush("SetupRTBItem"); LastMethodsPush("SetupRTBItem");