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

@@ -343,13 +343,39 @@ namespace Volian.Controls.Library
{
//_SelectedStepRTB.BackColor = InactiveColor;
_SelectedStepRTB.SetBackColor();
_SelectedStepRTB.SaveText(); // Save any changes to the text
_SelectedStepRTB.SaveConfig(); // This may be redundant
//int selst = _SelectedStepRTB.SelectionStart;
_SelectedStepRTB.RTBFillIn(false);
//_SelectedStepRTB.SetSelection(selst, 0);
//_SelectedStepRTB.SelectionStart=selst;
_SelectedStepRTB.ViewRTB = true;
bool shouldDelete = !_SelectedStepRTB.MyStepItem.BeingRemoved && _SelectedStepRTB.Text.Length == 0;
if (shouldDelete)
{
if (_SelectedStepRTB.MyStepItem.HasChildren)
{
if (value != null && value.MyItemInfo.HasAncestor(_SelectedStepRTB.MyItemInfo))
{
shouldDelete = false;
}
else
{
DialogResult result = MessageBox.Show("This step does not have text but has substeps. Do you want to delete it and its substeps?", "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No) shouldDelete = false;
}
}
}
if (shouldDelete)
{
StepItem newFocus = _SelectedStepRTB.MyStepItem.DeleteItem();
_SelectedStepRTB.MyStepItem.Dispose();
newFocus.SetAllTabs();
newFocus.AdjustLocation();
}
else
{
_SelectedStepRTB.SaveText(); // Save any changes to the text
_SelectedStepRTB.SaveConfig(); // This may be redundant
//int selst = _SelectedStepRTB.SelectionStart;
_SelectedStepRTB.RTBFillIn(false);
//_SelectedStepRTB.SetSelection(selst, 0);
//_SelectedStepRTB.SelectionStart=selst;
_SelectedStepRTB.ViewRTB = true;
}
}
_SelectedStepRTB = value;
if (value != null)