This commit is contained in:
@@ -40,7 +40,7 @@ namespace VEPROMS
|
||||
Step _LastStep = null;
|
||||
StepInfo _LastStepInfo = null;
|
||||
Color _CommentTitleBckColor;
|
||||
|
||||
DisplayRTB _MyRTB;
|
||||
VETreeNode _PrevBookMark = null;
|
||||
|
||||
public frmVEPROMS()
|
||||
@@ -1174,9 +1174,12 @@ namespace VEPROMS
|
||||
// infotabTransitionFillIn uses other methods to fill in all controls on the
|
||||
// insert/modify transition tab. Note that, for now, curitm just be a 'step'
|
||||
// item (not a section or procedure).
|
||||
private bool _InitializingTrans;
|
||||
private void infotabTransitionFillIn(ItemInfo curitm)
|
||||
{
|
||||
if (curitm.MyContent.Type < 20000) return;
|
||||
btnTranInsert.Text = "Select Transition";
|
||||
_InitializingTrans = true;
|
||||
//if (curitm.MyContent.Type < 20000) return;
|
||||
listBoxTranFmtFillIn(curitm);
|
||||
|
||||
// use curitm to find section level and procedure level.
|
||||
@@ -1186,11 +1189,12 @@ namespace VEPROMS
|
||||
tmpitm = tmpitm.MyParent;
|
||||
}
|
||||
ItemInfo secitm = tmpitm;
|
||||
listBoxTranSectsFillIn(secitm);
|
||||
listBoxTranSectsFillIn(secitm, secitm.ItemID);
|
||||
ItemInfo prcitm = secitm.MyParent;
|
||||
listBoxTranProcsFillIn(prcitm);
|
||||
|
||||
tvTranFillIn(curitm);
|
||||
_InitializingTrans = false;
|
||||
}
|
||||
private void listBoxTranFmtFillIn(ItemInfo curitm)
|
||||
{
|
||||
@@ -1205,24 +1209,36 @@ namespace VEPROMS
|
||||
{
|
||||
tvTran.Nodes.Clear();
|
||||
// For the tree view, use parent, unless already at HLS. If at HLS, use this level.
|
||||
if (!curitm.IsHigh) curitm = curitm.MyParent;
|
||||
ItemInfo selitm = curitm;
|
||||
if (!curitm.IsHigh)
|
||||
{
|
||||
curitm = curitm.MyParent;
|
||||
selitm = curitm;
|
||||
}
|
||||
curitm = curitm.FirstSibling;
|
||||
while (curitm != null)
|
||||
{
|
||||
this.tvTran.Nodes.Add(new VETreeNode(curitm));
|
||||
VETreeNode tvn = new VETreeNode(curitm);
|
||||
tvn.Tag = curitm;
|
||||
int active = this.tvTran.Nodes.Add(tvn); //new VETreeNode(curitm));
|
||||
if (curitm.ItemID == selitm.ItemID) tvTran.SelectedNode = tvTran.Nodes[active];
|
||||
curitm = (curitm.NextItemCount > 0 ? curitm.NextItems[0] : null);
|
||||
}
|
||||
tvTran.BeforeExpand += new TreeViewCancelEventHandler(tvTran_BeforeExpand);
|
||||
}
|
||||
private void listBoxTranSectsFillIn(ItemInfo secitm)
|
||||
private void listBoxTranSectsFillIn(ItemInfo secitm, int sectstart)
|
||||
{
|
||||
listBoxTranSects.Items.Clear();
|
||||
// if sectstart is not -1, then use this as the section to select, otherwise
|
||||
// use the id for the item passed in.
|
||||
int startitm = sectstart;
|
||||
if (sectstart < 0) sectstart = secitm.ItemID;
|
||||
ItemInfo selitm = secitm; // this is the selected 'section'
|
||||
secitm = secitm.FirstSibling;
|
||||
while (secitm != null)
|
||||
{
|
||||
int active = listBoxTranSects.Items.Add(secitm);
|
||||
if (secitm.MyContent.ContentID == selitm.MyContent.ContentID) listBoxTranSects.SelectedIndex = active;
|
||||
if (secitm.ItemID == sectstart) listBoxTranSects.SelectedIndex = active;
|
||||
secitm = (secitm.NextItemCount > 0 ? secitm.NextItems[0] : null);
|
||||
}
|
||||
}
|
||||
@@ -1266,6 +1282,7 @@ namespace VEPROMS
|
||||
}
|
||||
private void listBoxTranFmt_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_InitializingTrans) return;
|
||||
// depending on the selected format's type , display associated list/tree boxes...
|
||||
//
|
||||
// <TransTypes TransType="0" TransFormat="{Proc. Number}, {Proc. Title}, Step {First Step}" />
|
||||
@@ -1280,7 +1297,7 @@ namespace VEPROMS
|
||||
|
||||
DisplayTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel;
|
||||
ItemInfo curitm = dtp.ItemSelected;
|
||||
int selitm = listBoxTranFmt.SelectedIndex;
|
||||
//int selitm = listBoxTranFmt.SelectedIndex;
|
||||
int type = (int)(curitm.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].Type);
|
||||
if (type == 0 || type == 3 || type == 5) // show & allow selections for procedures.
|
||||
listBoxTranProcs.Enabled = true;
|
||||
@@ -1292,7 +1309,7 @@ namespace VEPROMS
|
||||
if (type == 0 || type == 3 || type == 4 || type == 5)
|
||||
{
|
||||
// find default step section and make it the selected item - then disable from further selection.
|
||||
listBoxTranSects.SelectedIndex = 1; // TEMP until default step section found.
|
||||
//listBoxTranSects.SelectedIndex = 1; // TEMP until default step section found.
|
||||
listBoxTranSects.Enabled = true;
|
||||
}
|
||||
else
|
||||
@@ -1302,6 +1319,7 @@ namespace VEPROMS
|
||||
}
|
||||
private void listBoxTranSects_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_InitializingTrans) return;
|
||||
// a different section was selected, if step section, update step list, otherwise, empty
|
||||
// it & disable.
|
||||
ItemInfo secitm = (ItemInfo)listBoxTranSects.SelectedItem;
|
||||
@@ -1316,34 +1334,32 @@ namespace VEPROMS
|
||||
tvTran.Enabled = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void listBoxTranProcs_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_InitializingTrans) return;
|
||||
ItemInfo prcitm = (ItemInfo)listBoxTranProcs.SelectedItem;
|
||||
listBoxTranSectsFillIn(prcitm);
|
||||
|
||||
ProcedureConfig pc = (ProcedureConfig)prcitm.MyConfig;
|
||||
int sectstartid = -1;
|
||||
if (pc != null) sectstartid = System.Convert.ToInt32(pc.SectionStart);
|
||||
// get default step section and fill it in, depending on format type....
|
||||
// kbr - for now, use first
|
||||
listBoxTranSectsFillIn(prcitm.Sections[0]);
|
||||
if (!prcitm.Sections[0].IsStepSection)
|
||||
{
|
||||
tvTran.Nodes.Clear();
|
||||
tvTran.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
tvTranFillIn(prcitm.Sections[0].Steps[0]);
|
||||
tvTran.Enabled = true;
|
||||
}
|
||||
IList chldrn = prcitm.GetChildren();
|
||||
|
||||
listBoxTranSectsFillIn((ItemInfo)chldrn[0], sectstartid);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void tc_ItemSelectedChanged(object sender, DisplayPanelEventArgs args)
|
||||
{
|
||||
if(args == null)
|
||||
if (args == null)
|
||||
itemAnnotationsBindingSource.DataSource = null;
|
||||
else
|
||||
{
|
||||
itemAnnotationsBindingSource.DataSource = args.MyVlnCSLARTB.MyItem.ItemAnnotations;
|
||||
this._MyRTB = args.MyVlnCSLARTB.MyDisplayRTB;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void itemAnnotationsBindingSource_DataSourceChanged(object sender, EventArgs e)
|
||||
@@ -1363,5 +1379,52 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
private ItemInfo _tranitem1;
|
||||
private ItemInfo _tranitem2;
|
||||
|
||||
private void btnTranInsert_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (btnTranInsert.Text == "Select Transition")
|
||||
{
|
||||
_tranitem1 = null;
|
||||
_tranitem1 = (ItemInfo)listBoxTranSects.SelectedItem;
|
||||
if (tvTran.Enabled == false || _tranitem1.IsAccPages)
|
||||
_tranitem1 = (ItemInfo)listBoxTranSects.SelectedItem;
|
||||
else
|
||||
_tranitem1 = (ItemInfo)tvTran.SelectedNode.Tag;
|
||||
|
||||
// if range, set text on button to state to select 2nd trans.
|
||||
DisplayTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel;
|
||||
ItemInfo curitm = dtp.ItemSelected;
|
||||
//int selitm = listBoxTranFmt.SelectedIndex;
|
||||
int type = (int)(curitm.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].Type);
|
||||
if (type == 2 || type == 3)
|
||||
{
|
||||
this.btnTranInsert.Text = "Select 2nd Transition";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
string linktxt = string.Format("#Link:Transition: {0} xx {1}", type, curitm.ItemID);
|
||||
_MyRTB.InsertTran("(Resolved Transition Text)", linktxt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_tranitem2 = null;
|
||||
_tranitem2 = (ItemInfo)listBoxTranSects.SelectedItem;
|
||||
if (tvTran.Enabled == false || _tranitem2.IsAccPages)
|
||||
_tranitem2 = (ItemInfo)listBoxTranSects.SelectedItem;
|
||||
else
|
||||
_tranitem2 = (ItemInfo)tvTran.SelectedNode.Tag;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
_MyRTB.Save();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user