This commit is contained in:
Kathy Ruffing 2007-12-14 14:56:16 +00:00
parent cc1b4759af
commit 3c7913a092
4 changed files with 2181 additions and 1893 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

File diff suppressed because it is too large Load Diff

View File

@ -1100,10 +1100,196 @@ namespace VEPROMS
#endregion
#region TransitionTab
private int TranFmtIndx = -1;
private void infotabTransition_Click(object sender, EventArgs e)
{
// fill in combo box.
TranFmtIndx = -1;
if (tc == null || tc.SelectedTab == null) return;
DisplayTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel;
if (dtp == null) return;
btnInsTrans_Click(sender, e);
}
// 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 void infotabTransitionFillIn(ItemInfo curitm)
{
if (curitm.MyContent.Type < 20000) return;
listBoxTranFmtFillIn(curitm);
// use curitm to find section level and procedure level.
ItemInfo tmpitm = curitm;
while (tmpitm.MyContent.Type >= 20000)
{
tmpitm = tmpitm.MyParent;
}
ItemInfo secitm = tmpitm;
listBoxTranSectsFillIn(secitm);
ItemInfo prcitm = secitm.MyParent;
listBoxTranProcsFillIn(prcitm);
tvTranFillIn(curitm);
}
private void listBoxTranFmtFillIn(ItemInfo curitm)
{
TransTypeList ttl = curitm.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList;
listBoxTranFmt.Items.Clear();
for (int i = 0; i < ttl.Count; i++)
listBoxTranFmt.Items.Add(ttl[i].TransMenu);
bool modify = false; // this flags modify vs new - where can I get this?
if (!modify) listBoxTranFmt.SelectedIndex = 0;
}
private void tvTranFillIn(ItemInfo curitm)
{
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;
curitm = curitm.FirstSibling;
while (curitm != null)
{
this.tvTran.Nodes.Add(new VETreeNode(curitm));
curitm = (curitm.NextItemCount > 0 ? curitm.NextItems[0] : null);
}
tvTran.BeforeExpand += new TreeViewCancelEventHandler(tvTran_BeforeExpand);
}
private void listBoxTranSectsFillIn(ItemInfo secitm)
{
listBoxTranSects.Items.Clear();
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;
secitm = (secitm.NextItemCount > 0 ? secitm.NextItems[0] : null);
}
}
private void listBoxTranProcsFillIn(ItemInfo prcitm)
{
listBoxTranProcs.Items.Clear();
ItemInfo selitm = prcitm; // this is the selected 'section'
prcitm = prcitm.FirstSibling;
while (prcitm != null)
{
int active = listBoxTranProcs.Items.Add(prcitm);
if (prcitm.MyContent.ContentID == selitm.MyContent.ContentID) listBoxTranProcs.SelectedIndex = active;
prcitm = (prcitm.NextItemCount > 0 ? prcitm.NextItems[0] : null);
}
}
#region TransitionTabEvents
private void btnInsTrans_Click(object sender, EventArgs e)
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabTransition;
DisplayTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel;
// if dtp == null, disable the ro & tran info tabs.
if (dtp == null) return;
ItemInfo curitm = dtp.ItemSelected;
// - kbr - do I need this? curitm = curitm.FirstSibling;
infotabTransitionFillIn(curitm);
}
private void btnUp1_Click(object sender, EventArgs e)
{
// if at HLS, don't do anything.
ItemInfo curitm = (ItemInfo)((VETreeNode)tvTran.Nodes[0]).VEObject;
if (curitm.IsHigh) return;
tvTranFillIn(curitm);
}
private void tvTran_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
VETreeNode tn = ((VETreeNode)e.Node);
tn.LoadChildren();
}
private void listBoxTranFmt_Click(object sender, EventArgs e)
{
// depending on the selected format's type , display associated list/tree boxes...
//
// <TransTypes TransType="0" TransFormat="{Proc. Number}, {Proc. Title}, Step {First Step}" />
// <TransTypes TransType="1" TransFormat="{First Step}" />
// <TransTypes TransType="2" TransFormat="{First Step}, {.}, {.}, {.} and {LastStep}" />
// <TransTypes TransType="3" TransFormat="{First Step} thru {LastStep} of {Proc. Number}, {Proc. Title}, {Section Header}" />
// <TransTypes TransType="4" TransFormat="{Section Title}, Step {First Step}" />
// <TransTypes TransType="5" TransFormat="{Proc. Number}, {Proc. Title}, {Section Header}, Step {First Step}" />
//
if (listBoxTranFmt.SelectedIndex == TranFmtIndx) return;
TranFmtIndx = listBoxTranFmt.SelectedIndex;
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 == 0 || type == 3 || type == 5) // show & allow selections for procedures.
listBoxTranProcs.Enabled = true;
else
listBoxTranProcs.Enabled = false;
bool stpsct = true;
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.Enabled = true;
}
else
listBoxTranSects.Enabled = false;
tvTran.Enabled = true;
}
private void listBoxTranSects_SelectedIndexChanged(object sender, EventArgs e)
{
// a different section was selected, if step section, update step list, otherwise, empty
// it & disable.
ItemInfo secitm = (ItemInfo)listBoxTranSects.SelectedItem;
if (!secitm.IsStepSection)
{
tvTran.Nodes.Clear();
tvTran.Enabled = false;
}
else
{
tvTranFillIn(secitm.Steps[0]);
tvTran.Enabled = true;
}
}
#endregion
private void listBoxTranProcs_SelectedIndexChanged(object sender, EventArgs e)
{
ItemInfo prcitm = (ItemInfo)listBoxTranProcs.SelectedItem;
listBoxTranSectsFillIn(prcitm);
// 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;
}
}
#endregion
private void tc_ItemSelectedChanged(object sender, DisplayPanelEventArgs args)
{
if (args.MyVlnCSLARTB.MyItem.ItemAnnotationCount > 0)
{
if (!cbCmntDontPopup.Checked)
epComments.Expanded = true;
rtxbComment.Text = args.MyVlnCSLARTB.MyItem.ItemAnnotations[0].SearchText;
}
else
{
if (!cbCmntDontPopup.Checked)
epComments.Expanded = false;
rtxbComment.Text = null;
}
}
}
}

File diff suppressed because it is too large Load Diff