This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user