Fix Caution and Note layout after delete.

This commit is contained in:
Rich 2010-10-13 21:09:59 +00:00
parent 1412d3ac81
commit 043995b4b4

View File

@ -218,7 +218,10 @@ namespace Volian.Controls.Library
ItemWidth = _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColT) + _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidT); ItemWidth = _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColT) + _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidT);
break; break;
case 1: // Section case 1: // Section
ItemLocation = new Point(_MyParentStepItem.ItemLocation.X + 20, _MyParentStepItem.Bottom); if(this == TopMostStepItem)
ItemLocation = new Point(_MyParentStepItem.ItemLocation.X + 20, _MyParentStepItem.Bottom);
else
TopMostStepItem.ItemLocation = new Point(TopMostStepItem.ItemLocation.X, _MyParentStepItem.Bottom);
int borderWidth = _MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width; int borderWidth = _MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width;
//TextWidth = _WidthAdjust + borderWidth + _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); //TextWidth = _WidthAdjust + borderWidth + _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1);
TextWidth = _WidthAdjust + borderWidth + _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); TextWidth = _WidthAdjust + borderWidth + _MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode);
@ -465,7 +468,10 @@ namespace Volian.Controls.Library
else else
{ {
Width = MyPreviousStepItem.Width; Width = MyPreviousStepItem.Width;
Location = new Point(_MyPreviousStepItem.Left, FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom)); if (TopMostStepItem == this)
Location = new Point(_MyPreviousStepItem.Left, FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom));
else
TopMostStepItem.Location = new Point(TopMostStepItem.Left, FindTop(_MyPreviousStepItem.BottomMostStepItem.Bottom));
} }
_IgnoreResize=false; _IgnoreResize=false;
//ShowMe(""); //ShowMe("");
@ -1027,7 +1033,6 @@ namespace Volian.Controls.Library
MyNextStepItem.MyPreviousStepItem = MyPreviousStepItem; MyNextStepItem.MyPreviousStepItem = MyPreviousStepItem;
MyPreviousStepItem = null; MyPreviousStepItem = null;
newFocus = MyNextStepItem; newFocus = MyNextStepItem;
//Console.Write(",\"Next 1\",");
} }
else else
{ {
@ -1035,8 +1040,9 @@ namespace Volian.Controls.Library
MyParentStepItem = null; MyParentStepItem = null;
MyNextStepItem.MyPreviousStepItem = null; MyNextStepItem.MyPreviousStepItem = null;
newFocus = MyNextStepItem; newFocus = MyNextStepItem;
//Console.Write(",\"Next 2\",");
} }
// Adjust the vertical locations of all of the items below the item deleted
MyNextStepItem.TopMostStepItem.AdjustLocation();
MyNextStepItem = null; MyNextStepItem = null;
} }
else if (MyPreviousStepItem != null) else if (MyPreviousStepItem != null)
@ -2336,7 +2342,7 @@ namespace Volian.Controls.Library
} }
public override string ToString() public override string ToString()
{ {
return _MyItemInfo == null ? base.ToString() : string.Format("({0}) {1}", MyID, MyPath); // + "-" + MyItemInfo.MyContent.Text; return _MyItemInfo == null ? base.ToString() : string.Format("{0},'{1}'", MyID, MyPath); // + "-" + MyItemInfo.MyContent.Text;
} }
#endregion #endregion
} }