This commit is contained in:
Kathy Ruffing 2011-02-08 11:28:54 +00:00
parent 1c95a81ef8
commit 1e71d60ae2

View File

@ -24,36 +24,34 @@ namespace Volian.Controls.Library
}
private bool _Initalizing = false;
private IList<int> _MyStepTypeInd = null; // use to keep track of step types put in step type menu
private StepRTB _NotVisibleRTB = null;
/// <summary>
/// This stores the last selected StepRTB when the Panel was not visible
/// This stores the last selected EditItem when the Panel was not visible
/// This allows the panel to be filled when the when it is made visible
/// </summary>
public StepRTB NotVisibleRTB
private EditItem _NotVisibleEditItem;
public EditItem NotVisibleEditItem
{
get { return _NotVisibleRTB; }
get { return _NotVisibleEditItem; }
set
{
_NotVisibleRTB = null; // Initialize it to null
if (value != null)
if (value.MyItemInfo != null)
if (value.MyItemInfo.IsStep)
_NotVisibleRTB = value; // Only visible for steps
{
_NotVisibleEditItem = null;
if (value != null && value.MyItemInfo != null && value.MyItemInfo.IsStep)
_NotVisibleEditItem = value; // Only visible for steps
}
}
private StepRTB _MyRTB;
public StepRTB MyRTB
private EditItem _MyEditItem;
public EditItem MyEditItem
{
get { return _MyRTB; }
set
get { return _MyEditItem; }
set
{
if (!Visible)
{
NotVisibleRTB = value; // Remember RTB if the panel becomes visible
CurItemInfo = null; // The Current Item Info should be forgotten
NotVisibleEditItem = value;
CurItemInfo = null;
return;
}
NotVisibleRTB = null; // If Visible, no need to remember the RTB when the panel wasn't visible
NotVisibleEditItem = null;
if (value == null)
{
ClearControls();
@ -65,7 +63,7 @@ namespace Volian.Controls.Library
ClearControls();
return;
}
_MyRTB = value;
_MyEditItem = value;
CurItemInfo = value.MyItemInfo;
// only change all at level if all substeps are of same type
bool allSameType = true;
@ -288,13 +286,13 @@ namespace Volian.Controls.Library
private void listBoxStepTypes_SelectedIndexChanged(object sender, EventArgs e)
{
if (_Initalizing) return;
RTBItem topRTBItem = _MyRTB.MyRTBItem;
EditItem topEditItem = MyEditItem;
FormatData fmtdata = CurItemInfo.ActiveFormat.PlantFormat.FormatData;
string msgBox = null;
if (cbChgAll.Checked)
{
ItemInfo startitm = CurItemInfo.FirstSibling;
topRTBItem = _MyRTB.MyRTBItem.MyStepPanel._LookupRTBItems[startitm.ItemID];
topEditItem = MyEditItem.MyStepPanel._LookupEditItems[startitm.ItemID];
while (startitm != null)
{
using (Content cnt = Content.Get(startitm.MyContent.ContentID))
@ -331,14 +329,15 @@ namespace Volian.Controls.Library
}
msgBox = string.Format("This Step Type was changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]);
}
topRTBItem.SetAllTabs();
topEditItem.SetAllTabs();
MessageBox.Show(msgBox);
}
private void groupPanelCheckoff_VisibleChanged(object sender, EventArgs e)
{
if (Visible==true && NotVisibleRTB != null)
MyRTB = NotVisibleRTB; // If it becomes visible, update the panel
// If it becomes visible, update the panel
if (Visible == true && NotVisibleEditItem != null)
MyEditItem = NotVisibleEditItem;
}
private void rbChgBarOvrRideOn_CheckedChanged(object sender, EventArgs e)
{