From 35eb05432bd4f1c5471b2d4cb3e566b169bc1356 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 29 Jan 2026 19:38:04 -0500 Subject: [PATCH] C2022-003-Change-Textboxes-to-RTF-3 --- .../Exe/RefObj/ROEditor/FieldCombFrm.cs | 19 +-------- .../Exe/RefObj/ROEditor/FieldTextFrm.cs | 21 +++------- .../Exe/RefObj/ROEditor/FieldTypeDefFrm.cs | 21 +++------- .../Exe/RefObj/ROEditor/GroupNewFrm.cs | 24 ++++------- .../Exe/RefObj/ROEditor/RODefFrm.cs | 21 +++------- .../LibSource/ctlXMLEditLib/ctlXMLEdit.cs | 31 +------------- .../LibSource/ctlXMLEditLib/roRichTextBox.cs | 42 ++++--------------- .../Volian.Controls.Library/StepTabRibbon.cs | 1 - 8 files changed, 36 insertions(+), 144 deletions(-) diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs index 77e7c913..2566281d 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldCombFrm.cs @@ -77,6 +77,7 @@ using System.Xml.Schema; using System.Text; using ROFields; using RODBInterface; +using System.Linq; namespace ROEditor { @@ -594,31 +595,15 @@ namespace ROEditor } private void txtBox_KeyDown(object sender, KeyEventArgs e) { - bool symFlg = false; if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { string clpBrd = Clipboard.GetText(); - char[] chrAry = clpBrd.ToCharArray(); - foreach (int chr in chrAry) - { - if (chr > 166) - { - symFlg = true; - break; - } - else - { - symFlg = false; - } - } - if (symFlg == true) + if (clpBrd.Any(c => c > 166)) { MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); Clipboard.Clear(); } } } - - } } diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs index 076b7e03..ab9ecb3b 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTextFrm.cs @@ -77,6 +77,7 @@ using System.Xml.Schema; using System.Text; using ROFields; using RODBInterface; +using System.Linq; namespace ROEditor { @@ -321,24 +322,14 @@ namespace ROEditor bool symFlg = false; if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - string clpBrd = Clipboard.GetText(); - char[] chrAry = clpBrd.ToCharArray(); - foreach (int chr in chrAry) + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - if (chr > 166) + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) { - symFlg = true; - break; + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); } - else - { - symFlg = false; - } - } - if (symFlg == true) - { - MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); - Clipboard.Clear(); } } } diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs index 70c66d7a..3cacb29d 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs @@ -72,6 +72,7 @@ using System.Xml; using System.Text; using RODBInterface; using ROFields; +using System.Linq; namespace ROEditor { @@ -282,24 +283,14 @@ namespace ROEditor bool symFlg = false; if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - string clpBrd = Clipboard.GetText(); - char[] chrAry = clpBrd.ToCharArray(); - foreach (int chr in chrAry) + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - if (chr > 166) + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) { - symFlg = true; - break; + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); } - else - { - symFlg = false; - } - } - if (symFlg == true) - { - MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); - Clipboard.Clear(); } } } diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs index b276d356..d71ad8c9 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/GroupNewFrm.cs @@ -52,6 +52,7 @@ using System.Xml; using System.Text; using ROFields; using RODBInterface; +using System.Linq; namespace ROEditor { @@ -423,28 +424,17 @@ namespace ROEditor grdef.ShowDialog(); } private void txtBox_KeyDown(object sender, KeyEventArgs e) - { - bool symFlg = false; + { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - string clpBrd = Clipboard.GetText(); - char[] chrAry = clpBrd.ToCharArray(); - foreach (int chr in chrAry) + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - if (chr > 166) + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) { - symFlg = true; - break; + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); } - else - { - symFlg = false; - } - } - if (symFlg == true) - { - MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); - Clipboard.Clear(); } } } diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs index dfeceee9..ccda5ecb 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/RODefFrm.cs @@ -106,6 +106,7 @@ using ROFields; using RODBInterface; using VlnStatus; using System.Collections.Generic; +using System.Linq; namespace ROEditor @@ -1316,24 +1317,14 @@ namespace ROEditor bool symFlg = false; if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - string clpBrd = Clipboard.GetText(); - char[] chrAry = clpBrd.ToCharArray(); - foreach (int chr in chrAry) + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - if (chr > 166) + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) { - symFlg = true; - break; + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); } - else - { - symFlg = false; - } - } - if (symFlg == true) - { - MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); - Clipboard.Clear(); } } } diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs index ddd368d3..08d0c45e 100644 --- a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/ctlXMLEdit.cs @@ -2016,36 +2016,7 @@ namespace ctlXMLEditLib return curTZ.GetDaylightChanges(year); } } - //private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed) - //{ - // StringBuilder sbbeg = new StringBuilder(); - // StringBuilder sbend = new StringBuilder(); - // if (myFont.Bold) - // { - // sbbeg.Append(@"\b"); - // sbend.Append(@"\b0"); - // } - // if (myFont.Underline) - // { - // sbbeg.Append(@"\ul"); - // sbend.Insert(0, @"\ulnone"); - // } - // if (myFont.Italic) - // { - // sbbeg.Append(@"\i"); - // sbend.Insert(0, @"\i0"); - // } - // selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}"; - // if (!isFixed) - // selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace Words - // else - // selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - // selectedRtfSB.Append("\r\n"); - // // use styles to construct rtf commands to insert into next line (where \b, etc is) - // // B2015-134 Hanging Indent with Hard Returns was not being saved- removed \sl-240\slmult0 - // selectedRtfSB.Append(@"\viewkind4\uc1\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}"; - // //selectedRtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}"; - //} + public class ctlXMLEditEventArgs : EventArgs // RO Editor add symbols C2022 - 003 for turning off symbols btn for RO ID. { public ctlXMLEditEventArgs() {; } diff --git a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs index 0904997f..ba73bc30 100644 --- a/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs +++ b/PROMS/ReferencedObjects/LibSource/ctlXMLEditLib/roRichTextBox.cs @@ -46,25 +46,12 @@ namespace ctlXMLEditLib { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { - string clpBrd = Clipboard.GetText(); - char[] chrAry = clpBrd.ToCharArray(); - foreach (int chr in chrAry) - { - if (chr > 166) - { - symFlg = true; - break; - } - else - { - symFlg = false; - } - } - if (symFlg == true) - { - MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); - Clipboard.Clear(); - } + string clpBrd = Clipboard.GetText(); + if (clpBrd.Any(c => c > 166)) + { + MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'"); + Clipboard.Clear(); + } } } } @@ -87,14 +74,10 @@ namespace ctlXMLEditLib sbbeg.Append(@"\i"); sbend.Insert(0, @"\i0"); } + // RO Editor add symbols C2022-003 selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); - if (!isFixed) - selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace Words - else - selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing + selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // FreeMono is now used for symbols display. selectedRtfSB.Append("\r\n"); - // use styles to construct rtf commands to insert into next line (where \b, etc is) - // B2015-134 Hanging Indent with Hard Returns was not being saved- removed \sl-240\slmult0 selectedRtfSB.Append(@"\viewkind4\uc1\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); } private Font _FormatFont; @@ -108,15 +91,6 @@ namespace ctlXMLEditLib formatFont = Font; _FormatFont = formatFont; } - - // We found that the characters in the Letter Gothic font do not all use the same spacing. - // Also, the character spacing is even more different between screen resolutions. - // But the Letter Gothic font will print just fine. - // We also found that the Letter Gothic Tall font works just fine on the screen, the only difference - // is that the characters are a little bit taller. - // So we decided to use the Letter Gothic Tall font for the screen display any time that Letter Gothic is used. - if (_FormatFont.Name.ToUpper().Equals("LETTER GOTHIC")) - _FormatFont = new Font("Letter Gothic Tall", _FormatFont.Size, _FormatFont.Style); return _FormatFont; } set { _FormatFont = value; } diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index dd6354e1..87ce1980 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -723,7 +723,6 @@ namespace Volian.Controls.Library } } } - private void SetBtnInsSupInfoVisible() { if (MyItemInfo == null) return;