C2015-022 Separate Windows Upgrade – For Right Mouse Click, don’t allow Insert Folder Before/After in child windows and when a procedure set is in child window, only allow the Insert of a folder tree node.

This commit is contained in:
John Jenko 2018-03-12 14:38:21 +00:00
parent 725f5d651f
commit 678018c4a1

View File

@ -989,6 +989,24 @@ namespace Volian.Controls.Library
--Folder level
see if we need to disable "Export Procedure Set" or "Folder Specific Information"
*/
if (tn.MovedToSeparateWindow)
{
foreach (MenuItem itm in cm.MenuItems)
{
if (!itm.Text.StartsWith("Insert")) // C2015-022 only enable insert folder before/after if in the main window and the procedures of this folder are in a child window
itm.Enabled = false;
}
}
else if (tn.InChildWindow)
{
foreach (MenuItem itm in cm.MenuItems)
{
if (itm.Text.StartsWith("Insert")) // C2015-022 disable insert folder before/after if doing a properties on a folder in a child window
itm.Enabled = false;
}
}
else
{
if (!tn.ChildrenLoaded) tn.LoadChildren();
VETreeNode wrkdrft = (VETreeNode)tn.LastNode;
DocVersionInfo docver = wrkdrft.VEObject as DocVersionInfo;
@ -1012,6 +1030,7 @@ namespace Volian.Controls.Library
}
}
}
}
if (oil != null && oil.Count > 0 && tn.VEObject as DocVersionInfo != null)
{
/*
@ -2192,7 +2211,7 @@ namespace Volian.Controls.Library
OpenProperties(tn.VEObject as SectionInfo);
else if ((tn.VEObject as StepInfo) != null)
MessageBox.Show("Open up info tab or whatever is associated with step");
tn.RefreshNode();
if (!tn.MovedToSeparateWindow) tn.RefreshNode(); // C2015-022 don't want to rebuild tree node in the main window if it is currently in a child window
}
private void OpenProperties(FolderInfo folderInfo)
{
@ -3726,6 +3745,7 @@ namespace Volian.Controls.Library
{
return (VETreeNode)this.Nodes[0]; // Return the top node
}
if (selectedItem == ((VETreeNode)this.Nodes[0]).VEObject) return (VETreeNode)this.Nodes[0]; // C2015-022 check needed for tree in child windows
VETreeNode parent = FindNodeAndExpand(selectedItem.ActiveParent);
if (parent == null) return null;
if (!parent.IsExpanded)
@ -3743,7 +3763,7 @@ namespace Volian.Controls.Library
foreach (TreeNode tn in tnc)
if (tn is VETreeNode)
{
if ((tn as VETreeNode).VEObject is ItemInfo && ((tn as VETreeNode).VEObject as ItemInfo).ItemID == (selectedItem as ItemInfo).ItemID)
if ((tn as VETreeNode).VEObject is ItemInfo && (selectedItem is ItemInfo) && ((tn as VETreeNode).VEObject as ItemInfo).ItemID == (selectedItem as ItemInfo).ItemID)
return tn as VETreeNode;
else
{