C2022-003-Change-Textboxes-to-RTF-3 #676

Open
plarsen wants to merge 8 commits from C2022-003-Change-Textboxes-to-RTF-3 into Development
Owner

C2022-003 The symbols that can be entered into the PROMS editor should be added to the RO editor.

C2022-003 The symbols that can be entered into the PROMS editor should be added to the RO editor.
plarsen self-assigned this 2025-12-22 19:05:50 -05:00
djankowski was assigned by plarsen 2025-12-22 19:05:50 -05:00
jjenko was assigned by plarsen 2025-12-22 19:05:50 -05:00
mschill was assigned by plarsen 2025-12-22 19:05:50 -05:00
mvickers was assigned by plarsen 2025-12-22 19:05:50 -05:00
plarsen added 8 commits 2025-12-22 19:05:51 -05:00
plarsen requested review from jjenko 2025-12-22 19:06:15 -05:00
plarsen requested review from mschill 2025-12-22 19:06:16 -05:00
mschill requested changes 2025-12-23 08:56:51 -05:00
mschill left a comment
Owner

see notes. Let me know if you have any questions.

see notes. Let me know if you have any questions.
@@ -302,13 +302,18 @@ using Org.Mentalis.Files;
using System.Runtime.InteropServices;
using System.Linq;
using System.Collections.Generic;
//using Volian.Controls.Library;
Owner

remove commented out code

remove commented out code
@@ -304,1 +304,4 @@
using System.Collections.Generic;
//using Volian.Controls.Library;
using Volian.Base.Library;
using VEPROMS.CSLA.Library;
Owner

Not seeing where this is needed - should this be here?

can't see needing CSLA as a dependency.

Not seeing where this is needed - should this be here? can't see needing CSLA as a dependency.
@@ -309,3 +314,3 @@
namespace ROEditor
{
/// <summary>
/// <summary>
Owner

Not critical -- but just a side suggestion to make things easier for future possible changes ---- I would suggest reviewing this file and try to fix some of the spacing issues --- there are a lot of items showing as changes that are not actual changes (i.e. removed blank lines or added / removed spaces) -- this makes it difficult to tell what was / wasn't changed and more likely to miss something / make a mistake. It also means that all these items will show up in history as being changed by this project. This could make diagnosing future issues more difficult (i.e. something that may have always been a certain way may appear it was changed with this project.)

Not critical -- but just a side suggestion to make things easier for future possible changes ---- I would suggest reviewing this file and try to fix some of the spacing issues --- there are a lot of items showing as changes that are not actual changes (i.e. removed blank lines or added / removed spaces) -- this makes it difficult to tell what was / wasn't changed and more likely to miss something / make a mistake. It also means that all these items will show up in history as being changed by this project. This could make diagnosing future issues more difficult (i.e. something that may have always been a certain way may appear it was changed with this project.)
@@ -1163,2 +1187,4 @@
menuROSave.Enabled = rbtnSave.Enabled;
}
public void RTBSymbolsOnOff(string nm)
Owner

It looks like this function isn't called by anything - we should remove code that isn't called.

It looks like this function isn't called by anything - we should remove code that isn't called.
Author
Owner

I removed function

I removed function
@@ -1165,0 +1212,4 @@
}
}
//EnableDisableSymbolsBtn(sender, new ctlXMLEditEventArgs(args.idName));
Owner

Remove commented out code,

Remove commented out code,
@@ -1345,0 +1378,4 @@
this.tbar = new System.Windows.Forms.ToolBar();
this.imageListToolBar = new System.Windows.Forms.ImageList(this.components);
this.lblDuplicateRO = new System.Windows.Forms.Label();
this.galleryContainerSymbolsCM = new DevComponents.DotNetBar.GalleryContainer();
Owner

There are all these: galleryContainerSymbolsCM, CM3, galleryContainerSymbolsGrid, etc...

but it looks like the only gallery used is:
galleryContainerSymbols from line 1386

we shouldn't add these if they aren't used.

There are all these: galleryContainerSymbolsCM, CM3, galleryContainerSymbolsGrid, etc... but it looks like the only gallery used is: galleryContainerSymbols from line 1386 we shouldn't add these if they aren't used.
@@ -2947,0 +3217,4 @@
if (nd == null) nd = curele.SelectSingleNode("*/" + nm);
if (nd == null)
nd = curele.GetCurrentOfMultiFields(curele, nm); // RO Editor add symbols C2022 - 003
Owner

Should these lines be removed?

