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 _Circle = false;
private bool _CheckOff = false; private bool _CheckOff = false;
private bool _UserCheckOff = false;
private bool _ChangeBar = false; private bool _ChangeBar = false;
private StepPanel _MyStepPanel; private StepPanel _MyStepPanel;
public StepPanel MyStepPanel public StepPanel MyStepPanel
@ -180,6 +181,12 @@ namespace Volian.Controls.Library
_MyItemInfo = value; _MyItemInfo = value;
if (VlnSettings.StepTypeToolType) SetToolTip(_MyItemInfo.ToolTip); if (VlnSettings.StepTypeToolType) SetToolTip(_MyItemInfo.ToolTip);
ChangeBar = _MyItemInfo.HasChangeBar; ChangeBar = _MyItemInfo.HasChangeBar;
CheckOff co = _MyItemInfo.GetCheckOffStep();
if (co != null)
{
UserCheckOff = true;
UserCheckOffChar = (char)co.UIMark;
}
// Deal with changes in content data // Deal with changes in content data
value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed);
// Deal with change in item data // Deal with change in item data
@ -196,6 +203,14 @@ namespace Volian.Controls.Library
// Update the text to reflect the content change // Update the text to reflect the content change
MyItemInfo.RefreshItemAnnotations(); MyItemInfo.RefreshItemAnnotations();
ChangeBar = MyItemInfo.HasChangeBar; ChangeBar = MyItemInfo.HasChangeBar;
CheckOff co = _MyItemInfo.GetCheckOffStep();
if (co != null)
{
UserCheckOff = true;
UserCheckOffChar = (char)co.UIMark;
}
else
UserCheckOff = false;
RefreshContent(); RefreshContent();
} }
void value_OrdinalChanged(object sender) void value_OrdinalChanged(object sender)
@ -445,6 +460,17 @@ namespace Volian.Controls.Library
get { return _CheckOff; } get { return _CheckOff; }
set { _CheckOff = value; } 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 // TODO: This should be changed to get the ChangeBar status from the data
/// <summary> /// <summary>
/// Has a changebar or not /// Has a changebar or not
@ -1549,13 +1575,18 @@ namespace Volian.Controls.Library
AddChildBefore(MyItemInfo.Cautions, expand); AddChildBefore(MyItemInfo.Cautions, expand);
AddChildBefore(MyItemInfo.Notes, expand); AddChildBefore(MyItemInfo.Notes, expand);
AddChildAfter(MyItemInfo.Procedures, expand); AddChildAfter(MyItemInfo.Procedures, expand);
AddChildAfter(MyItemInfo.Sections, expand);
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode) if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode)
AddChildRNO(MyItemInfo.RNOs, expand); AddChildRNO(MyItemInfo.RNOs, expand);
AddChildAfter(MyItemInfo.Tables, 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) if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)
AddChildRNO(MyItemInfo.RNOs, expand); AddChildRNO(MyItemInfo.RNOs, expand);
AddChildAfter(MyItemInfo.Sections, expand);
MatchExpanded(); MatchExpanded();
} }
MyExpandingStatus = ExpandingStatus.Done; MyExpandingStatus = ExpandingStatus.Done;
@ -1785,7 +1816,7 @@ namespace Volian.Controls.Library
public abstract void SaveCurrentAndContents(); public abstract void SaveCurrentAndContents();
#endregion #endregion
protected string _TabFormat; protected string _TabFormat;
private static int _WidthAdjust = 3; private static int _WidthAdjust = 5;
protected bool _IgnoreResize = false; protected bool _IgnoreResize = false;
/// <summary> /// <summary>
/// Sets the parent and postions the item with respect to the parent /// 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. g.DrawLine(penCB, 0, ContentTop, 0, Height); // left, top, right, bottom.
else 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);
} }
} }
} }