diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs index f7a1b85e..f56fc7e3 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs @@ -1150,6 +1150,8 @@ namespace VEPROMS this.tc.Size = new System.Drawing.Size(1088, 660); this.tc.TabIndex = 8; this.tc.PanelTabDisplay += new Volian.Controls.Library.StepPanelTabDisplayEvent(this.tc_PanelTabDisplay); + this.tc.WordSectionClose += new Volian.Controls.Library.StepPanelWordSectionCloseEvent(tc_WordSectionClose); + this.tc.WordSectionDeleted += new Volian.Controls.Library.StepPanelWordSectionDeletedEvent(tc_WordSectionDeleted); this.tc.ItemSelectedChanged += new Volian.Controls.Library.ItemSelectedChangedEvent(this.tc_ItemSelectedChanged); this.tc.ModeChange += new Volian.Controls.Library.StepPanelModeChangeEvent(this.tc_StepPanelModeChange); this.tc.LinkModifyTran += new Volian.Controls.Library.StepPanelLinkEvent(this.tc_LinkModifyTran); diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 471c2f27..2dbfd44f 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -45,12 +45,12 @@ namespace VEPROMS if (value == null) // DSO Tab Panel { if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyItemInfo != null) // 2nd part is for unassociated libdocs - SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.MyActiveParent.ActiveParent as DocVersionInfo; + SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.ActiveParent.ActiveParent as DocVersionInfo; else SelectedDVI = null; } else // Step Tab Panel - SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.MyActiveParent as DocVersionInfo; + SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.ActiveParent as DocVersionInfo; } } public DocVersionInfo SelectedDVI @@ -120,6 +120,8 @@ namespace VEPROMS tv.Nodes.Add(tn); tv.NodeOpenProperty += new vlnTreeViewPropertyEvent(tv_NodeOpenProperty); tv.NodeSelect += new Volian.Controls.Library.vlnTreeViewEvent(tv_NodeSelect); + tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem); + tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo); _CommentTitleBckColor = epAnnotations.TitleStyle.BackColor1.Color; if (!btnAnnoDetailsPushPin.Checked) epAnnotations.Expanded = false; @@ -127,7 +129,15 @@ namespace VEPROMS toolsPanel.Expanded = false; ribbonControl1.ExpandedChanged +=new EventHandler(ribbonControl1_ExpandedChanged); } - + + private bool tv_DeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args) + { + return tc.DeleteStepItem(args.MyItemInfo); + //if (si == null) return false; + //si.RemoveItem(); + //return true; + } + private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e) { // Save the location and size of the VE-PROMS appication for this user @@ -147,12 +157,18 @@ namespace VEPROMS if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size; if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState; _MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"])); + _MyMRIList.AfterRemove += new ItemInfoEvent(_MyMRIList_AfterRemove); SetupMRU(); displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); ctrlAnnotationDetails.SetupAnnotations(displaySearch1); SetupButtons(); displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs } + + void _MyMRIList_AfterRemove(object sender) + { + SetupMRU(); + } private void SetupButtons() { #if (DEBUG) @@ -260,7 +276,10 @@ namespace VEPROMS } this.Text = caption.ToString(); } - + void tv_OpenItem(object sender, vlnTreeItemInfoEventArgs args) + { + tc.OpenItem(args.MyItemInfo); + } /// /// When the treeview is clicked - a timer is set /// This is done because the focus is returned to the treeview after the click event @@ -292,11 +311,11 @@ namespace VEPROMS // Check to make sure that a node has been selected and // that the mouse is within the bounds of the node. if (tn != null && tn.Bounds.Left < newPoint.X) - { + { tv.SelectedNode = tn; - tv.Enabled = false; - tmrTreeView.Enabled = true; - } + tv.Enabled = false; + tmrTreeView.Enabled = true; + } } } /// @@ -726,6 +745,22 @@ namespace VEPROMS } #endregion #region PanelSupport + private void tc_WordSectionClose(object sender, WordSectionEventArgs args) + { + if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo); + } + private void tc_WordSectionDeleted(object sender, WordSectionEventArgs args) + { + // is it a library document - if so and libdoc panel is visible, update lists on panel. + if ((!args.MySectionInfo.IsStepSection) && ((args.MySectionInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "")!="") && (toolsPanel.Expanded)) + { + if (toolsTabs.SelectedTab == tabItemLibDocs) + { + displayLibDocs.RefreshLibDocPanel(tc); + } + } + } + private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args) { if (args.PanelTabName == "Bookmarks") @@ -777,7 +812,10 @@ namespace VEPROMS else { if (_CurrentItem != args.MyItemInfo) + { + if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted); _CurrentItem = args.MyItemInfo; + } //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); if (args.MyStepItem == null) { @@ -810,6 +848,7 @@ namespace VEPROMS displayBookMarks.MyRTB = args.MyStepItem.MyStepRTB; displayRO.ProgressBar = bottomProgBar; lblEditView.Text = args.MyStepItem.MyStepRTB.ViewRTB ? "View" : "Edit"; + _CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted); } if(tc.SelectedDisplayTabItem != null) SelectedStepTabPanel = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; @@ -817,6 +856,11 @@ namespace VEPROMS ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); AnnotationPanelView(); } + + void _CurrentItem_Deleted(object sender) + { + //displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem); + } #endregion #region Annotations ///