From ce3b1b4be9e75ef5cc9f734c03efcf4ba4fd9e19 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 23 Jun 2010 18:18:09 +0000 Subject: [PATCH] --- .../OutlineRTFTable.cs | 9 ++++++--- PROMS/Volian.Controls.Library/StepRTB.cs | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/PROMS/Volian.Controls.Library/OutlineRTFTable.cs b/PROMS/Volian.Controls.Library/OutlineRTFTable.cs index d89ca607..d533dbc6 100644 --- a/PROMS/Volian.Controls.Library/OutlineRTFTable.cs +++ b/PROMS/Volian.Controls.Library/OutlineRTFTable.cs @@ -176,7 +176,7 @@ namespace Volian.Controls.Library } public class RtfLine : List { - private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*)+( |$))?(|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)"); + private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*|\\up[0-9]|\\ul0?)+( |$))?(|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)"); public RtfLine(string text) { MatchCollection matches = _RegRtfText.Matches(text); @@ -190,8 +190,11 @@ namespace Volian.Controls.Library //Console.WriteLine(text.Substring(nextIndex)); } nextIndex = match.Index + match.Length; - if (match.Groups[2].ToString().Length + match.Groups[4].ToString().Length > 0) - this.Add(new RtfPiece(match.Groups[2].ToString(), match.Groups[4].ToString())); + string rtfPart = match.Groups[1].ToString(); + if (match.Groups[1].ToString().TrimEnd(" ".ToCharArray()).Length + match.Groups[4].ToString().Length > 0) + this.Add(new RtfPiece(match.Groups[1].ToString().TrimEnd(" ".ToCharArray()), match.Groups[4].ToString())); + //if (match.Groups[1].ToString().Length + match.Groups[4].ToString().Length > 0) + // this.Add(new RtfPiece(match.Groups[1].ToString(), match.Groups[4].ToString())); } } public RtfLine(int width, string left, string fill, string right) diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 0bb4b9fc..c876d668 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -212,6 +212,7 @@ namespace Volian.Controls.Library Font = formatFont; else Font = new Font(_MyFontFamily == null ? formatFont.FontFamily : _MyFontFamily, formatFont.Size, formatFont.Style); + //Font = new Font("Bookman Old Style", formatFont.Size, formatFont.Style); #elif(RELEASE) Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format #else //DEMO @@ -273,6 +274,8 @@ namespace Volian.Controls.Library // } //} _origRTF = Rtf; + if (_MyItemInfo.ItemID == 74) + Console.WriteLine("'{0}'", Rtf); _InitializingRTB = false; _MyItemInfo.MyConfig.PropertyChanged += new PropertyChangedEventHandler(MyConfig_PropertyChanged); AdjustSizeForContents(!edit); // TODO: this is not quite right yet. @@ -416,17 +419,22 @@ namespace Volian.Controls.Library void StepRTB_ContextMenuStripChanged(object sender, EventArgs e) { //Console.WriteLine("********** StepRTB_ContextMenuStripChanged"); + int sublocation = 0; try { - Console.WriteLine("{0}", ContextMenuStrip.GetType().FullName); + //Console.WriteLine("{0}", ContextMenuStrip.GetType().FullName); this.MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu(); + sublocation = 1; _ContextMenuStripChanged = true; + sublocation = 2; _ContextMenuStepRTB = this; + sublocation = 3; _ContextMenuStrip = ContextMenuStrip; + sublocation = 4; } catch(Exception ex) { - Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); + Console.WriteLine("StepRTB_ContextMenuStripChanged {0} - {1} [{2}]", ex.GetType().Name, ex.Message, sublocation); } } private void SetUpStepRTB() @@ -1682,8 +1690,11 @@ namespace Volian.Controls.Library case Keys.Enter: if (!e.Control && !e.Shift && !e.Alt) { - e.Handled = true; - MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); + if (!MyStepItem.MyItemInfo.IsTablePart) + { + e.Handled = true; + MyStepItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); + } } break; }