This commit is contained in:
2010-09-23 18:45:44 +00:00
parent f4a561c1b3
commit 6604321362
4 changed files with 65 additions and 25 deletions

View File

@@ -62,6 +62,10 @@ namespace Volian.Controls.Library
private StepItem _MyPreviousStepItem = null;
private StepItem _MyNextStepItem = null;
private bool _ChildrenLoaded = false;
public bool HasChildren
{
get {return _MyBeforeStepItems != null || _MyRNOStepItems != null || _MyAfterStepItems != null;}
}
private List<StepItem> _MyBeforeStepItems;
public List<StepItem> MyBeforeStepItems
@@ -864,7 +868,6 @@ namespace Volian.Controls.Library
_Loading = false;
//// TIMING: DisplayItem.TimeIt("CSLARTB Controls Add");
}
private void SetExpandAndExpander(ItemInfo itemInfo)
{
// Don't allow substeps to expand
@@ -884,7 +887,6 @@ namespace Volian.Controls.Library
break;
}
}
private void SetupHeader(ItemInfo itemInfo)
{
lblTab.Top = 3 + ((itemInfo.HasHeader) ? 23 : 0);
@@ -1005,12 +1007,33 @@ namespace Volian.Controls.Library
//Console.Write("{0}: TopMostY={1}, TopMostParentY={2}, ParentY = {3}",title, TopMostY, TopMostParentY, ParentY);
Console.Write("{0}{1},{2},{3}", title, TopMostY, TopMostParentY.ToString() ?? "null", ParentY.ToString() ?? "null");
}
private bool _BeingRemoved = false;
public bool BeingRemoved
{
get { return _BeingRemoved; }
set { _BeingRemoved = value; }
}
public void RemoveItem()
{
BeingRemoved = true;
MyStepPanel.SelectedStepRTB = null; // Unselect the item to be deleted
StepItem newFocus = null;
//ShowTops("\r\n");
int TopMostYBefore = TopMostStepItem.Top;
StepItem newFocus = DeleteItem();
if (newFocus == null) return;
newFocus.MyStepRTB.Focus();
Dispose();
newFocus.SetAllTabs();
int TopMostYAfter = newFocus.TopMostStepItem.Top;
if (TopMostYAfter > TopMostYBefore)
newFocus.TopMostStepItem.Top = TopMostYBefore;
newFocus.AdjustLocation();
//newFocus.ShowTops("");
}
public StepItem DeleteItem()
{
StepItem newFocus = null;
int? TopMostParentY = (MyParentStepItem == null ? null : (int?)(MyParentStepItem.TopMostStepItem.Top));
int? ParentY = (MyParentStepItem == null ? null : (int?)(MyParentStepItem.Top));
try
@@ -1020,7 +1043,7 @@ namespace Volian.Controls.Library
catch (System.Data.SqlClient.SqlException ex)
{
HandleSqlExceptionOnDelete(ex);
return;
return null;
}
// Remove StepItems
RemoveFromParentsChildList();
@@ -1056,15 +1079,7 @@ namespace Volian.Controls.Library
MyParentStepItem = null;
//Console.Write(",\"Parent\",");
}
newFocus.MyStepRTB.Focus();
Dispose();
newFocus.SetAllTabs();
int TopMostYAfter = newFocus.TopMostStepItem.Top;
if (TopMostYAfter > TopMostYBefore)
newFocus.TopMostStepItem.Top = TopMostYBefore;
newFocus.AdjustLocation();
//newFocus.ShowTops("");
return;
return newFocus;
}
private void HandleSqlExceptionOnDelete(System.Data.SqlClient.SqlException ex)