Use the TreeView timer to select the newly created step when a step is added from the TreeView. This assures that it will get focus.
Changed OnChange to be called for a specific instance Don't select newly created Step if it was created from the TreeView Adjust the locations of steps properly if a caution or note is deleted Reduce repeated setup of the RTF data in a step Add an event that fires after the Step is added from the TreeView so that the newly created step can get focus
This commit is contained in:
@@ -363,10 +363,35 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
if (shouldDelete)
|
||||
{
|
||||
float oldTop = lastRTB.MyStepItem.Top;
|
||||
StepItem newFocus = lastRTB.MyStepItem.DeleteItem();
|
||||
float newTop = newFocus.Top;
|
||||
lastRTB.MyStepItem.Dispose();
|
||||
newFocus.SetAllTabs();
|
||||
newFocus.AdjustLocation();
|
||||
// If the step being deleted appears above the step to recieve focus, find another step
|
||||
// to use so that the steps are positioned properly (vertically)
|
||||
if (oldTop < newTop)
|
||||
{
|
||||
if (newFocus.MyParentStepItem != null)
|
||||
{
|
||||
if (newFocus.Top > newFocus.MyParentStepItem.Top)
|
||||
newFocus.MyParentStepItem.AdjustLocation();
|
||||
else if (newFocus.MyParentStepItem.MyPreviousStepItem != null &&
|
||||
newFocus.Top > newFocus.MyParentStepItem.MyPreviousStepItem.Top)
|
||||
newFocus.MyParentStepItem.MyPreviousStepItem.AdjustLocation();
|
||||
else if (newFocus.MyParentStepItem.MyParentStepItem != null &&
|
||||
newFocus.Top > newFocus.MyParentStepItem.MyParentStepItem.Top)
|
||||
newFocus.MyParentStepItem.MyParentStepItem.AdjustLocation();
|
||||
else
|
||||
newFocus.AdjustLocation();
|
||||
}
|
||||
else if (newFocus.MyPreviousStepItem != null)
|
||||
newFocus.MyPreviousStepItem.AdjustLocation();
|
||||
else
|
||||
newFocus.AdjustLocation();
|
||||
}
|
||||
else
|
||||
newFocus.AdjustLocation();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user