From f48c8fd7e0970f5b08957767cdf24e43a1f57b6e Mon Sep 17 00:00:00 2001 From: Kathy Date: Mon, 21 Nov 2011 16:48:20 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/EditItem.cs | 73 +++++++++++++++++++++-- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 76632ecf..f86e364c 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -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 /// /// 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; /// /// 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); } } }