- Bug Fix - Update RNO tab when AER tab is updated

- Commented-Out debug for location
- Bug Fix - Cautions are now added above existing notes
Bug Fix - AdjustSizeForContents - Only adjust width if text != ""
This commit is contained in:
Rich 2010-01-08 14:33:04 +00:00
parent 843c3fc85a
commit ec1d6f9bd2
2 changed files with 23 additions and 15 deletions

View File

@ -750,7 +750,6 @@ namespace Volian.Controls.Library
// TODO: Remove Label and just output ident on the paint event // TODO: Remove Label and just output ident on the paint event
lblTab.Left = 20; lblTab.Left = 20;
SetupHeader(itemInfo); SetupHeader(itemInfo);
this.Paint += new PaintEventHandler(StepItem_Paint); this.Paint += new PaintEventHandler(StepItem_Paint);
this.BackColorChanged += new EventHandler(StepItem_BackColorChanged); this.BackColorChanged += new EventHandler(StepItem_BackColorChanged);
if (itemInfo != null) if (itemInfo != null)
@ -968,7 +967,8 @@ namespace Volian.Controls.Library
SetupHeader(); SetupHeader();
if (_MyAfterStepItems != null) foreach (StepItem chld in _MyAfterStepItems) chld.SetAllTabs(); if (_MyAfterStepItems != null) foreach (StepItem chld in _MyAfterStepItems) chld.SetAllTabs();
if (_MyNextStepItem != null) _MyNextStepItem.SetAllTabs(); if (_MyNextStepItem != null) _MyNextStepItem.SetAllTabs();
// Update the RNO tab if it exists - RHM 20100106
if (_MyRNOStepItems != null) foreach (StepItem chld in _MyRNOStepItems) chld.SetAllTabs();
} }
/// <summary> /// <summary>
/// Add the next item to a list /// Add the next item to a list
@ -996,7 +996,7 @@ namespace Volian.Controls.Library
{ {
MyStepPanel.SelectedStepRTB = null; // Unselect the item to be deleted MyStepPanel.SelectedStepRTB = null; // Unselect the item to be deleted
StepItem newFocus = null; StepItem newFocus = null;
ShowTops("\r\n"); //ShowTops("\r\n");
int TopMostYBefore = TopMostStepItem.Top; int TopMostYBefore = TopMostStepItem.Top;
int? TopMostParentY = (MyParentStepItem == null ? null : (int?)(MyParentStepItem.TopMostStepItem.Top)); int? TopMostParentY = (MyParentStepItem == null ? null : (int?)(MyParentStepItem.TopMostStepItem.Top));
int? ParentY = (MyParentStepItem == null ? null : (int?)(MyParentStepItem.Top)); int? ParentY = (MyParentStepItem == null ? null : (int?)(MyParentStepItem.Top));
@ -1018,7 +1018,7 @@ namespace Volian.Controls.Library
MyNextStepItem.MyPreviousStepItem = MyPreviousStepItem; MyNextStepItem.MyPreviousStepItem = MyPreviousStepItem;
MyPreviousStepItem = null; MyPreviousStepItem = null;
newFocus = MyNextStepItem; newFocus = MyNextStepItem;
Console.Write(",\"Next 1\","); //Console.Write(",\"Next 1\",");
} }
else else
{ {
@ -1026,7 +1026,7 @@ namespace Volian.Controls.Library
MyParentStepItem = null; MyParentStepItem = null;
MyNextStepItem.MyPreviousStepItem = null; MyNextStepItem.MyPreviousStepItem = null;
newFocus = MyNextStepItem; newFocus = MyNextStepItem;
Console.Write(",\"Next 2\","); //Console.Write(",\"Next 2\",");
} }
MyNextStepItem = null; MyNextStepItem = null;
} }
@ -1035,13 +1035,13 @@ namespace Volian.Controls.Library
MyPreviousStepItem.MyNextStepItem = null; MyPreviousStepItem.MyNextStepItem = null;
newFocus = MyPreviousStepItem; newFocus = MyPreviousStepItem;
MyPreviousStepItem = null; MyPreviousStepItem = null;
Console.Write(",\"Previous\","); //Console.Write(",\"Previous\",");
} }
else else
{ {
newFocus = MyParentStepItem; newFocus = MyParentStepItem;
MyParentStepItem = null; MyParentStepItem = null;
Console.Write(",\"Parent\","); //Console.Write(",\"Parent\",");
} }
newFocus.MyStepRTB.Focus(); newFocus.MyStepRTB.Focus();
Dispose(); Dispose();
@ -1050,7 +1050,7 @@ namespace Volian.Controls.Library
if (TopMostYAfter > TopMostYBefore) if (TopMostYAfter > TopMostYBefore)
newFocus.TopMostStepItem.Top = TopMostYBefore; newFocus.TopMostStepItem.Top = TopMostYBefore;
newFocus.AdjustLocation(); newFocus.AdjustLocation();
newFocus.ShowTops(""); //newFocus.ShowTops("");
return; return;
} }
@ -1275,7 +1275,14 @@ namespace Volian.Controls.Library
_WatchThis = 1; _WatchThis = 1;
ItemInfo newItemInfo = MyItemInfo.InsertChild(fromType, type, text); ItemInfo newItemInfo = MyItemInfo.InsertChild(fromType, type, text);
// TODO: We need to determine where this will go in the stack of children // TODO: We need to determine where this will go in the stack of children
StepItem nextItem = MyStepPanel.FindItem(newItemInfo.NextItem); StepItem nextItem = null;
if(newItemInfo.NextItem != null)
nextItem = MyStepPanel.FindItem(newItemInfo.NextItem);
// Cautions come before notes, so if this is a Caution and there are Notes, put this first
else if(fromType == E_FromType.Caution && ((ItemInfo)newItemInfo.ActiveParent).Notes != null
&& ((ItemInfo)newItemInfo.ActiveParent).Notes.Count > 0)
nextItem = MyStepPanel.FindItem(((ItemInfo)newItemInfo.ActiveParent).Notes[0]);
// TODO: May need similar logic if a Table is being added to a step that has substeps
StepItem newStepItem; StepItem newStepItem;
switch (fromType) switch (fromType)
{ {
@ -1397,7 +1404,7 @@ namespace Volian.Controls.Library
/// <param name="e"></param> /// <param name="e"></param>
private void StepItem_Resize(object sender, EventArgs e) private void StepItem_Resize(object sender, EventArgs e)
{ {
ShowMe("Resize"); //ShowMe("Resize");
if (MyStepRTB.Text.EndsWith("\n")) if (MyStepRTB.Text.EndsWith("\n"))
if (!_LookForID.Contains(MyID)) if (!_LookForID.Contains(MyID))
{ {
@ -1442,7 +1449,7 @@ namespace Volian.Controls.Library
//vlnStackTrace.ScrollInStack(); //vlnStackTrace.ScrollInStack();
return; // If 0 - Indicates scrolling which requires no action. return; // If 0 - Indicates scrolling which requires no action.
} }
ShowMe("Move"); //ShowMe("Move");
if (_MyItemInfo == null) if (_MyItemInfo == null)
return; return;
//if (_WatchThis > 0 && MyID > _StartingID) //if (_WatchThis > 0 && MyID > _StartingID)

View File

@ -342,7 +342,7 @@ namespace Volian.Controls.Library
public StepRTB() public StepRTB()
{ {
InitializeComponent(); InitializeComponent();
SetUp(); SetUpStepRTB();
AddEventHandlers(); AddEventHandlers();
} }
public StepRTB(IContainer container) public StepRTB(IContainer container)
@ -350,7 +350,7 @@ namespace Volian.Controls.Library
container.Add(this); container.Add(this);
InitializeComponent(); InitializeComponent();
_Container = container; _Container = container;
SetUp(); SetUpStepRTB();
AddEventHandlers(); AddEventHandlers();
} }
protected override void OnMouseWheel(MouseEventArgs e) protected override void OnMouseWheel(MouseEventArgs e)
@ -386,7 +386,7 @@ namespace Volian.Controls.Library
this.MouseLeave += new EventHandler(StepRTB_MouseLeave); this.MouseLeave += new EventHandler(StepRTB_MouseLeave);
this.SelectionChanged +=new EventHandler(StepRTB_SelectionChanged); this.SelectionChanged +=new EventHandler(StepRTB_SelectionChanged);
} }
private void SetUp() private void SetUpStepRTB()
{ {
this.Height = 10; // initialize the height to 10, the default height was too big for the cells in grid tables this.Height = 10; // initialize the height to 10, the default height was too big for the cells in grid tables
BorderStyle = System.Windows.Forms.BorderStyle.None; BorderStyle = System.Windows.Forms.BorderStyle.None;
@ -808,7 +808,8 @@ namespace Volian.Controls.Library
Size offset = Size - ClientSize; Size offset = Size - ClientSize;
int widthNew = ContentsSize.Width + offset.Width + AdjustSize.Width ; int widthNew = ContentsSize.Width + offset.Width + AdjustSize.Width ;
int heightNew = ContentsSize.Height + offset.Height + AdjustSize.Height; int heightNew = ContentsSize.Height + offset.Height + AdjustSize.Height;
Size szNew = new Size((adjustWidth ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew); // Don't make the window narrower unless it has text - RHM - 20100107
Size szNew = new Size(((Text != "" && adjustWidth) ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew);
if (this.Size != szNew) if (this.Size != szNew)
{ {
this.Size = szNew; this.Size = szNew;