This commit is contained in:
@@ -25,16 +25,16 @@ namespace Volian.Controls.Library
|
||||
set
|
||||
{
|
||||
_CurTrans = value;
|
||||
if (_CurTrans == null)
|
||||
if (_CurTrans == null) // Insert a transition
|
||||
{
|
||||
if (MyRTB == null) return;
|
||||
_CurItemFrom = MyRTB.MyItem;
|
||||
_TranFmtIndx = 0;
|
||||
}
|
||||
else
|
||||
else // Modify a transition
|
||||
{
|
||||
_TranFmtIndx = _CurTrans.TranType;
|
||||
_CurItemFrom = ItemInfo.Get(_CurTrans.FromID);
|
||||
_CurItemFrom = MyRTB.MyItem;
|
||||
}
|
||||
_SavCurItemFrom = _CurItemFrom;
|
||||
_SavTranFmtIndx = _TranFmtIndx;
|
||||
@@ -56,13 +56,15 @@ namespace Volian.Controls.Library
|
||||
get { return _RangeColor; }
|
||||
set { _RangeColor = value; }
|
||||
}
|
||||
private DisplayRTB _MyRTB; // Current RichTextBox, i.e. insert transition to it.
|
||||
private DisplayRTB _MyRTB; // Current MyDisplayRTB, i.e. insert transition to it.
|
||||
public DisplayRTB MyRTB
|
||||
{
|
||||
get { return _MyRTB; }
|
||||
set { _MyRTB = value; }
|
||||
}
|
||||
private ItemInfo _CurrentProcedure; // current procedure flags
|
||||
private ItemInfo _CurrentItemProcedure; // the selected item's procedure
|
||||
private ItemInfo _CurrentToProcedure; // the 'to' location's procedure (may be same as _CurrentItemProcedure)
|
||||
private ItemInfo _CurrentProcedure; // current procedure used to set all of the controls (may switch between above two)
|
||||
private int _CurrentProcIndex;
|
||||
private bool _AlwaysDisableSets; // true if there is only 1 item in tree/combo for sets
|
||||
#endregion
|
||||
@@ -101,6 +103,17 @@ namespace Volian.Controls.Library
|
||||
tmpitm = tmpitm.MyParent;
|
||||
}
|
||||
_CurrentProcedure = tmpitm;
|
||||
_CurrentToProcedure = _CurrentProcedure;
|
||||
if (_CurTrans == null)
|
||||
_CurrentItemProcedure = _CurrentProcedure;
|
||||
else
|
||||
{
|
||||
// use the transition from to get the procedure 'from'....
|
||||
ItemInfo curfrom = _CurItemFrom;
|
||||
while (curfrom.MyContent.Type != 0) curfrom = curfrom.MyParent;
|
||||
_CurrentItemProcedure = curfrom;
|
||||
}
|
||||
// set other procedure related private variables.
|
||||
vlnTreeComboSetsFillIn(_CurrentProcedure);
|
||||
cbTranProcsFillIn(_CurrentProcedure);
|
||||
if (_CurrentProcedure.Sections != null)
|
||||
@@ -354,7 +367,7 @@ namespace Volian.Controls.Library
|
||||
lblxTranRangeTip.BackColor = _RangeColor;
|
||||
// if any previous nodes selected for range - clear them here
|
||||
if (!_DoingRange && _RangeNode1 != null) ClearRangeTransition();
|
||||
|
||||
if (_DoingRange && _RangeNode1 == null) InitRangeTransition();
|
||||
// Always allow for step selection if there are items.
|
||||
if (tvTran.Nodes.Count>0)tvTran.Enabled = true;
|
||||
}
|
||||
@@ -473,12 +486,14 @@ namespace Volian.Controls.Library
|
||||
if (listBoxTranFmt.SelectedIndex == _TranFmtIndx) return;
|
||||
|
||||
if (_RangeNode1 != null) ClearRangeTransition();
|
||||
// if this selection needs a step, the section list may need to updated with step only sections,
|
||||
// list the step sections of the current procedure.....
|
||||
// if this selection needs a step, but not a procedure, use the current procedure & the section list may need to updated
|
||||
// with step only section. List the step sections of the current procedure.....
|
||||
E_TransUI etmprev = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI;
|
||||
E_TransUI etmnew = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
|
||||
if (((etmnew & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone) != ((etmprev & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone))
|
||||
if (((etmnew & E_TransUI.ProcCur) == E_TransUI.ProcCur) && ((etmprev & E_TransUI.ProcCur) == E_TransUI.ProcCur) != ((etmnew & E_TransUI.ProcCur) == E_TransUI.ProcCur))
|
||||
{
|
||||
_CurrentProcedure = _CurrentItemProcedure;
|
||||
cbTranProcsFillIn(_CurrentProcedure);
|
||||
int sectstartid = FindSectionStart(_CurrentProcedure);
|
||||
IList chldrn = _CurrentProcedure.GetChildren();
|
||||
if (chldrn != null && chldrn.Count > 0) cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid);
|
||||
@@ -652,6 +667,12 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
#endregion
|
||||
#region VariousSupportMethods
|
||||
private void InitRangeTransition()
|
||||
{
|
||||
if (_InitializingTrans) MessageBox.Show("To do, initialize range node highlighting in tree");
|
||||
// find rnage nodes to be highlighted & send it to tvTranRangeHilites to actually do the highlighting...
|
||||
|
||||
}
|
||||
private void ClearRangeTransition()
|
||||
{
|
||||
if (_RangeNode1 == null && _RangeNode2 == null) return;
|
||||
|
Reference in New Issue
Block a user