Deviation Documents now display properly in the Step Editor.
Cautions and Notes position properly when added
This commit is contained in:
parent
dea491a3d9
commit
fef4b2ba8b
@ -2139,9 +2139,27 @@ namespace Volian.Controls.Library
|
|||||||
return;
|
return;
|
||||||
int bottom = nextEditItem.FindTop(Bottom);
|
int bottom = nextEditItem.FindTop(Bottom);
|
||||||
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
|
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
|
||||||
|
{
|
||||||
if (MyItemInfo.IsCaution || MyItemInfo.IsNote)
|
if (MyItemInfo.IsCaution || MyItemInfo.IsNote)
|
||||||
bottom = Top;
|
{
|
||||||
|
if (nextEditItem.MyItemInfo.IsHigh || nextEditItem.MyItemInfo.IsFirstNotePart)
|
||||||
|
{
|
||||||
|
bottom = FirstSiblingEditItem.Top;
|
||||||
|
}
|
||||||
|
if (MyParentEditItem == nextEditItem && MyParentEditItem.NextDownEditItem != null)
|
||||||
|
{
|
||||||
|
int bot = FindBottomDevDoc;
|
||||||
|
int DDHeight = bot - FirstSiblingEditItem.Top;//Determine the height of the step including cautions and notes
|
||||||
|
if (_DevDocHeight != DDHeight)
|
||||||
|
{
|
||||||
|
_DevDocHeight = DDHeight;// If the height has changed adjust the top of the next item down
|
||||||
|
EditItem ei = MyParentEditItem.NextDownEditItem;
|
||||||
|
ei.Top = bot;
|
||||||
|
ei.AdjustLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// SameRowAsParent - Comanche Peak Step Designator
|
// SameRowAsParent - Comanche Peak Step Designator
|
||||||
//FormatData fmtdata = MyItemInfo.ActiveFormat.PlantFormat.FormatData;
|
//FormatData fmtdata = MyItemInfo.ActiveFormat.PlantFormat.FormatData;
|
||||||
//int formatSteptype = MyItemInfo.FormatStepType;
|
//int formatSteptype = MyItemInfo.FormatStepType;
|
||||||
@ -2152,7 +2170,14 @@ namespace Volian.Controls.Library
|
|||||||
// If this is a "TitleWithTextRight", don't move down on the screen but only if it has a
|
// If this is a "TitleWithTextRight", don't move down on the screen but only if it has a
|
||||||
// child, i.e. want the child to be positioned on line, but if no child, move down on screen:
|
// child, i.e. want the child to be positioned on line, but if no child, move down on screen:
|
||||||
int newTop = bottom;
|
int newTop = bottom;
|
||||||
|
if (MyItemInfo.IsStep &&nextEditItem.MyItemInfo.MyHLS.ItemID != MyItemInfo.MyHLS.ItemID)// Move from one step to another
|
||||||
|
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) // Deviation Document Format
|
||||||
|
newTop = FindBottomDevDoc;// Use the bottom most caution or note
|
||||||
|
|
||||||
if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && MyItemInfo.HasChildren) newTop = Top;
|
if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && MyItemInfo.HasChildren) newTop = Top;
|
||||||
|
//This was useful to find the code that was positioning the Deviationn Document steps
|
||||||
|
//if (MyItemInfo.InList(134782, 134783) || nextEditItem.MyItemInfo.InList(134782, 134783))
|
||||||
|
// Console.WriteLine("\"AdjustLocation\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}\t{4}\t{5}", MyItemInfo.ShortPath, nextEditItem.MyItemInfo.ShortPath, nextEditItem.MyID, newTop, FindBottom, FindBottom - Top);
|
||||||
if (nextEditItem.Top != newTop)
|
if (nextEditItem.Top != newTop)
|
||||||
{
|
{
|
||||||
MyStepPanel.ItemMoving++;
|
MyStepPanel.ItemMoving++;
|
||||||
@ -2175,6 +2200,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public int _DevDocHeight = 0; // Deviation Document Step Height
|
||||||
public void TryAgainNow(int bottom)
|
public void TryAgainNow(int bottom)
|
||||||
{
|
{
|
||||||
TryToSetTop(bottom-10);
|
TryToSetTop(bottom-10);
|
||||||
@ -2491,6 +2517,27 @@ namespace Volian.Controls.Library
|
|||||||
protected string _TabFormat;
|
protected string _TabFormat;
|
||||||
private static int _WidthAdjust = 5;
|
private static int _WidthAdjust = 5;
|
||||||
protected bool _IgnoreResize = false;
|
protected bool _IgnoreResize = false;
|
||||||
|
private int FindBottomDevDoc // Find Bottom of a Deviation Document Step
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int y = Bottom;
|
||||||
|
if (MyParentEditItem == null || MyParentEditItem.MyItemInfo.IsSection)
|
||||||
|
{
|
||||||
|
EditItem eitm2 = this;
|
||||||
|
if (eitm2 != null && eitm2.MyBeforeEditItems != null)
|
||||||
|
foreach (EditItem eitm2Tmp in eitm2.MyBeforeEditItems)
|
||||||
|
y = Math.Max(y, eitm2Tmp.Bottom);
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
y = Math.Max(y, MyParentEditItem.Bottom);
|
||||||
|
EditItem eitm = MyParentEditItem;
|
||||||
|
if (eitm != null && eitm.MyBeforeEditItems != null)
|
||||||
|
foreach (EditItem eitmTmp in eitm.MyBeforeEditItems)
|
||||||
|
y = Math.Max(y, eitmTmp.Bottom);
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the parent and postions the item with respect to the parent
|
/// Sets the parent and postions the item with respect to the parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -2523,7 +2570,28 @@ namespace Volian.Controls.Library
|
|||||||
if (this == TopMostEditItem)
|
if (this == TopMostEditItem)
|
||||||
{
|
{
|
||||||
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
|
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format)
|
||||||
|
{
|
||||||
|
if (MyPreviousEditItem != null)
|
||||||
|
{
|
||||||
|
EditItem ei = MyPreviousEditItem.BottomMostEditItem;
|
||||||
|
if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions !=null || ei.MyItemInfo.Notes!=null))
|
||||||
|
{
|
||||||
|
if (ei.MyItemInfo.Cautions!= null)// Look at cautions
|
||||||
|
{
|
||||||
|
EditItem eic = MyStepPanel._LookupEditItems[ei.MyItemInfo.Cautions[0].ItemID].BottomMostEditItem;
|
||||||
|
if (eic.Bottom > ei.Bottom) ei = eic;
|
||||||
|
}
|
||||||
|
if (ei.MyItemInfo.Notes!= null)//Look at notes
|
||||||
|
{
|
||||||
|
EditItem ein = MyStepPanel._LookupEditItems[ei.MyItemInfo.Notes[0].ItemID].BottomMostEditItem;
|
||||||
|
if (ein.Bottom > ei.Bottom) ei = ein;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ItemLocation = new Point(MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, ei.Bottom);
|
||||||
|
}
|
||||||
|
else
|
||||||
ItemLocation = new Point(MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, _MyParentEditItem.Bottom);
|
ItemLocation = new Point(MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, _MyParentEditItem.Bottom);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom);
|
ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom);
|
||||||
}
|
}
|
||||||
@ -2695,18 +2763,21 @@ namespace Volian.Controls.Library
|
|||||||
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote))
|
if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote))
|
||||||
{
|
{
|
||||||
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
|
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
|
||||||
int y = FindTop(myTop);
|
int y = Top;
|
||||||
|
if (MyPreviousEditItem == null || !MyPreviousEditItem.MyItemInfo.IsCaution || !MyItemInfo.IsNote)
|
||||||
|
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.
|
||||||
|
{ // AdjustChildren width BeforeItem setting Left offset
|
||||||
|
int width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB;
|
||||||
|
x += width + 6;//Account for the width of the Caution in the Deviation Document
|
||||||
}
|
}
|
||||||
if(MyItemInfo.IsNote)
|
|
||||||
x += Width + 6;
|
|
||||||
Location = new Point(x, y);
|
Location = new Point(x, y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2775,7 +2846,11 @@ namespace Volian.Controls.Library
|
|||||||
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
|
int x = MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT);
|
||||||
if (MyItemInfo.IsNote)
|
if (MyItemInfo.IsNote)
|
||||||
x += Width + 6;
|
x += Width + 6;
|
||||||
Location = new Point(x, _MyPreviousEditItem.Top);
|
//Find first sibling
|
||||||
|
EditItem prev = _MyPreviousEditItem;
|
||||||
|
while (prev._MyPreviousEditItem != null)
|
||||||
|
prev = prev._MyPreviousEditItem;
|
||||||
|
Location = new Point(x, prev.Top);// Use the top of the first sibling
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user