if (nd==null) nd = curele.SelectSingleNode(nm+"a");
if (nd==null) nd = curele.SelectSingleNode(nm+"b");
if (nd==null) nd = curele.SelectSingleNode(nm+"c");
if (nd==null) nd = curele.SelectSingleNode(nm+"d");

Should these lines be removed? if (nd==null) nd = curele.SelectSingleNode(nm+"a"); if (nd==null) nd = curele.SelectSingleNode(nm+"b"); if (nd==null) nd = curele.SelectSingleNode(nm+"c"); if (nd==null) nd = curele.SelectSingleNode(nm+"d");
@@ -3031,0 +3312,4 @@
DevComponents.DotNetBar.ButtonItem btn = new DevComponents.DotNetBar.ButtonItem();
btn.Image = symCharBtmp;
//btnCM.Text = string.Format("{0}", SymbolNode.SelectSingleNode("unicode").InnerText);
Owner

remove commented out code

remove commented out code
@@ -3031,0 +3323,4 @@
btn.FontBold = true;
btn.Click += new System.EventHandler(rbtnSymbols_Click);
galleryContainerSymbols.SubItems.Add(btn);
////galleryContainerSymbols
Owner

remove commented out code

remove commented out code
Author
Owner

Removed

Removed
@@ -3057,0 +3453,4 @@
// later on, we could add logic to use either FreeMono or Arial Unicode MS based on the format being used
// but for now, we are going to use FreeMono to create the symbol list
Font objFont = new Font("FreeMono", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
//Font objFont = new Font("Arial Unicode MS", 18, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
Owner

remove commented out code

remove commented out code
@@ -3057,0 +3473,4 @@
objGraphics.SmoothingMode = SmoothingMode.AntiAlias;
objGraphics.TextContrast = 0;
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
//objGraphics.DrawString(txt, objFont, new SolidBrush(Color.FromArgb(102, 102, 102)), 0, 0);
Owner

remove commented out code

remove commented out code
@@ -3057,0 +3478,4 @@
objGraphics.Flush();
return (objBmpImage);
}
private void btnSym_Click(object sender, EventArgs e)
Owner

what does this do? / is this used?

looks like only sets a local variable that is never used?

what does this do? / is this used? looks like only sets a local variable that is never used?
Author
Owner

I removed function. it was used in previous code before RTB.

