diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 8f2b251f..39a96ffc 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -1247,7 +1247,8 @@ namespace VEPROMS frm.MySessionInfo = MySessionInfo; tc.dicEnhancedDocuments.Add(args.MyItemInfo.MyProcedure.MyDocVersion, frm); frm.FormClosed += frm_FormClosed; - frm.Show(this); + //frm.Show(this); When this was specified the child form displayed on top of the parent form. + frm.Show(); // With this removed either form can be on top (user selectable - currently active form on top) } else { @@ -2454,7 +2455,8 @@ namespace VEPROMS if (SelectedStepTabPanel == null) return; displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; - displayTransition.CurTrans = null; + // RHM - The follwing line was reseting the settings on the transtion panel to "not" show the currently selected transition. + //displayTransition.CurTrans = null; } #endregion #region InfoTabLibDocs diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index d06bcc53..3a94c27b 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -139,12 +139,21 @@ namespace Volian.Controls.Library } ItemInfo tmpitm = selitm; ItemInfo secitm = null; - + // Find the procedure level first. - while (tmpitm.MyContent.Type != 0) + if (tmpitm.MyContent.Type == 0) // If at the procedure level then need to set the default section { - if (tmpitm.MyContent.Type >=10000 && tmpitm.MyContent.Type<20000 && secitm == null) secitm = tmpitm; - tmpitm = tmpitm.MyParent; + int scid = FindSectionStart(tmpitm); + if(scid > 0) secitm = SectionInfo.Get(scid); + } + else + { + while (tmpitm.MyContent.Type != 0) + { + if (tmpitm.MyContent.Type >= 10000 && tmpitm.MyContent.Type < 20000 && secitm == null) + secitm = tmpitm; + tmpitm = tmpitm.MyParent; + } } _CurrentProcedure = tmpitm; _CurrentToProcedure = _CurrentProcedure; @@ -874,22 +883,23 @@ namespace Volian.Controls.Library } } // 2) Look in SectionConfig/OriginalSteps = 'Y' - foreach (SectionInfo sio in prcitm.Sections) + if (prcitm.Sections != null) { - SectionConfig sc = sio.MyConfig as SectionConfig; - if (sc != null && sc.Section_OriginalSteps == "Y") + foreach (SectionInfo sio in prcitm.Sections) { - return sio.ItemID; + SectionConfig sc = sio.MyConfig as SectionConfig; + if (sc != null && sc.Section_OriginalSteps == "Y") + { + return sio.ItemID; + } + } + // 3) Find if any of the section titles contain 'PROCEDURES STEPS' + foreach (SectionInfo sit in prcitm.Sections) + { + if (sit.DisplayText.ToUpper().Contains("PROCEDURE STEPS")) + return sit.ItemID; } } - - // 3) Find if any of the section titles contain 'PROCEDURES STEPS' - foreach (SectionInfo sit in prcitm.Sections) - { - if (sit.DisplayText.ToUpper().Contains("PROCEDURE STEPS")) - return sit.ItemID; - } - // 4) Display messagebox to tell user to specify which section should be used as the 'default section'. MessageBox.Show("No default step section was found. Set the appropriate Step Section as the default by using the Section Property Page, Format Tab.", "Transition using Default Step Sction in Format", MessageBoxButtons.OK,MessageBoxIcon.Error); return -1; @@ -908,6 +918,7 @@ namespace Volian.Controls.Library if (sectstartid == -1) btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save. IList chldrn = prcitm.GetChildren(); cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid, true); + btnTranSave.Enabled = true; } private void tvTran_AfterSelect(object sender, TreeViewEventArgs e) {