From f208c98202cbe8cbd4b1f4b80a770cefe58ba7a2 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 17 Nov 2010 22:29:54 +0000 Subject: [PATCH] Copy all fields from Library Document when converting a Library Document to a Stand-alone Document Added code to update the Procedure Panel when a Word Section is added. Created a method to find a ProcedureDisplayTabItem for a specific item Added code to Reset the Tab when a Section's Number is changed. Added code to Reset a Procedures Parts when a Panel is Reset Added an event for a Node being added. --- .../frmSectionProperties.cs | 2 +- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 16 +++++++++++++++- .../Volian.Controls.Library/DisplayTabControl.cs | 9 +++++++++ PROMS/Volian.Controls.Library/StepItem.cs | 1 + PROMS/Volian.Controls.Library/StepPanel.cs | 1 + PROMS/Volian.Controls.Library/vlnTreeView.cs | 8 ++++++-- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index b57f1abf..7cd2929d 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -465,7 +465,7 @@ namespace VEPROMS { // make new document with 'no' libtitle - use libtitle for the doc title. Then link this // to the item... - Document doc = Document.MakeDocument(null, doclibinfo.DocContent, null, null, null); + Document doc = Document.MakeDocument(null, doclibinfo.DocContent,doclibinfo.DocAscii,doclibinfo.Config,doclibinfo.DocPdf); _SectionConfig.MySection.MyContent.MyEntry.MyDocument = doc; } ppCmbxLibDoc.Items.Clear(); diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 486c2e56..84403b89 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -149,6 +149,7 @@ namespace VEPROMS tv.Nodes.Add(tn); tv.NodeOpenProperty += new vlnTreeViewPropertyEvent(tv_NodeOpenProperty); tv.NodeSelect += new Volian.Controls.Library.vlnTreeViewEvent(tv_NodeSelect); + tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew); tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem); tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo); tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo); @@ -331,7 +332,20 @@ namespace VEPROMS } // The following code is used to setup the user interface depending on what // is selected on the tree view (see vlnTreeView.cs) - private void tv_NodeSelect(object sender, Volian.Controls.Library.vlnTreeEventArgs args) + void tv_NodeNew(object sender, vlnTreeEventArgs args) + { + VETreeNode vNode = (VETreeNode)args.Node; + IVEDrillDownReadOnly veObj = vNode.VEObject; + SectionInfo mySection = veObj as SectionInfo; + if (mySection.MyContent.MyEntry != null) + { + // if it is a word section, find the DisplayTabItem; + DisplayTabItem tabItem = tc.GetProcDisplayTabItem(mySection); + if(tabItem != null)tabItem.MyStepTabPanel.MyStepPanel.Reset(); + } + SetupNodes((VETreeNode)args.Node); + } + private void tv_NodeSelect(object sender, vlnTreeEventArgs args) { SetupNodes((VETreeNode)args.Node); } diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index dd20ca99..1ef912ca 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -560,6 +560,15 @@ namespace Volian.Controls.Library } return null; } + public DisplayTabItem GetProcDisplayTabItem(ItemInfo myItemInfo) + { + ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item + string key = "Item - " + proc.ItemID.ToString(); + DisplayTabItem pg = null; + if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it + return _MyDisplayTabItems[key]; + return null; + } /// /// This opens a Step page based upon a ItemInfo. /// diff --git a/PROMS/Volian.Controls.Library/StepItem.cs b/PROMS/Volian.Controls.Library/StepItem.cs index 7fad86ef..911ba79b 100644 --- a/PROMS/Volian.Controls.Library/StepItem.cs +++ b/PROMS/Volian.Controls.Library/StepItem.cs @@ -168,6 +168,7 @@ namespace Volian.Controls.Library // Update the text to reflect the content change MyStepRTB.MyItemInfo.RefreshItemAnnotations(); MyStepRTB.MyItemInfo=MyStepRTB.MyItemInfo; // Reset Text + TabFormat = null; // Reset Tab SetExpandAndExpander(MyItemInfo); // TODO: Need code to update tabs ? not sure what this is - maybe for // transitions? diff --git a/PROMS/Volian.Controls.Library/StepPanel.cs b/PROMS/Volian.Controls.Library/StepPanel.cs index 27f1186d..a9db8e09 100644 --- a/PROMS/Volian.Controls.Library/StepPanel.cs +++ b/PROMS/Volian.Controls.Library/StepPanel.cs @@ -321,6 +321,7 @@ namespace Volian.Controls.Library { ItemInfo parent = SelectedItemInfo.ActiveParent as ItemInfo; if (parent != null) ItemInfo.ResetParts(parent.ItemID); // Force data to reload + else ItemInfo.ResetParts(SelectedItemInfo.ItemID); // The following line actually reloads the procedure item MyProcedureItemInfo = MyProcedureItemInfo; // see get/set above. - Load Procedure and Sections // The following line expands the items needed to display SelectedItemInfo diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 14e92c29..47ee5e03 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -302,6 +302,11 @@ namespace Volian.Controls.Library { if (NodeSelect != null) NodeSelect(sender, args); } + public event vlnTreeViewEvent NodeNew; + private void OnNodeNew(object sender, vlnTreeEventArgs args) + { + if (NodeNew != null) NodeNew(sender, args); + } public event vlnTreeViewEvent NodeSelectionChange; private void OnNodeSelectionChange(object sender, vlnTreeEventArgs args) { @@ -935,8 +940,7 @@ namespace Volian.Controls.Library if (tn != null) { SelectedNode = tn; - OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode)); - + OnNodeNew(this, new vlnTreeEventArgs(SelectedNode)); Refresh(); } }