This commit is contained in:
Kathy Ruffing 2011-11-21 16:48:20 +00:00
parent 1ef722b9d4
commit f48c8fd7e0

View File

@ -144,6 +144,7 @@ namespace Volian.Controls.Library
}
private bool _Circle = false;
private bool _CheckOff = false;
private bool _UserCheckOff = false;
private bool _ChangeBar = false;
private StepPanel _MyStepPanel;
public StepPanel MyStepPanel
@ -180,6 +181,12 @@ namespace Volian.Controls.Library
_MyItemInfo = value;
if (VlnSettings.StepTypeToolType) SetToolTip(_MyItemInfo.ToolTip);
ChangeBar = _MyItemInfo.HasChangeBar;
CheckOff co = _MyItemInfo.GetCheckOffStep();
if (co != null)
{
UserCheckOff = true;
UserCheckOffChar = (char)co.UIMark;
}
// Deal with changes in content data
value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed);
// Deal with change in item data
@ -196,6 +203,14 @@ namespace Volian.Controls.Library
// Update the text to reflect the content change
MyItemInfo.RefreshItemAnnotations();
ChangeBar = MyItemInfo.HasChangeBar;
CheckOff co = _MyItemInfo.GetCheckOffStep();
if (co != null)
{
UserCheckOff = true;
UserCheckOffChar = (char)co.UIMark;
}
else
UserCheckOff = false;
RefreshContent();
}
void value_OrdinalChanged(object sender)
@ -445,6 +460,17 @@ namespace Volian.Controls.Library
get { return _CheckOff; }
set { _CheckOff = value; }
}
public bool UserCheckOff
{
get { return _UserCheckOff; }
set { _UserCheckOff = value; }
}
private char _UserCheckOffChar;
public char UserCheckOffChar
{
get { return _UserCheckOffChar; }
set { _UserCheckOffChar = value; }
}
// TODO: This should be changed to get the ChangeBar status from the data
/// <summary>
/// Has a changebar or not
@ -1549,13 +1575,18 @@ namespace Volian.Controls.Library
AddChildBefore(MyItemInfo.Cautions, expand);
AddChildBefore(MyItemInfo.Notes, expand);
AddChildAfter(MyItemInfo.Procedures, expand);
AddChildAfter(MyItemInfo.Sections, expand);
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode)
AddChildRNO(MyItemInfo.RNOs, expand);
AddChildAfter(MyItemInfo.Tables, expand);
AddChildAfter(MyItemInfo.Steps, expand);
// get the config item for the steps section. there is an 'editable'
// flag used in metasections to define whether the steps should print.
// this flag can be toggle on the section's properties dialog.
bool EditSteps = !(MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "N");
if (EditSteps) AddChildAfter(MyItemInfo.Steps, expand);
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)
AddChildRNO(MyItemInfo.RNOs, expand);
AddChildAfter(MyItemInfo.Sections, expand);
MatchExpanded();
}
MyExpandingStatus = ExpandingStatus.Done;
@ -1785,7 +1816,7 @@ namespace Volian.Controls.Library
public abstract void SaveCurrentAndContents();
#endregion
protected string _TabFormat;
private static int _WidthAdjust = 3;
private static int _WidthAdjust = 5;
protected bool _IgnoreResize = false;
/// <summary>
/// Sets the parent and postions the item with respect to the parent
@ -2133,7 +2164,41 @@ namespace Volian.Controls.Library
g.DrawLine(penCB, 0, ContentTop, 0, Height); // left, top, right, bottom.
else
{
g.DrawLine(penCB, Width - 2, ContentTop, Width - 2, Height);
float X;
float H;
if (this is GridItem)
{
GridItem gi = this as GridItem;
X = gi.MyFlexGrid.Right+2;
H = gi.MyFlexGrid.Height;
}
else
{
RTBItem ri = this as RTBItem;
X = ri.MyStepRTB.Right+2;
H = ri.MyStepRTB.Height;
}
g.DrawLine(penCB, X, ContentTop, X, ContentTop+H); //Height);
}
}
if (UserCheckOff)
{
PointF location;
if (this is GridItem)
{
GridItem gi = this as GridItem;
location = new PointF(gi.MyFlexGrid.Left + gi.MyFlexGrid.Width + 2, gi.MyFlexGrid.Top);
}
else
{
RTBItem ri = this as RTBItem;
location = new PointF(ri.MyStepRTB.Left + ri.MyStepRTB.Width + 2, ri.MyStepRTB.Top);
}
CheckOff co = MyItemInfo.GetCheckOffStep();
if (co != null)
{
Font myFont = new Font("VolianDraw", MyItemInfo.MyTab.MyFont.WindowsFont.Size);
g.DrawString(UserCheckOffChar.ToString(), myFont, Brushes.DarkGreen, new RectangleF(location, MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault);
}
}
}