From d088933be03ae939dd9e93871c47a54af71f7168 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 4 Dec 2013 12:59:13 +0000 Subject: [PATCH] Farley RNO Column size improvements --- PROMS/Volian.Controls.Library/EditItem.cs | 12 ++++++++++-- PROMS/Volian.Controls.Library/RTBItem.cs | 12 ++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 3ae24ee7..080ec279 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -2087,9 +2087,12 @@ namespace Volian.Controls.Library ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + _MyParentEditItem.ItemWidth, _MyParentEditItem.ItemLocation.Y); + else if (MyItemInfo.MyTab.Offset != 0) + ContentLocation = new Point(_MyParentEditItem.ContentLocation.X+10, _MyParentEditItem.Bottom); + //ItemLocation = new Point(_MyParentEditItem.ItemLocation.X+10, _MyParentEditItem.Bottom); else ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.Bottom); - + if (MyItemInfo.FormatStepData.ReadOnly) { Graphics g = CreateGraphics(); @@ -2103,6 +2106,8 @@ namespace Volian.Controls.Library } else if (MyParentEditItem != null && MyParentEditItem.MyItemInfo.FormatStepData.ReadOnly) ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); + else if (MyItemInfo.MyTab.Offset != 0) + ContentWidth = _MyParentEditItem.ContentWidth; else ItemWidth = _MyParentEditItem.ContentWidth; } @@ -2117,9 +2122,10 @@ namespace Volian.Controls.Library // Use the RNOWidthAlt value if it exists instead of the default RNO width // Note that I needed to add 1 to the ToDisplay() value to be closer to the needed // width for the screen (this does not affect the printout) + // If in single column, don't make this adjustment: string[] splitRNOWidthAlt = MyStepSectionLayoutData.RNOWidthAlt.Split(','); int ovrRNOWidth = (RNOLevel < splitRNOWidthAlt.Length)?MyStepPanel.ToDisplay(float.Parse(splitRNOWidthAlt[RNOLevel])+1) : 0; - if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1) + if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1 && MyItemInfo.ColumnMode != 0) ContentWidth = ovrRNOWidth; else ContentWidth = _MyParentEditItem.ContentWidth; @@ -2224,6 +2230,8 @@ namespace Volian.Controls.Library } else if (MyPreviousEditItem != null && MyPreviousEditItem.MyItemInfo.FormatStepData != null && MyPreviousEditItem.MyItemInfo.FormatStepData.ReadOnly) ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); + else if (MyItemInfo.MyTab.Offset != 0) + ContentWidth = MyPreviousEditItem.ContentWidth+10; else Width = MyPreviousEditItem.Width; diff --git a/PROMS/Volian.Controls.Library/RTBItem.cs b/PROMS/Volian.Controls.Library/RTBItem.cs index c8452997..ce23acf1 100644 --- a/PROMS/Volian.Controls.Library/RTBItem.cs +++ b/PROMS/Volian.Controls.Library/RTBItem.cs @@ -71,8 +71,9 @@ namespace Volian.Controls.Library get { return _MyStepRTB.Width; } set { - //Width = value + lblTab.Left + lblTab.Width; - Width = value + lblTab.Left + lblTab.Width + (this.Right - MyStepRTB.Right); + // This is wrong for single column (KBR) - RHM Debug: + //MyStepRTB.Width = value; + Width = value + lblTab.Left + lblTab.Width + (this.Width - MyStepRTB.Right); } } public override int BorderWidth { get { return (_MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width); } } @@ -164,8 +165,11 @@ namespace Volian.Controls.Library bool lastDigitSingle = Regex.IsMatch(tabString, "^.*[^0-9][0-9] *$"); lblTab.Width = ((lastDigitSingle ? 1 : 0) + tabString.Length) * MyStepPanel.DPI / cpi; Invalidate(); - _MyStepRTB.Left = lblTab.Left + lblTab.Width; - _MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin - CheckOffMargin; + if (MyItemInfo.MyTab.Offset == 0) + { + _MyStepRTB.Left = lblTab.Left + lblTab.Width; + _MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin - CheckOffMargin; + } _TabFormat = value; } }