B2017-175 The steps were being displayed with High-level steps and sections overlapping an expanded high-level step. The fix assures that high level steps and sections will be located vertically so that they don't overlap other steps.

This commit is contained in:
Rich 2017-08-18 12:43:45 +00:00
parent 086adde4c6
commit 88383ec87f

View File

@ -303,7 +303,7 @@ namespace Volian.Controls.Library
//private string _LastMethod = ""; //private string _LastMethod = "";
internal void LastMethodsPush(string str) internal void LastMethodsPush(string str)
{ {
if(MyStepPanel != null)MyStepPanel._LastAdjust = str; if (MyStepPanel != null) MyStepPanel._LastAdjust = str;
_LastMethods.Push(str); _LastMethods.Push(str);
} }
internal string LastMethodsPop() internal string LastMethodsPop()
@ -331,7 +331,7 @@ namespace Volian.Controls.Library
// whether it is expanded or collapsed. // whether it is expanded or collapsed.
if (MyParentEditItem.MyPreviousEditItem != null) return MyParentEditItem.MyPreviousEditItem.BottomMostEditItem.Bottom; if (MyParentEditItem.MyPreviousEditItem != null) return MyParentEditItem.MyPreviousEditItem.BottomMostEditItem.Bottom;
if (MyParentEditItem.MyBeforeEditItems != null) return MyParentEditItem.MyBeforeEditItems[MyParentEditItem.MyBeforeEditItems.Count - 1].BottomMostEditItem.Bottom; if (MyParentEditItem.MyBeforeEditItems != null) return MyParentEditItem.MyBeforeEditItems[MyParentEditItem.MyBeforeEditItems.Count - 1].BottomMostEditItem.Bottom;
return (MySectionRTBItem==null)?0:MySectionRTBItem.Bottom; return (MySectionRTBItem == null) ? 0 : MySectionRTBItem.Bottom;
} }
int b1 = prevOrParSupInfo.BottomMostEditItem.Bottom; int b1 = prevOrParSupInfo.BottomMostEditItem.Bottom;
int b2 = b1; int b2 = b1;
@ -370,7 +370,7 @@ namespace Volian.Controls.Library
{ {
EditItem eitmp = null; EditItem eitmp = null;
// if on a Note/Caution, need to be sure there isn't a step before me with supinfo (don't just assume going to Section) // if on a Note/Caution, need to be sure there isn't a step before me with supinfo (don't just assume going to Section)
if (prev.MyParentEditItem.MyPreviousEditItem!=null)eitmp = prev.MyParentEditItem.MyPreviousEditItem.BottomMostEditItem.FindPreviousOrParentSupInfo(); if (prev.MyParentEditItem.MyPreviousEditItem != null) eitmp = prev.MyParentEditItem.MyPreviousEditItem.BottomMostEditItem.FindPreviousOrParentSupInfo();
return eitmp; return eitmp;
} }
if (prev.MyParentEditItem.MySupInfoEditItems != null) return prev.MyParentEditItem.MySupInfoEditItems[0]; if (prev.MyParentEditItem.MySupInfoEditItems != null) return prev.MyParentEditItem.MySupInfoEditItems[0];
@ -438,7 +438,7 @@ namespace Volian.Controls.Library
{ {
if (MyItemInfo.IsSupInfoPart) if (MyItemInfo.IsSupInfoPart)
{ {
int? tmptop = FindTopSupInfo(test1); int? tmptop = FindTopSupInfo(test1);
return tmptop == null ? bottom : Math.Max(bottom, (int)tmptop); return tmptop == null ? bottom : Math.Max(bottom, (int)tmptop);
} }
} }
@ -722,16 +722,16 @@ namespace Volian.Controls.Library
{ {
EditItem prevChild = nextEditItem.MyPreviousEditItem; EditItem prevChild = nextEditItem.MyPreviousEditItem;
EditItem parent = nextEditItem.MyParentEditItem; EditItem parent = nextEditItem.MyParentEditItem;
if(siblingEditItems.Contains(nextEditItem)) if (siblingEditItems.Contains(nextEditItem))
siblingEditItems.Insert(siblingEditItems.IndexOf(nextEditItem), this); siblingEditItems.Insert(siblingEditItems.IndexOf(nextEditItem), this);
else else
siblingEditItems.Insert(0, this); siblingEditItems.Insert(0, this);
MyStepPanel.ItemMoving++; MyStepPanel.ItemMoving++;
_MyNextEditItem = nextEditItem; _MyNextEditItem = nextEditItem;
if(!MyItemInfo.IsNote || !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format || MyPreviousEditItem == null) if (!MyItemInfo.IsNote || !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format || MyPreviousEditItem == null)
nextEditItem._MyPreviousEditItem = this; nextEditItem._MyPreviousEditItem = this;
MyPreviousEditItem = prevChild;// If a previous exists - this will adjust the location and width of the EditItem MyPreviousEditItem = prevChild;// If a previous exists - this will adjust the location and width of the EditItem
if (MyItemInfo.IsNote && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyPreviousEditItem != null) if (MyItemInfo.IsNote && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyPreviousEditItem != null)
nextEditItem.MyPreviousEditItem = this;//Position First Note in Dev Doc Format nextEditItem.MyPreviousEditItem = this;//Position First Note in Dev Doc Format
if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format || !(nextEditItem.MyItemInfo.IsNote && MyItemInfo.IsCaution)) if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format || !(nextEditItem.MyItemInfo.IsNote && MyItemInfo.IsCaution))
{ {
@ -980,11 +980,11 @@ namespace Volian.Controls.Library
newFocus = MyNextEditItem; newFocus = MyNextEditItem;
} }
// Adjust the vertical locations of all of the items below the item deleted // Adjust the vertical locations of all of the items below the item deleted
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyNextEditItem.MyPreviousEditItem == null && if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyNextEditItem.MyPreviousEditItem == null &&
(MyNextEditItem.MyItemInfo.IsNote || MyNextEditItem.MyItemInfo.IsCaution)) (MyNextEditItem.MyItemInfo.IsNote || MyNextEditItem.MyItemInfo.IsCaution))
{ {
MyNextEditItem.MyParentEditItem.Top = (MyNextEditItem.MyParentEditItem.MyPreviousEditItem != null ? MyNextEditItem.MyParentEditItem.Top = (MyNextEditItem.MyParentEditItem.MyPreviousEditItem != null ?
MyNextEditItem.MyParentEditItem.MyPreviousEditItem.FindBottomDevDoc: MyNextEditItem.MyParentEditItem.MyParentEditItem.Bottom); MyNextEditItem.MyParentEditItem.MyPreviousEditItem.FindBottomDevDoc : MyNextEditItem.MyParentEditItem.MyParentEditItem.Bottom);
MyNextEditItem.Top = MyNextEditItem.MyParentEditItem.Top; MyNextEditItem.Top = MyNextEditItem.MyParentEditItem.Top;
MyNextEditItem.AdjustLocation(); MyNextEditItem.AdjustLocation();
} }
@ -1223,7 +1223,7 @@ namespace Volian.Controls.Library
child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem, FigInsType); child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem, FigInsType);
else if (MyItemInfo.IsRtfRaw) else if (MyItemInfo.IsRtfRaw)
child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem);
if(MyItemInfo.MyContent.MyGrid != null) if (MyItemInfo.MyContent.MyGrid != null)
child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem);
else else
child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem);
@ -1357,7 +1357,7 @@ namespace Volian.Controls.Library
public void AddSiblingBefore(int? type, bool updateStatus) public void AddSiblingBefore(int? type, bool updateStatus)
{ {
SaveContents(); SaveContents();
ItemInfo newItemInfo = MyItemInfo.InsertSiblingBefore("", "",type); ItemInfo newItemInfo = MyItemInfo.InsertSiblingBefore("", "", type);
AddGridIfNeeded(newItemInfo); AddGridIfNeeded(newItemInfo);
AddImageIfNeeded(newItemInfo); AddImageIfNeeded(newItemInfo);
DoAddSiblingBefore(newItemInfo, updateStatus); DoAddSiblingBefore(newItemInfo, updateStatus);
@ -1594,9 +1594,9 @@ namespace Volian.Controls.Library
public void PasteSiblingBefore(int copyStartID) public void PasteSiblingBefore(int copyStartID)
{ {
ItemInfo newItemInfo = MyItemInfo.PasteSiblingBefore(copyStartID, GetChangeId(MyItemInfo)); ItemInfo newItemInfo = MyItemInfo.PasteSiblingBefore(copyStartID, GetChangeId(MyItemInfo));
if (newItemInfo.ItemID == MyItemInfo.ItemID) return; if (newItemInfo.ItemID == MyItemInfo.ItemID) return;
EditItem newEditItem = null; EditItem newEditItem = null;
switch (_MyChildRelation) switch (_MyChildRelation)
{ {
@ -1759,7 +1759,7 @@ namespace Volian.Controls.Library
} }
EditItem nextItem = GetNextItem(fromType, newItemInfo); EditItem nextItem = GetNextItem(fromType, newItemInfo);
EditItem newEditItem; EditItem newEditItem;
switch (fromType) switch (fromType)
{ {
case E_FromType.Caution: case E_FromType.Caution:
@ -1801,7 +1801,7 @@ namespace Volian.Controls.Library
// To allow a Paste Step into an empty (new) step/substep, we need to add a character to the the Text field // To allow a Paste Step into an empty (new) step/substep, we need to add a character to the the Text field
// to simulate replacing an existing step - otherwise we will get null references. // to simulate replacing an existing step - otherwise we will get null references.
if (MyStepPanel.SelectedEditItem.Empty) if (MyStepPanel.SelectedEditItem.Empty)
MyStepPanel.SelectedEditItem.Empty=false; MyStepPanel.SelectedEditItem.Empty = false;
MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted
ChildRelation childRelation = _MyChildRelation; ChildRelation childRelation = _MyChildRelation;
EditItem newFocus = null; EditItem newFocus = null;
@ -1821,7 +1821,7 @@ namespace Volian.Controls.Library
//catch (System.Data.SqlClient.SqlException ex) //catch (System.Data.SqlClient.SqlException ex)
catch (Exception ex) catch (Exception ex)
{ {
if (HandleSqlExceptionOnCopy(ex)) return this; if (HandleSqlExceptionOnCopy(ex)) return this;
HandleSqlExceptionOnDelete(ex); HandleSqlExceptionOnDelete(ex);
return this; return this;
} }
@ -1888,12 +1888,12 @@ namespace Volian.Controls.Library
MessageBox.Show("The step being pasted has been deleted", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand); MessageBox.Show("The step being pasted has been deleted", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand);
return true; return true;
} }
if(ex.Message.Contains("This current step has been deleted in another session")) if (ex.Message.Contains("This current step has been deleted in another session"))
{ {
MessageBox.Show("The highlighted step has been deleted by another user.", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand); MessageBox.Show("The highlighted step has been deleted by another user.", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand);
return true; return true;
} }
return false; return false;
} }
public void IdentifyChildren(bool highlight) public void IdentifyChildren(bool highlight)
{ {
@ -2048,64 +2048,64 @@ namespace Volian.Controls.Library
//Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,10,"\"EditItem_Move\"\t\"\"\t\"{0}\"\t{1}\t{2}\t{3}",MyItemInfo.ShortPath, MyID, Top, _LastTop); //Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,10,"\"EditItem_Move\"\t\"\"\t\"{0}\"\t{1}\t{2}\t{3}",MyItemInfo.ShortPath, MyID, Top, _LastTop);
if (_LastTop == newTop) return; if (_LastTop == newTop) return;
_LastTop = newTop; _LastTop = newTop;
int watchThis = _WatchThis; int watchThis = _WatchThis;
if (MyStepPanel.ItemMoving == 0 && !TryAgainLater) if (MyStepPanel.ItemMoving == 0 && !TryAgainLater)
{ {
//vlnStackTrace.ScrollInStack(); //vlnStackTrace.ScrollInStack();
return; // If 0 - Indicates scrolling which requires no action. return; // If 0 - Indicates scrolling which requires no action.
} }
TryAgainLater = false; TryAgainLater = false;
//ShowMe("Move"); //ShowMe("Move");
if (MyItemInfo == null) if (MyItemInfo == null)
return; return;
//if (_WatchThis > 0 && MyID > _StartingID) //if (_WatchThis > 0 && MyID > _StartingID)
//{ //{
// Console.WriteLine("{0}Start Move {1},{2}", WatchThisIndent, MyID, this); // Console.WriteLine("{0}Start Move {1},{2}", WatchThisIndent, MyID, this);
// if (MyID == _LookForID) // if (MyID == _LookForID)
// Console.WriteLine("{0}---------------", WatchThisIndent,MyID, this); // Console.WriteLine("{0}---------------", WatchThisIndent,MyID, this);
// _WatchThis++; // _WatchThis++;
//} //}
if (MyExpandingStatus == ExpandingStatus.Expanding) if (MyExpandingStatus == ExpandingStatus.Expanding)
{
_WatchThis = watchThis;
return;
}
Moving = true;
EditItem tmp = (EditItem)sender;
if (tmp.MyPreviousEditItem == null && tmp.MyParentEditItem == null)
{
_WatchThis = watchThis;
return;
}
if (RNOBelow) // Adjust substeps first
{
//Console.WriteLine("RNOBelow");
AdjustLocation();
MoveRNO();
}
else // Adjust RNO First
{
if (RNORight)
{ {
_WatchThis = watchThis; //Console.WriteLine("RNORight");
return;
}
Moving = true;
EditItem tmp = (EditItem)sender;
if (tmp.MyPreviousEditItem == null && tmp.MyParentEditItem == null)
{
_WatchThis = watchThis;
return;
}
if (RNOBelow) // Adjust substeps first
{
//Console.WriteLine("RNOBelow");
AdjustLocation();
MoveRNO(); MoveRNO();
} }
else // Adjust RNO First AdjustLocation();
{
if (RNORight)
{
//Console.WriteLine("RNORight");
MoveRNO();
}
AdjustLocation();
}
Moving = false;
EditItem btm = BottomMostEditItem;
EditItem supinfo = null;
if (MySupInfoEditItems != null && MySupInfoEditItems.Count > 0) supinfo = MySupInfoEditItems[0].BottomMostEditItem;
if (supinfo != null && supinfo.Bottom > btm.Bottom) btm = supinfo;
if (this != btm)
btm.AdjustLocation();
//if (_WatchThis > 0 && MyID > _StartingID)
//{
// Console.WriteLine("{0}Finish Move {1},{2}",WatchThisIndent, MyID, this);
//}
_WatchThis = watchThis;
} }
Moving = false;
EditItem btm = BottomMostEditItem;
EditItem supinfo = null;
if (MySupInfoEditItems != null && MySupInfoEditItems.Count > 0) supinfo = MySupInfoEditItems[0].BottomMostEditItem;
if (supinfo != null && supinfo.Bottom > btm.Bottom) btm = supinfo;
if (this != btm)
btm.AdjustLocation();
//if (_WatchThis > 0 && MyID > _StartingID)
//{
// Console.WriteLine("{0}Finish Move {1},{2}",WatchThisIndent, MyID, this);
//}
_WatchThis = watchThis;
}
/// <summary> /// <summary>
/// Adjust the locations when the EditItem is resized /// Adjust the locations when the EditItem is resized
/// </summary> /// </summary>
@ -2150,7 +2150,7 @@ namespace Volian.Controls.Library
int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2; int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2;
int rightLimit = aboveForLocation.Right; int rightLimit = aboveForLocation.Right;
// Then should center on the wid Limit // Then should center on the wid Limit
if ((MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0 ) && !MyItemInfo.IsInSupInfo) if ((MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0) && !MyItemInfo.IsInSupInfo)
{ {
// B2017-043 COLR is used as a Width // B2017-043 COLR is used as a Width
int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode);
@ -2164,7 +2164,7 @@ namespace Volian.Controls.Library
int x = center - width / 2; int x = center - width / 2;
if (x + width > rightLimit) x = rightLimit - width; if (x + width > rightLimit) x = rightLimit - width;
// B2017-043 account for Horizontal Scroll // B2017-043 account for Horizontal Scroll
int colT =MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay((int)myStepSectionLayoutData.ColT); int colT = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay((int)myStepSectionLayoutData.ColT);
if (x < colT) x = colT; if (x < colT) x = colT;
int y = FindTop(myParentEditItem.Bottom); int y = FindTop(myParentEditItem.Bottom);
return new Point(x, y); return new Point(x, y);
@ -2186,7 +2186,7 @@ namespace Volian.Controls.Library
if (!MyStepRTB.ContainsFocus) if (!MyStepRTB.ContainsFocus)
MyStepRTB.Focus(); MyStepRTB.Focus();
} }
protected void ToggleContinuousActionSummary() protected void ToggleContinuousActionSummary()
{ {
if (MyStepPropertiesPanel != null) // bug fix B2016-256 check for a null reference incase we are not on a step element if (MyStepPropertiesPanel != null) // bug fix B2016-256 check for a null reference incase we are not on a step element
MyStepPropertiesPanel.ToggleContActSummary(); // update the checkbox on the Step Properties panel MyStepPropertiesPanel.ToggleContActSummary(); // update the checkbox on the Step Properties panel
@ -2249,7 +2249,7 @@ namespace Volian.Controls.Library
if (Top >= 0 && Bottom <= MyStepPanel.Height) return;// Don't move if within screen. if (Top >= 0 && Bottom <= MyStepPanel.Height) return;// Don't move if within screen.
int scrollValue = MyStepPanel.VerticalScroll.Value + (Top - (MyStepPanel.Height / 2)); // calculate scroll center for the item int scrollValue = MyStepPanel.VerticalScroll.Value + (Top - (MyStepPanel.Height / 2)); // calculate scroll center for the item
// Limit scroll location within allowable values // Limit scroll location within allowable values
scrollValue = Math.Max(MyStepPanel.VerticalScroll.Minimum,Math.Min(MyStepPanel.VerticalScroll.Maximum,scrollValue)); scrollValue = Math.Max(MyStepPanel.VerticalScroll.Minimum, Math.Min(MyStepPanel.VerticalScroll.Maximum, scrollValue));
//Console.WriteLine("CenterScroll {0} Current {1} New {2} Min {3} Max {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, scrollValue, _Panel.VerticalScroll.Minimum, _Panel.VerticalScroll.Maximum); //Console.WriteLine("CenterScroll {0} Current {1} New {2} Min {3} Max {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, scrollValue, _Panel.VerticalScroll.Minimum, _Panel.VerticalScroll.Maximum);
//if (scrollValue >= MyStepPanel.VerticalScroll.Minimum && scrollValue <= MyStepPanel.VerticalScroll.Maximum) // If it is within range //if (scrollValue >= MyStepPanel.VerticalScroll.Minimum && scrollValue <= MyStepPanel.VerticalScroll.Maximum) // If it is within range
MyStepPanel.VerticalScroll.Value = scrollValue; // Center the item MyStepPanel.VerticalScroll.Value = scrollValue; // Center the item
@ -2395,9 +2395,9 @@ 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()
{ {
if (MyStepPanel.ShuttingDown) return; if (MyStepPanel.ShuttingDown) return;
@ -2412,9 +2412,17 @@ namespace Volian.Controls.Library
// _NextDownEditItemPath); // _NextDownEditItemPath);
if (nextEditItem != null) if (nextEditItem != null)
{ {
if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.IsSection) return; // without this, if next item is section, it crashes on null reference if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.IsSection)
{
AddAdjustItem(this);// B2017-175 Adjust Location after Expanding
return; // without this, if next item is section, it crashes on null reference
}
if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.MyHLS.ItemID != MyStepPanel.ExpandingHLS.ItemID) if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.MyHLS.ItemID != MyStepPanel.ExpandingHLS.ItemID)
{
AddAdjustItem(this);// B2017-175 Adjust Location after Expanding
return; return;
}
if (AdjustItems.Contains(this)) AdjustItems.Remove(this);//B2017-175 If processed remove from list to do later
int bottom = nextEditItem.FindTop(Bottom); int bottom = nextEditItem.FindTop(Bottom);
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
{ {
@ -2466,12 +2474,27 @@ namespace Volian.Controls.Library
_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'", _MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath); oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
nextEditItem.TryAgainLater = true; nextEditItem.TryAgainLater = true;
} }
nextEditItem.LastMethodsPop(); nextEditItem.LastMethodsPop();
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
} }
} }
} }
private static List<EditItem> _AdjustItems=new List<EditItem>();// B2017-175 Keep a list of EditItems to adjust after expanding
public static List<EditItem> AdjustItems
{
get { return _AdjustItems; }
set { _AdjustItems = value; }
}
private static void AddAdjustItem(EditItem ei)// B2017-175 Add edit item to adjust after expanding
{
if(!AdjustItems.Contains(ei)) AdjustItems.Add(ei);
}
private static void ProcessAdjustItems() // B2017-175 adjust after expanding
{
while (AdjustItems.Count > 0)
AdjustItems[0].AdjustLocation();
}
private int _DevDocHeight = 0; // Deviation Document Step Height B2016-123, B2017-020, B2017-021 private int _DevDocHeight = 0; // Deviation Document Step Height B2016-123, B2017-020, B2017-021
public int DevDocHeight public int DevDocHeight
{ {
@ -2480,7 +2503,7 @@ namespace Volian.Controls.Library
} }
public void TryAgainNow(int bottom) public void TryAgainNow(int bottom)
{ {
TryToSetTop(bottom-10); TryToSetTop(bottom - 10);
//TryToSetTop(bottom+10); //TryToSetTop(bottom+10);
TryToSetTop(bottom); TryToSetTop(bottom);
} }
@ -2488,7 +2511,7 @@ namespace Volian.Controls.Library
{ {
Top = offset; Top = offset;
if (Top != offset) if (Top != offset)
_MyLog.InfoFormat("Didn't work - Top {0} != offset {1} {2}", Top, offset,MyStepPanel.VerticalScroll.Value); _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
@ -2497,7 +2520,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
{ {
if(MyStepPanel.AutoExpand) if (MyStepPanel.AutoExpand)
Expand((_ContentType >= 20000) || MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format); Expand((_ContentType >= 20000) || MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format);
else else
Expand(false); Expand(false);
@ -2556,10 +2579,10 @@ namespace Volian.Controls.Library
// Only check the flag if the section has subsections because the // Only check the flag if the section has subsections because the
// default for the flag is not editable, and this would make non-metasections // default for the flag is not editable, and this would make non-metasections
// not editable. // not editable.
bool hasMetaSubs = MyItemInfo.IsSection && MyItemInfo.Sections != null && MyItemInfo.Sections.Count>0; bool hasMetaSubs = MyItemInfo.IsSection && MyItemInfo.Sections != null && MyItemInfo.Sections.Count > 0;
bool EditSteps = !hasMetaSubs || (MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y"); bool EditSteps = !hasMetaSubs || (MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y");
if (EditSteps) AddChildAfter(MyItemInfo.Steps, expand); if (EditSteps) AddChildAfter(MyItemInfo.Steps, expand);
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode && if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode &&
!((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) !((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds))
AddChildRNO(MyItemInfo.RNOs, expand); AddChildRNO(MyItemInfo.RNOs, expand);
@ -2569,6 +2592,8 @@ namespace Volian.Controls.Library
} }
MyExpandingStatus = ExpandingStatus.Done; MyExpandingStatus = ExpandingStatus.Done;
BottomMostEditItem.AdjustLocation(); BottomMostEditItem.AdjustLocation();
if (MyItemInfo.IsHigh)
ProcessAdjustItems(); // B2017-175 Adjust after expanding
MyExpandingStatus = ExpandingStatus.No; MyExpandingStatus = ExpandingStatus.No;
//// TIMING: DisplayItem.TimeIt("Expand End"); //// TIMING: DisplayItem.TimeIt("Expand End");
} }
@ -2715,7 +2740,7 @@ namespace Volian.Controls.Library
if (btmNext != null) if (btmNext != null)
{ {
int bottom = btmNext.FindTop(btm.Bottom); int bottom = btmNext.FindTop(btm.Bottom);
if (btmNext.MySupInfoEditItems != null && btmNext.MySupInfoEditItems.Count > 0) if (btmNext.MySupInfoEditItems != null && btmNext.MySupInfoEditItems.Count > 0)
{ {
int btmSupInfo = btmNext.MySupInfoEditItems[0].FindTop(btm.Bottom); int btmSupInfo = btmNext.MySupInfoEditItems[0].FindTop(btm.Bottom);
if (btmSupInfo > bottom) bottom = btmSupInfo; if (btmSupInfo > bottom) bottom = btmSupInfo;
@ -2795,7 +2820,7 @@ namespace Volian.Controls.Library
public abstract bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse); public abstract bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse);
public abstract void PositionToEnd(); public abstract void PositionToEnd();
public abstract void PositionToStart(); public abstract void PositionToStart();
public abstract string SelectedTextForFind { get;} public abstract string SelectedTextForFind { get; }
public abstract bool SpellCheckNext(); public abstract bool SpellCheckNext();
public abstract void IdentifyMe(bool highlight); public abstract void IdentifyMe(bool highlight);
public abstract void SetActive(); public abstract void SetActive();
@ -2884,14 +2909,14 @@ namespace Volian.Controls.Library
if (MyPreviousEditItem != null) if (MyPreviousEditItem != null)
{ {
EditItem ei = MyPreviousEditItem.BottomMostEditItem; EditItem ei = MyPreviousEditItem.BottomMostEditItem;
if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions !=null || ei.MyItemInfo.Notes!=null)) if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions != null || ei.MyItemInfo.Notes != null))
{ {
if (ei.MyItemInfo.Cautions!= null)// Look at cautions if (ei.MyItemInfo.Cautions != null)// Look at cautions
{ {
EditItem eic = MyStepPanel._LookupEditItems[ei.MyItemInfo.Cautions[0].ItemID].BottomMostEditItem; EditItem eic = MyStepPanel._LookupEditItems[ei.MyItemInfo.Cautions[0].ItemID].BottomMostEditItem;
if (eic.Bottom > ei.Bottom) ei = eic; if (eic.Bottom > ei.Bottom) ei = eic;
} }
if (ei.MyItemInfo.Notes!= null)//Look at notes if (ei.MyItemInfo.Notes != null)//Look at notes
{ {
EditItem ein = MyStepPanel._LookupEditItems[ei.MyItemInfo.Notes[0].ItemID].BottomMostEditItem; EditItem ein = MyStepPanel._LookupEditItems[ei.MyItemInfo.Notes[0].ItemID].BottomMostEditItem;
if (ein.Bottom > ei.Bottom) ei = ein; if (ein.Bottom > ei.Bottom) ei = ein;
@ -2937,7 +2962,7 @@ namespace Volian.Controls.Library
// Paul Linn made the request on 6/4/12 to align the Component Description & // Paul Linn made the request on 6/4/12 to align the Component Description &
// Required Position under the Component Number. // Required Position under the Component Number.
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom);
// part of F2017-011, for enhanced backgrounds, always align the TitleWithTextRight and TitleWithTextBelow with the parent tab (on the screen) // part of F2017-011, for enhanced backgrounds, always align the TitleWithTextRight and TitleWithTextBelow with the parent tab (on the screen)
else if ((MyItemInfo.FormatStepData.Type == "TitleWithTextRight" || MyItemInfo.FormatStepData.Type == "TitleWithTextBelow") && ((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) // align with parent tab if in background document else if ((MyItemInfo.FormatStepData.Type == "TitleWithTextRight" || MyItemInfo.FormatStepData.Type == "TitleWithTextBelow") && ((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) // align with parent tab if in background document
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom);
else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0)) // this code is run for siblings within a HLS (but not last sibling). else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0)) // this code is run for siblings within a HLS (but not last sibling).
@ -2956,7 +2981,7 @@ namespace Volian.Controls.Library
{ {
ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.Bottom); ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.Bottom);
// if inserting a substep within supplemental information, then may have to adjust steps too: // if inserting a substep within supplemental information, then may have to adjust steps too:
if (MyItemInfo.IsInSupInfo) if (MyItemInfo.IsInSupInfo)
{ {
AdjustLocation(); AdjustLocation();
// find parent of supinfo & adjust its location: // find parent of supinfo & adjust its location:
@ -3004,12 +3029,12 @@ namespace Volian.Controls.Library
ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0);
else if (MyItemInfo.MyTab != null && MyItemInfo.MyTab.Offset != 0) else if (MyItemInfo.MyTab != null && MyItemInfo.MyTab.Offset != 0)
{ {
// Farley - part of bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset) // Farley - part of bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset)
ContentWidth = _MyParentEditItem.ContentWidth; ContentWidth = _MyParentEditItem.ContentWidth;
int xOffTabNew = (MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.Offset : MyItemInfo.MyParent.OffsetTab) + MyItemInfo.MyTab.Offset; int xOffTabNew = (MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.Offset : MyItemInfo.MyParent.OffsetTab) + MyItemInfo.MyTab.Offset;
xOffTabNew += MyItemInfo.MyParent.MyTab == null ? 0 : MyItemInfo.MyParent.MyTab.Offset; xOffTabNew += MyItemInfo.MyParent.MyTab == null ? 0 : MyItemInfo.MyParent.MyTab.Offset;
int xIncrement = xOffTabNew - MyItemInfo.MyTab.Offset; int xIncrement = xOffTabNew - MyItemInfo.MyTab.Offset;
MyStepRTB.Location = new Point(MyStepRTB.Location.X + xIncrement, MyStepRTB.Location.Y); MyStepRTB.Location = new Point(MyStepRTB.Location.X + xIncrement, MyStepRTB.Location.Y);
} }
else else
ItemWidth = _MyParentEditItem.ContentWidth; ItemWidth = _MyParentEditItem.ContentWidth;
@ -3063,11 +3088,11 @@ namespace Volian.Controls.Library
// width for the screen (this does not affect the printout) // width for the screen (this does not affect the printout)
// If in single column, don't make this adjustment: // If in single column, don't make this adjustment:
string[] splitRNOWidthAlt = MyStepSectionLayoutData.RNOWidthAlt.Split(','); string[] splitRNOWidthAlt = MyStepSectionLayoutData.RNOWidthAlt.Split(',');
int ovrRNOWidth = (RNOLevel < splitRNOWidthAlt.Length)?MyStepPanel.ToDisplay(float.Parse(splitRNOWidthAlt[RNOLevel])+1) : 0; int ovrRNOWidth = (RNOLevel < splitRNOWidthAlt.Length) ? MyStepPanel.ToDisplay(float.Parse(splitRNOWidthAlt[RNOLevel]) + 1) : 0;
if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1 && MyItemInfo.ColumnMode != 0) if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1 && MyItemInfo.ColumnMode != 0)
ContentWidth = ovrRNOWidth; ContentWidth = ovrRNOWidth;
else else
ContentWidth = _MyParentEditItem.ContentWidth; ContentWidth = _MyParentEditItem.ContentWidth;
_IgnoreResize = false; _IgnoreResize = false;
if (RNOLevel <= MyItemInfo.ColumnMode) if (RNOLevel <= MyItemInfo.ColumnMode)
{ {
@ -3127,23 +3152,23 @@ namespace Volian.Controls.Library
//} //}
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote))
{ {
// B2017-043 account for Horizontal Scroll // B2017-043 account for Horizontal Scroll
int x = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); int x = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
int y = Top; int y = Top;
if (MyPreviousEditItem == null || !MyPreviousEditItem.MyItemInfo.IsCaution || !MyItemInfo.IsNote) if (MyPreviousEditItem == null || !MyPreviousEditItem.MyItemInfo.IsCaution || !MyItemInfo.IsNote)
y = FindTop(myTop); y = FindTop(myTop);
// Get the "bottom" number of the longest Caution/Note on the step/substep above so that // Get the "bottom" number of the longest Caution/Note on the step/substep above so that
// we can position properly on the screen. // we can position properly on the screen.
// EX. Catawba Deviations E-1 step deviation for step 10 // EX. Catawba Deviations E-1 step deviation for step 10
EditItem eitm = (MyParentEditItem.MyPreviousEditItem != null) ? MyParentEditItem.MyPreviousEditItem : MyParentEditItem.MyParentEditItem; EditItem eitm = (MyParentEditItem.MyPreviousEditItem != null) ? MyParentEditItem.MyPreviousEditItem : MyParentEditItem.MyParentEditItem;
if (eitm != null && eitm.MyBeforeEditItems != null) if (eitm != null && eitm.MyBeforeEditItems != null)
foreach (EditItem eitmTmp in eitm.MyBeforeEditItems) foreach (EditItem eitmTmp in eitm.MyBeforeEditItems)
y = Math.Max(y, eitmTmp.Bottom); y = Math.Max(y, eitmTmp.Bottom);
if (MyItemInfo.IsNote) // Move to the right based upon the Width of the Caution which is the same as the width of the note. if (MyItemInfo.IsNote) // Move to the right based upon the Width of the Caution which is the same as the width of the note.
{ // AdjustChildren width BeforeItem setting Left offset { // AdjustChildren width BeforeItem setting Left offset
int width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB; int width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB;
x += width + 6;//Account for the width of the Caution in the Deviation Document x += width + 6;//Account for the width of the Caution in the Deviation Document
} }
Location = new Point(x, y); Location = new Point(x, y);
} }
else else
@ -3225,7 +3250,7 @@ namespace Volian.Controls.Library
else if (MyPreviousEditItem != null && MyPreviousEditItem.MyItemInfo.FormatStepData != null && MyPreviousEditItem.MyItemInfo.FormatStepData.ReadOnly) else if (MyPreviousEditItem != null && MyPreviousEditItem.MyItemInfo.FormatStepData != null && MyPreviousEditItem.MyItemInfo.FormatStepData.ReadOnly)
ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0);
// RHM The following lines were commented-out for Facing Pages (Supplemental Information) to test follow the instructions // RHM The following lines were commented-out for Facing Pages (Supplemental Information) to test follow the instructions
//else if (MyItemInfo.MyTab.Offset != 0) // Farley - part of bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset) //else if (MyItemInfo.MyTab.Offset != 0) // Farley - part of bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset)
// ContentWidth = (MyPreviousEditItem.MyItemInfo.MyTab.Offset != 0) ? MyPreviousEditItem.ContentWidth : MyPreviousEditItem.ContentWidth + 10; // ContentWidth = (MyPreviousEditItem.MyItemInfo.MyTab.Offset != 0) ? MyPreviousEditItem.ContentWidth : MyPreviousEditItem.ContentWidth + 10;
else else
Width = MyPreviousEditItem.Width; Width = MyPreviousEditItem.Width;
@ -3310,7 +3335,7 @@ namespace Volian.Controls.Library
} }
private EditItem AdjustForSupInfoHeight() private EditItem AdjustForSupInfoHeight()
{ {
if (MyStepPanel._LookupEditItems.ContainsKey(MyID) && MyItemInfo.IsInSupInfo) // only do this if it is displayed (in LookupEditItems and in sup info column if (MyStepPanel._LookupEditItems.ContainsKey(MyID) && MyItemInfo.IsInSupInfo) // only do this if it is displayed (in LookupEditItems and in sup info column
{ {
ItemInfo supInfoPart = MyItemInfo; ItemInfo supInfoPart = MyItemInfo;
while (!supInfoPart.IsSupInfoPart) supInfoPart = supInfoPart.MyParent; while (!supInfoPart.IsSupInfoPart) supInfoPart = supInfoPart.MyParent;
@ -3331,7 +3356,7 @@ namespace Volian.Controls.Library
EIWsupInfoBelow.Top = Math.Max(bottomOfAboveSupInfoColumn, bottomOfImmediatelyAbove); EIWsupInfoBelow.Top = Math.Max(bottomOfAboveSupInfoColumn, bottomOfImmediatelyAbove);
EIWsupInfoBelow.AdjustLocation(); EIWsupInfoBelow.AdjustLocation();
MyStepPanel.ItemMoving--; MyStepPanel.ItemMoving--;
return EIWsupInfoBelow.MySupInfoEditItems==null?null:EIWsupInfoBelow.MySupInfoEditItems[0]; return EIWsupInfoBelow.MySupInfoEditItems == null ? null : EIWsupInfoBelow.MySupInfoEditItems[0];
} }
} }
return null; return null;
@ -3340,7 +3365,7 @@ namespace Volian.Controls.Library
{ {
ItemInfo hls = ei.MyItemInfo.MyHLS; ItemInfo hls = ei.MyItemInfo.MyHLS;
EditItem hlsEI = GetEditItemFromItemID(hls.ItemID); EditItem hlsEI = GetEditItemFromItemID(hls.ItemID);
if (hlsEI==null) return null; if (hlsEI == null) return null;
return ei; return ei;
} }
// FindSiblingOrParentSiblingWithSupInfo will find the next edititem below me on the screen that has a supinfo // FindSiblingOrParentSiblingWithSupInfo will find the next edititem below me on the screen that has a supinfo
@ -3353,7 +3378,7 @@ namespace Volian.Controls.Library
} }
EditItem chldOfNext = null; EditItem chldOfNext = null;
// if section, handle notes/cautions on section and if none, look for hls (children of section) // if section, handle notes/cautions on section and if none, look for hls (children of section)
if (itm.NextItem.IsSection) if (itm.NextItem.IsSection)
{ {
if (itm.NextItem.Steps == null || itm.NextItem.Steps.Count == 0) return null; if (itm.NextItem.Steps == null || itm.NextItem.Steps.Count == 0) return null;
chldOfNext = FindFirstCautionOrNoteWithSupInfo(itm.NextItem); chldOfNext = FindFirstCautionOrNoteWithSupInfo(itm.NextItem);
@ -3373,7 +3398,7 @@ namespace Volian.Controls.Library
return GetEditItemFromItemID(itm.NextItem.ItemID); return GetEditItemFromItemID(itm.NextItem.ItemID);
} }
// no longer looking at next, go to children. // no longer looking at next, go to children.
chldOfNext = FindFirstChildWithSupInfo(itm.NextItem); chldOfNext = FindFirstChildWithSupInfo(itm.NextItem);
if (chldOfNext != null) return CheckForExpanded(chldOfNext); if (chldOfNext != null) return CheckForExpanded(chldOfNext);
return FindSiblingOrParentSiblingWithSupInfo(itm.NextItem); return FindSiblingOrParentSiblingWithSupInfo(itm.NextItem);
} }
@ -3393,14 +3418,14 @@ namespace Volian.Controls.Library
} }
} }
// if on a caution or note check the step below me, which is really my activeparent (cautions/notes are above their respective parent) // if on a caution or note check the step below me, which is really my activeparent (cautions/notes are above their respective parent)
if ((itm.IsCaution || itm.IsNote) && itm.NextItem == null && (itm.ActiveParent as ItemInfo).SupInfos != null && (itm.ActiveParent as ItemInfo).SupInfos.Count > 0) if ((itm.IsCaution || itm.IsNote) && itm.NextItem == null && (itm.ActiveParent as ItemInfo).SupInfos != null && (itm.ActiveParent as ItemInfo).SupInfos.Count > 0)
return GetEditItemFromItemID((itm.ActiveParent as ItemInfo).ItemID); return GetEditItemFromItemID((itm.ActiveParent as ItemInfo).ItemID);
// Finally check substeps: // Finally check substeps:
if (itm.Steps == null || itm.Steps.Count == 0) return null; if (itm.Steps == null || itm.Steps.Count == 0) return null;
foreach (ItemInfo ii in itm.Steps) foreach (ItemInfo ii in itm.Steps)
{ {
if (ii.SupInfos != null && ii.SupInfos.Count > 0) if (ii.SupInfos != null && ii.SupInfos.Count > 0)
return GetEditItemFromItemID(ii.ItemID); return GetEditItemFromItemID(ii.ItemID);
EditItem chld = FindFirstChildWithSupInfo(ii); EditItem chld = FindFirstChildWithSupInfo(ii);
if (chld != null) return CheckForExpanded(chld); if (chld != null) return CheckForExpanded(chld);
@ -3467,7 +3492,7 @@ namespace Volian.Controls.Library
{ {
EditItem ei = this; EditItem ei = this;
while (ei != null && !ei.MyItemInfo.IsHigh) ei = ei.MyParent;// Get High Level Step while (ei != null && !ei.MyItemInfo.IsHigh) ei = ei.MyParent;// Get High Level Step
if(ei != null) ei=ei.MyNextEditItem;// Get Next High Level Step if (ei != null) ei = ei.MyNextEditItem;// Get Next High Level Step
if (ei != null) if (ei != null)
{ {
if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions != null || ei.MyItemInfo.Notes != null)) if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions != null || ei.MyItemInfo.Notes != null))
@ -3538,7 +3563,7 @@ namespace Volian.Controls.Library
vlntxt = null; vlntxt = null;
} }
ContentFont = myStepPanel.StepFont;//lblTab.Font = myStepPanel.StepFont; ContentFont = myStepPanel.StepFont;//lblTab.Font = myStepPanel.StepFont;
if (itemInfo.MyTab != null ) TabFont = itemInfo.MyTab.MyFont.WindowsFont; if (itemInfo.MyTab != null) TabFont = itemInfo.MyTab.MyFont.WindowsFont;
MyStepData = itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[ContentType % 10000]; MyStepData = itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[ContentType % 10000];
break; break;
} }
@ -3612,7 +3637,7 @@ namespace Volian.Controls.Library
if (itemInfo.IsSupInfoPart) if (itemInfo.IsSupInfoPart)
{ {
EditItem high = MyStepPanel._LookupEditItems[itemInfo.MyHLS.ItemID]; EditItem high = MyStepPanel._LookupEditItems[itemInfo.MyHLS.ItemID];
ContentLocation = new Point(high.ContentLeft + high.Width + 36, (int)_MyParentEditItem.Top + SupInfoTopOffset); ContentLocation = new Point(high.ContentLeft + high.Width + 36, (int)_MyParentEditItem.Top + SupInfoTopOffset);
} }
//// TIMING: DisplayItem.TimeIt("CSLARTB SetText"); //// TIMING: DisplayItem.TimeIt("CSLARTB SetText");
if (itemInfo != null) if (itemInfo != null)
@ -3710,7 +3735,7 @@ namespace Volian.Controls.Library
//g.DrawLine(Pens.DarkGreen, 18, 3, 21, 3); //g.DrawLine(Pens.DarkGreen, 18, 3, 21, 3);
//g.DrawLine(Pens.DarkGreen, 18, 6, 21, 6); //g.DrawLine(Pens.DarkGreen, 18, 6, 21, 6);
//g.DrawString("B", fnt, Brushes.Green, new RectangleF(new PointF(0,0), this.Size), StringFormat.GenericDefault); //g.DrawString("B", fnt, Brushes.Green, new RectangleF(new PointF(0,0), this.Size), StringFormat.GenericDefault);
g.DrawString(dved.PdfToken, fnt, Brushes.Green, new RectangleF(new PointF(x,y), this.Size), StringFormat.GenericDefault); g.DrawString(dved.PdfToken, fnt, Brushes.Green, new RectangleF(new PointF(x, y), this.Size), StringFormat.GenericDefault);
if (y > 0) if (y > 0)
{ {
x += 18; x += 18;
@ -3757,7 +3782,7 @@ namespace Volian.Controls.Library
if (this is GridItem) if (this is GridItem)
{ {
GridItem gi = this as GridItem; GridItem gi = this as GridItem;
X = gi.MyFlexGrid.Right+2; X = gi.MyFlexGrid.Right + 2;
H = gi.MyFlexGrid.Height; H = gi.MyFlexGrid.Height;
} }
else if (this is RtfRawItem) else if (this is RtfRawItem)
@ -3778,7 +3803,7 @@ namespace Volian.Controls.Library
X = ri.MyStepRTB.Right + 2; X = ri.MyStepRTB.Right + 2;
H = ri.MyStepRTB.Height; H = ri.MyStepRTB.Height;
} }
g.DrawLine(penCB, X, ContentTop, X, ContentTop+H); //Height); g.DrawLine(penCB, X, ContentTop, X, ContentTop + H); //Height);
} }
} }
if (UserCheckOff) if (UserCheckOff)
@ -3807,7 +3832,7 @@ namespace Volian.Controls.Library
else else
location = new PointF(ii.MyPictureBox.Left + ii.MyPictureBox.Width + 2, ii.MyPictureBox.Top); location = new PointF(ii.MyPictureBox.Left + ii.MyPictureBox.Width + 2, ii.MyPictureBox.Top);
} }
else else
{ {
RTBItem ri = this as RTBItem; RTBItem ri = this as RTBItem;
// SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab // SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab
@ -3823,7 +3848,7 @@ namespace Volian.Controls.Library
// 'UserCheckOff' or 'UserCheckOffChar' properties to reflect that. // 'UserCheckOff' or 'UserCheckOffChar' properties to reflect that.
if (co != null && co.UIMark != null) if (co != null && co.UIMark != null)
{ {
UserCheckOffChar = (char)co.UIMark; UserCheckOffChar = (char)co.UIMark;
Font myFont = new Font("VolianDraw", MyItemInfo.MyTab.MyFont.WindowsFont.Size); Font myFont = new Font("VolianDraw", MyItemInfo.MyTab.MyFont.WindowsFont.Size);
g.DrawString(UserCheckOffChar.ToString(), myFont, Brushes.DarkGreen, new RectangleF(location, MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); g.DrawString(UserCheckOffChar.ToString(), myFont, Brushes.DarkGreen, new RectangleF(location, MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault);
} }