This commit is contained in:
Kathy Ruffing 2009-09-01 14:33:11 +00:00
parent c302540801
commit f3bb9786f0
3 changed files with 7 additions and 45 deletions

View File

@ -126,9 +126,8 @@ namespace Volian.Controls.Library
Circle = true;
if (_TabFormat == "o ")
CheckOff = true;
if ((value.ItemID % 25) == 0)
ChangeBar = true;
#endif
ChangeBar = _MyItemInfo.HasChangeBar();
value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed);
}
}
@ -784,7 +783,7 @@ namespace Volian.Controls.Library
_MyStepSectionLayoutData = itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData;
//// TIMING: DisplayItem.TimeIt("CSLARTB _Layout");
if (myParentStepItem != null)
SeqLevel = myParentStepItem.SeqLevel + ((myChildRelation == ChildRelation.After || myChildRelation == ChildRelation.Before) && TemporaryFormat.IsSequential(itemInfo) ? 1 : 0);
SeqLevel = myParentStepItem.SeqLevel + ((myChildRelation == ChildRelation.After || myChildRelation == ChildRelation.Before) && itemInfo.IsSequential ? 1 : 0);
//// TIMING: DisplayItem.TimeIt("CSLARTB seqLevel");
MyItemInfo = itemInfo;
}

View File

@ -77,7 +77,7 @@ namespace Volian.Controls.Library
BuildSymbolGallery(sl, galleryContainerSymbolsCM3);
}
SetButtonAndMenuEnabling();
SetStepButtonAndMenuEnabling();
_MyLastFormatID = MyItemInfo.ActiveFormat.FormatID;
}
}
@ -287,9 +287,11 @@ namespace Volian.Controls.Library
btnCMEditTran.Enabled = false;
btnCMEditRO.Enabled = false;
}
SetStepButtonAndMenuEnabling();
}
private void SetStepButtonAndMenuEnabling()
{
btnInsPgBrk.Checked = false;
// see if manual page break - only available on HLS
if (MyItemInfo.IsHigh)
{
@ -307,6 +309,7 @@ namespace Volian.Controls.Library
// if on a procedure or section title, don't allow for insert of ROs or Transitions:
// disable buttons. Info panels for ROs and Transitions are made invisible in frmVEPROMS.cs
btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = false;
this.Refresh();
return;
}

View File

@ -71,7 +71,7 @@ namespace Volian.Controls.Library
int typ = (int)myDisplayItem.MyItemInfo.MyContent.Type;
if (typ >= 20000)
{
if (myDisplayItem.RNOLevel > 0 && IsRNO(myDisplayItem.MyItemInfo)) return "";
if (myDisplayItem.RNOLevel > 0 && myDisplayItem.MyItemInfo.IsRNO) return "";
// Step 1: Get TabFormat from Format
format = _TabFormats[typ % 10000];
if (format == "<seq>")
@ -82,45 +82,5 @@ namespace Volian.Controls.Library
}
return format;
}
public static string TabFormat(ItemInfo item, int seqLevel)
{
string format = string.Empty;
if (item != null)
{
if (IsRNO(item)) return "";
if ((item.MyContent.Type / 10000) == 2)
{
// Step 1: Get TabFormat from Format
format = _TabFormats[((int)item.MyContent.Type) % 10000];
if (format == "<seq>")
{
format = SeqTabFormat[seqLevel];
}
}
}
return format;
}
// TODO: Move these to ItemExt.cs as properties
public static bool IsHigh(ItemInfo item)
{
// check to see if ActiveParent is a section
if(item.MyContent.Type / 10000 != 2)return false;
ItemInfo parent = (ItemInfo)item.ActiveParent;
if ((parent.MyContent.Type / 10000) == 1)
return true;
return false;
}
public static bool IsSequential(ItemInfo item)
{
//if (IsHigh(item)) return true;
if (((item.MyContent.Type / 10000) == 2) && ((((int)item.MyContent.Type) % 10000) == 0)) return true;
return false;
}
public static bool IsRNO(ItemInfo item)
{
if(item != null)
return ((item.ItemPartCount > 0) && (item.ItemParts[0].PartType == E_FromType.RNO));
return false;
}
}
}