I removed function. it was used in previous code before RTB.
@@ -3057,0 +3482,4 @@
{
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
//if (cbxTextSearchAnnotation.Focused)
Owner

remove commented out code

remove commented out code
@@ -3071,0 +3565,4 @@
{
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
ctlXMLEdit2.TextBoxFocus.InsertSymbol(Convert.ToInt32(b.Tag));
//StartGridEditing(SelectionOption.Start); // If in a FlexGrid, start the editor for a cell
Owner

Remove commented out code

Remove commented out code
@@ -124,6 +128,10 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<Reference Include="VEPROMS.CSLA.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
Owner

What is this needed for?

I would suggest not adding CSLA as a dependency to the RO Editor / doing straight SQL connections as this adds a dependency that we may need to strip out later as at some point CSLA may become no longer maintainable.

What is this needed for? I would suggest not adding CSLA as a dependency to the RO Editor / doing straight SQL connections as this adds a dependency that we may need to strip out later as at some point CSLA may become no longer maintainable.
@@ -42,6 +42,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CmpRpt", "..\CmpRpt\CmpRpt.
{3A4A3543-2D44-11D6-8452-00A0CC271352} = {3A4A3543-2D44-11D6-8452-00A0CC271352}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D9093FAB-448E-47C7-961B-92B18D85CAF7}"
Owner

What project is this that is being added to this solution?

(I am asking as I do not see a new project file which leads me to wonder if this is a PROMS project file being added (which could add cross dependencies) )

What project is this that is being added to this solution? (I am asking as I do not see a new project file which leads me to wonder if this is a PROMS project file being added (which could add cross dependencies) )
@@ -2182,10 +2186,13 @@ namespace RODBInterface
parent.SetAttribute("ChildLoaded", "True");
}
string xmlstr = GenerateXmlString(ro, false);
string tmp2 = Regex.Replace(xmlstr, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
Owner

Where is tmp2 used?

I am seeing this added but doing see a usage later in the file.

Running Regex's take up resources so should only be done if necessary.

Where is tmp2 used? I am seeing this added but doing see a usage later in the file. Running Regex's take up resources so should only be done if necessary.
Author
Owner

I removed the line. It might have been a left over from something I was trying.

I removed the line. It might have been a left over from something I was trying.
@@ -111,6 +111,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ctlXMLEditLib">
Owner

not sure I am understanding why this reference is needed. ctlXMLEdit should depend on RODBInterface instead of the other way around?

not sure I am understanding why this reference is needed. ctlXMLEdit should depend on RODBInterface instead of the other way around?
Author
Owner

removed reference

removed reference
@@ -315,0 +336,4 @@
set
{
_TextBoxFocus = value;
// C2015-017 hide the label indicating user is working with a duplicate of an exiting RO
Owner

Not sure this comment is correct.

Isn't this: // RO Editor add symbols C2022 - 003

Not sure this comment is correct. Isn't this: // RO Editor add symbols C2022 - 003
@@ -315,0 +337,4 @@
{
_TextBoxFocus = value;
// C2015-017 hide the label indicating user is working with a duplicate of an exiting RO
//lblDuplicateRO.Visible = value;
Owner

Remove commented out code

Remove commented out code
@@ -481,0 +509,4 @@
{
hwnd.Text = Regex.Replace(nd.InnerText, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // set the field's text from XML
//hwnd.Text = nd.InnerText; // set the field's text from XML
Owner

Remove commented out code

Remove commented out code
@@ -675,0 +713,4 @@
string result1 = "";
string Str = "";
char[] chrAry = hwnd.Text.ToCharArray();
foreach (int chr in chrAry)
Owner

Can simplify this to have less executions / possibly use LINQ. See recommendations that SonrLint Visual Studio Ext will give.

Can simplify this to have less executions / possibly use LINQ. See recommendations that SonrLint Visual Studio Ext will give.
@@ -675,0 +717,4 @@
{
if (chr > 166)
{
//Str = @"\u" + ((int)chr).ToString("X4");
Owner

Remove commented out code

Remove commented out code
@@ -788,6 +850,125 @@ namespace ctlXMLEditLib
return (false);
}
// RO Editor add symbols C2022 - 003
Owner

see notes below. It looks like these sreg variables are never used.

i.e. they are only called in StaticStripRtfCommands - which is never called.

we should avoid regexs that are never used as they take up resources.

see notes below. It looks like these sreg variables are never used. i.e. they are only called in StaticStripRtfCommands - which is never called. we should avoid regexs that are never used as they take up resources.
@@ -791,0 +861,4 @@
private static Regex sreg8 = new Regex(@"(\\[^ \\?\r\n\t]+) (?=\\)"); // remove space between tokens
private static Regex sreg9 = new Regex(@"(\\[^ \\?\r\n\t]+) (?=\r\n)"); // remove space before /r/n
public static string StaticStripRtfCommands(string rtf, bool fromTable)
Owner

Maybe I am missing something but I am not seeing this function being called anywhere?

We shouldn't include code that isn't called / used.

Maybe I am missing something but I am not seeing this function being called anywhere? We shouldn't include code that isn't called / used.
@@ -791,0 +907,4 @@
}
// RO Editor add symbols C2022 - 003
public static string RTFConvertedSymbolsToUnicode(string str)
Owner

Maybe I am missing something, but it looks like the only place this is called from is StaticStripRtfCommands - which is never called --- so this code will never be called / executed?

Maybe I am missing something, but it looks like the only place this is called from is StaticStripRtfCommands - which is never called --- so this code will never be called / executed?
@@ -791,0 +924,4 @@
return rtnStr;
}
public static string StaticReplaceRTFClause(Match m)
Owner

It looks like this function is never called?

We should remove unused functions.

It looks like this function is never called? We should remove unused functions.
@@ -891,1 +1073,4 @@
Size size = GraphicsHttextbox.Size;
mytextbox.LostFocus += new System.EventHandler(this.GraphicsHt_lostfocus);
//mytextbox.
Owner

Remove commented out code

Remove commented out code
@@ -1932,0 +2160,4 @@
set { _DisplaySymBolBtn = value; }
}
}
public static class RichTextBoxExtensions // RO Editor add symbols C2022 - 003
Owner

A new class like this or extending an existing class should be in it's own cs file so it can be found easily. --- also, otherwise it may be difficult to tell when it will work or not.

A new class like this or extending an existing class should be in it's own cs file so it can be found easily. --- also, otherwise it may be difficult to tell when it will work or not.
@@ -1932,0 +2170,4 @@
richTextBox.SelectedRtf = RtfPrefixForSymbols + sym + @"}";
richTextBox.SelectedRtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033\uc1 }";
richTextBox.Select(position, 0);
//richTextBox.Select(position, 1); //left here for reference
Owner

Remove commented out code

Remove commented out code
@@ -126,6 +126,10 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<Reference Include="Volian.Base.Library, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
Owner

Is this reference needed?

Not seeing anything added that references the Base library? (unless I am missing something)

If nothing is added requiring this, then should not add an added dependency.

Is this reference needed? Not seeing anything added that references the Base library? (unless I am missing something) If nothing is added requiring this, then should not add an added dependency.
Author
Owner

I remove the reference

I remove the reference
@@ -2155,2 +2160,3 @@
s2 = s2.Replace(@"\u160?", "<HSP>"); // convert hard spaces bug fix: B2016-206
s2 = s2.Replace(@"\", @"\u9586?"); // convert backslashes to a backslash symbol
if (!Regex.IsMatch(s2, pattern)) // RO Editor add symbols C2022 - 003
Owner

Not if sure this makes sense --- will this ever get executed?

what if you have something that contains both special characters and a backslash in the text?

Not if sure this makes sense --- will this ever get executed? what if you have something that contains both special characters and a backslash in the text?
Author
Owner

It is needed. If a special letter (Unicode) comes through this code it will mess-up one way or another. Maybe it needs to be refined to handle the special char and a separate back slash.

It is needed. If a special letter (Unicode) comes through this code it will mess-up one way or another. Maybe it needs to be refined to handle the special char and a separate back slash.
Owner

I would say that is the case --- if there are are matches on the backslash not followed by a "u" those need to be replaced.

Likely would have to get matches and then loop through those specific matches doing a replace on those,

I would say that is the case --- if there are are matches on the backslash not followed by a "u" those need to be replaced. Likely would have to get matches and then loop through those specific matches doing a replace on those,
@@ -1,18 +1,19 @@
using DevComponents.DotNetBar;
Owner

what is this needed for?

what is this needed for?
Author
Owner

I did not add it. I checked with the Master and it is included.

I did not add it. I checked with the Master and it is included.
Owner

sorry missed it since the lines were changed. It was previously on line 11. - this is good. I will resolve this item.

sorry missed it since the lines were changed. It was previously on line 11. - this is good. I will resolve this item.
mschill marked this conversation as resolved
@@ -13,3 +14,2 @@
using Volian.Base.Library;
using JR.Utils.GUI.Forms;
using System.Linq;
using XYPlots;
Owner

what is this needed for?

what is this needed for?
Author
Owner

I did not add it. I checked with the Master and XYPlots is included.

I did not add it. I checked with the Master and XYPlots is included.
Owner

sorry missed it since the lines were changed. It was previously on line 10. - this is good. I will resolve this item.

sorry missed it since the lines were changed. It was previously on line 10. - this is good. I will resolve this item.
mschill marked this conversation as resolved
@@ -14,2 +15,2 @@
using JR.Utils.GUI.Forms;
using System.Linq;
using XYPlots;
using static System.Net.Mime.MediaTypeNames;
Owner

what is this needed for?

what is this needed for?
Author
Owner

Not sure how the line got there. I will remove it.

Not sure how the line got there. I will remove it.
@@ -724,2 +724,4 @@
}
}
public DevComponents.DotNetBar.GalleryContainer BuildSymbolGalleryForRO()
Owner

This function doesn't appear to be called from anywhere / used anywhere -- should this be in here / changed?

Also, should there be any changes to the StepTabRibbon Designer or Resx PROMS files?

It looks like Dotnetbar was used in the RO Editor not StepTabRibbon - so are theseearlier attempts that shouldn't be part of the final product (unless I am missing something - which could be possible)?

---but as is it looks like there shouldn't be any changes to any of the 3 StepTabRibbon files?

This function doesn't appear to be called from anywhere / used anywhere -- should this be in here / changed? Also, should there be any changes to the StepTabRibbon Designer or Resx PROMS files? It looks like Dotnetbar was used in the RO Editor not StepTabRibbon - so are theseearlier attempts that shouldn't be part of the final product (unless I am missing something - which could be possible)? ---but as is it looks like there shouldn't be any changes to any of the 3 StepTabRibbon files?
Author
Owner

I removed the function

I removed the function
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin C2022-003-Change-Textboxes-to-RTF-3:C2022-003-Change-Textboxes-to-RTF-3
git checkout C2022-003-Change-Textboxes-to-RTF-3
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Volian/SourceCode#676