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:
Rich
2010-12-02 22:23:50 +00:00
parent d01b27c80d
commit 5b70652cb4
8 changed files with 80 additions and 34 deletions

View File

@@ -153,6 +153,7 @@ namespace VEPROMS
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo);
tc.ItemPaste += new StepPanelItemPastedEvent(tc_ItemPasted);
_CommentTitleBckColor = epAnnotations.TitleStyle.BackColor1.Color;
@@ -168,6 +169,15 @@ namespace VEPROMS
this.Activated += new EventHandler(frmVEPROMS_Activated);
VlnSettings.StepTypeToolType = Settings.Default.StepTypeToolTip;
}
/// <summary>
/// Activate tmrTreeView so that the newly created Step recieves focus
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void tv_NodeInsert(object sender, vlnTreeEventArgs args)
{
tmrTreeView.Enabled = true;
}
void frmVEPROMS_Activated(object sender, EventArgs e)
{
// refresh anything that pertains to external files or programs:
@@ -194,9 +204,9 @@ namespace VEPROMS
}
bool tv_InsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
{
return tc.InsertStepItem(args.MyItemInfo, args.StepText, args.InsertType, args.FromType, args.Type);
// Don't select the newly created Step. This will be handled by tmrTreeView
return tc.InsertStepItem(args.MyItemInfo, args.StepText, args.InsertType, args.FromType, args.Type, false);
}
private bool tv_DeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args)
{
return tc.DeleteStepItem(args.MyItemInfo);
@@ -345,7 +355,8 @@ namespace VEPROMS
DisplayTabItem tabItem = tc.GetProcDisplayTabItem(mySection);
if(tabItem != null)tabItem.MyStepTabPanel.MyStepPanel.Reset();
}
SetupNodes((VETreeNode)args.Node);
// Don't select the newly created Step. This will be handled by tmrTreeView
//SetupNodes((VETreeNode)args.Node);
}
private void tv_NodeSelect(object sender, vlnTreeEventArgs args)
{