Fixed logic to setup the transition panel
Fixed the code to open enhanced document windows so that they are not always on top. If a transition to a procedure is created, or exists, it cannot be edited. John Zimmerman of Ginna reported this. The transition can be selected and deleted if the transition panel has not been opened. If the transition panel has been opened, then the code will crash as soon as the transition is selected. Thhis change fixes the code so that it will not crash.
This commit is contained in:
parent
e7b0d79c25
commit
3519bec6aa
@ -1247,7 +1247,8 @@ namespace VEPROMS
|
|||||||
frm.MySessionInfo = MySessionInfo;
|
frm.MySessionInfo = MySessionInfo;
|
||||||
tc.dicEnhancedDocuments.Add(args.MyItemInfo.MyProcedure.MyDocVersion, frm);
|
tc.dicEnhancedDocuments.Add(args.MyItemInfo.MyProcedure.MyDocVersion, frm);
|
||||||
frm.FormClosed += frm_FormClosed;
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -2454,7 +2455,8 @@ namespace VEPROMS
|
|||||||
if (SelectedStepTabPanel == null) return;
|
if (SelectedStepTabPanel == null) return;
|
||||||
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
|
displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
|
||||||
//displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor;
|
//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
|
#endregion
|
||||||
#region InfoTabLibDocs
|
#region InfoTabLibDocs
|
||||||
|
@ -141,10 +141,19 @@ namespace Volian.Controls.Library
|
|||||||
ItemInfo secitm = null;
|
ItemInfo secitm = null;
|
||||||
|
|
||||||
// Find the procedure level first.
|
// 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;
|
int scid = FindSectionStart(tmpitm);
|
||||||
tmpitm = tmpitm.MyParent;
|
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;
|
_CurrentProcedure = tmpitm;
|
||||||
_CurrentToProcedure = _CurrentProcedure;
|
_CurrentToProcedure = _CurrentProcedure;
|
||||||
@ -874,22 +883,23 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2) Look in SectionConfig/OriginalSteps = 'Y'
|
// 2) Look in SectionConfig/OriginalSteps = 'Y'
|
||||||
foreach (SectionInfo sio in prcitm.Sections)
|
if (prcitm.Sections != null)
|
||||||
{
|
{
|
||||||
SectionConfig sc = sio.MyConfig as SectionConfig;
|
foreach (SectionInfo sio in prcitm.Sections)
|
||||||
if (sc != null && sc.Section_OriginalSteps == "Y")
|
|
||||||
{
|
{
|
||||||
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'.
|
// 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);
|
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;
|
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.
|
if (sectstartid == -1) btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save.
|
||||||
IList chldrn = prcitm.GetChildren();
|
IList chldrn = prcitm.GetChildren();
|
||||||
cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid, true);
|
cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid, true);
|
||||||
|
btnTranSave.Enabled = true;
|
||||||
}
|
}
|
||||||
private void tvTran_AfterSelect(object sender, TreeViewEventArgs e)
|
private void tvTran_AfterSelect(object sender, TreeViewEventArgs e)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user