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

This commit is contained in:
2025-12-22 17:16:00 -05:00
parent 751794c1ec
commit d4ecf28147
9 changed files with 151 additions and 202 deletions

View File

@@ -96,7 +96,7 @@ namespace ROEditor
private System.Windows.Forms.Label lblW2;
private System.Windows.Forms.Label lblW3;
private System.Windows.Forms.Label lblW4;
private System.Windows.Forms.RichTextBox tbSingleTxtWid; // RO Editor add symbols C2025 - 003
private System.Windows.Forms.RichTextBox tbSingleTxtWid; // RO Editor add symbols C2022 - 003
private System.Windows.Forms.RichTextBox tbVariableTxtWid;
private System.Windows.Forms.RichTextBox tbTableWid;
private System.Windows.Forms.RichTextBox tbXYPlotWid;
@@ -218,7 +218,7 @@ namespace ROEditor
this.lblFieldName = new System.Windows.Forms.Label();
this.tbFieldName = new System.Windows.Forms.TextBox();
this.gbAlternatives = new System.Windows.Forms.GroupBox();
this.tbXYPlotWid = new System.Windows.Forms.RichTextBox(); // RO Editor add symbols C2025 - 003
this.tbXYPlotWid = new System.Windows.Forms.RichTextBox(); // RO Editor add symbols C2022 - 003
this.tbTableWid = new System.Windows.Forms.RichTextBox();
this.tbVariableTxtWid = new System.Windows.Forms.RichTextBox();
this.tbSingleTxtWid = new System.Windows.Forms.RichTextBox();

View File

@@ -302,7 +302,8 @@ using Org.Mentalis.Files;
using System.Runtime.InteropServices;
using System.Linq;
using System.Collections.Generic;
using Volian.Controls.Library;
//using Volian.Controls.Library;
using Volian.Base.Library;
using VEPROMS.CSLA.Library;
using System.Xml;
using System.Drawing.Text;
@@ -310,11 +311,9 @@ using System.Drawing.Drawing2D;
using System.Text.RegularExpressions;
//using IniFileIO;
namespace ROEditor
{
/// <summary>
/// <summary>
/// Summary description for Form1.
/// </summary>
///
@@ -361,7 +360,7 @@ namespace ROEditor
private TreeNode LastSelectedNode;
private RichTextBox _CurrentTextBox; // currently selected TextBox field
public static string[] PCChildren; //C2021-026 list of Parent/Child Children
private StepTabRibbon _MyStepTabRibbon;
//private StepTabRibbon _MyStepTabRibbon;
public RichTextBox CurrentTextBox
{
@@ -369,6 +368,19 @@ namespace ROEditor
set { _CurrentTextBox = value; }
}
public static string _RO_IDEN;
public static string RO_IDEN
{
get
{
return _RO_IDEN;
}
set
{
_RO_IDEN = value;
}
}
public List<TreeNode> ROsSelectedforMultiMove { get; set; } //to allow multiple RO nodes to be selected
public bool ROCutWasSelected { get; set; } = false;
@@ -380,7 +392,6 @@ namespace ROEditor
private System.Windows.Forms.ListView roListView;
private System.Windows.Forms.ToolBar tbar;
//this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl();
private bool _duplicate_active;
private bool duplicate_active
{
@@ -409,10 +420,10 @@ namespace ROEditor
// Required for Windows Form Designer support
//
InitializeComponent();
getSymbols();
// B2019-082 set the date format on the VEPROMS.exe thread to U.S. for i/o of a date string
// this is to correct an issue for a UAE customer who could not open some procedures due to the desktop date setting using the "DD/MM/YYYY" instead of the "MM/DD/YYYY" format
// NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable
getSymbols(); // RO Editor add symbols C2022 - 003
// B2019-082 set the date format on the VEPROMS.exe thread to U.S. for i/o of a date string
// this is to correct an issue for a UAE customer who could not open some procedures due to the desktop date setting using the "DD/MM/YYYY" instead of the "MM/DD/YYYY" format
// NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
// The data path the was passed in.
@@ -875,7 +886,7 @@ namespace ROEditor
// Should the save option be available?
// Just reflect the Save button state.
roTreeView.ContextMenu.MenuItems[6].Enabled = rbtnSave.Enabled; // RO Editor add symbols C2025 - 003
roTreeView.ContextMenu.MenuItems[6].Enabled = rbtnSave.Enabled; // RO Editor add symbols C2022 - 003
menuROSave.Enabled = rbtnSave.Enabled;
// Should the properties menu item be available?
@@ -954,7 +965,7 @@ namespace ROEditor
this.panel2.Controls.Remove(ctlXMLEdit2);
this.panel2.Visible = false;
rbtnSave.Enabled = false; // RO Editor add symbols C2025 - 003
rbtnSave.Enabled = false; // RO Editor add symbols C2022 - 003
menuROSave.Enabled = rbtnSave.Enabled;
rbtnRestore.Enabled = false;
rbtnSaveAs.Enabled = false;
@@ -993,6 +1004,7 @@ namespace ROEditor
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
ctlXMLEdit2.TabIndex = 4;
ctlXMLEdit2.Tag = "";
/*
* Spin through all of the controls and assign an event handler
* for changed text so that when the user changes any of the RO Text,
@@ -1015,11 +1027,13 @@ namespace ROEditor
else
{
TmpInfo.TextChanged += new EventHandler(ctlXMLEdit2_TextChanged);
TmpInfo.Click += new EventHandler(ctlXMLEdit2_ClickControl);
TmpInfo.Click += new EventHandler(ctlXMLEdit2_ClickControl);
}
}
ctlXMLEdit2.EnableDisableSymbolsBtn += new ctlXMLEditLib.ctlXMLEdit.ctlXMLEditEvent(EnableDisableSymbolsBtn);
RO_IDEN = curelem.GetAccPageIDTemplate();
this.panel2.Controls.Add(ctlXMLEdit2);
rbtnCancel.Enabled = true; // RO Editor add symbols C2025 - 003
rbtnCancel.Enabled = true; // RO Editor add symbols C2022 - 003
rbtnSymbols.Enabled = true;
}
// C2021-026 Get a list of fields that are P/C enabled
@@ -1154,6 +1168,7 @@ namespace ROEditor
this.menuEditCopy.Enabled = true;
this.menuEditCut.Enabled = true;
}
object dataobj = System.Windows.Forms.Clipboard.GetDataObject();
if (dataobj != null)
this.menuEditPaste.Enabled = true;
@@ -1172,6 +1187,32 @@ namespace ROEditor
menuROSave.Enabled = rbtnSave.Enabled;
}
public void RTBSymbolsOnOff(string nm)
{
string RO_IDENDITY = RO_IDEN.Substring(1, RO_IDEN.Length - 2);
if (this.CurrentTextBox.Name == RO_IDENDITY)
{
rbtnSymbols.Enabled = false;
}
else
{
rbtnSymbols.Enabled = true;
}
}
public void EnableDisableSymbolsBtn(object sender, ctlXMLEditEventArgs args)
{
if (args.DisplaySymBolBtn == false)
{
rbtnSymbols.Enabled = false;
}
else
{
rbtnSymbols.Enabled = true;
}
}
//EnableDisableSymbolsBtn(sender, new ctlXMLEditEventArgs(args.idName));
protected void ctlXMLEdit2_TextChanged(object sender, EventArgs e)
{
@@ -1293,8 +1334,8 @@ namespace ROEditor
this.imageListRoTree = new System.Windows.Forms.ImageList(this.components);
this.splitter1 = new System.Windows.Forms.Splitter();
this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl();
this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); // RO Editor add symbols C2025 - 003
this.ribbonBar1 = new DevComponents.DotNetBar.RibbonBar(); // RO Editor add symbols C2025 - 003
this.ribbonPanel1 = new DevComponents.DotNetBar.RibbonPanel(); // RO Editor add symbols C2022 - 003
this.ribbonBar1 = new DevComponents.DotNetBar.RibbonBar(); // RO Editor add symbols C2022 - 003
this.rbtnSave = new DevComponents.DotNetBar.ButtonItem();
this.rbtnCancel = new DevComponents.DotNetBar.ButtonItem();
this.rbtnRestore = new DevComponents.DotNetBar.ButtonItem();
@@ -1367,7 +1408,7 @@ namespace ROEditor
//
//
//
this.ribbonControl1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; // RO Editor add symbols C2025 - 003
this.ribbonControl1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; // RO Editor add symbols C2022 - 003
this.ribbonControl1.CaptionVisible = true;
this.ribbonControl1.Controls.Add(this.ribbonPanel1);
this.ribbonControl1.Dock = System.Windows.Forms.DockStyle.Top;
@@ -1407,7 +1448,7 @@ namespace ROEditor
//
// ribbonPanel1
//
this.ribbonPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; // RO Editor add symbols C2025 - 003
this.ribbonPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; // RO Editor add symbols C2022 - 003
this.ribbonPanel1.Controls.Add(this.ribbonBar1);
this.ribbonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ribbonPanel1.Location = new System.Drawing.Point(0, 0);
@@ -1927,104 +1968,7 @@ namespace ROEditor
}
//private void BuildSymbolGallery(SymbolList sl, DevComponents.DotNetBar.GalleryContainer gc1, DevComponents.DotNetBar.GalleryContainer gc2, DevComponents.DotNetBar.GalleryContainer gc3, DevComponents.DotNetBar.GalleryContainer gc4)
//{
// foreach (Symbol sym in sl)
// {
// // get an image of the symbol character
// // found the we cannot change the font being used for the button text
// Bitmap symCharBtmp = createTextBitmap(
// (char)sym.Unicode);
// DevComponents.DotNetBar.ButtonItem btn = new DevComponents.DotNetBar.ButtonItem();
// btn.Image = symCharBtmp;
// //btn.Text = string.Format("{0}", (char)sym.Unicode);
// // to name button use unicode rather than desc, desc may have spaces or odd chars
// btn.Name = "btn" + sym.Unicode.ToString();
// btn.Tooltip = sym.Desc;
// btn.Tag = string.Format(@"{0}", sym.Unicode);
// //btn.FontBold = true;
// btn.Click += new System.EventHandler(btnSym_Click);
// galleryContainerSymbols.SubItems.Add(btn);
// DevComponents.DotNetBar.ButtonItem btnCM1 = GetCMButton(sym);
// btnCM1.Image = symCharBtmp;
// btnCM1.Click += new System.EventHandler(btnSym_Click);
// gc1.SubItems.Add(btnCM1);
// DevComponents.DotNetBar.ButtonItem btnCM2 = GetCMButton(sym);
// btnCM2.Image = symCharBtmp;
// btnCM2.Click += new System.EventHandler(btnSym_Click);
// gc2.SubItems.Add(btnCM2);
// DevComponents.DotNetBar.ButtonItem btnCM3 = GetCMButton(sym);
// btnCM3.Image = symCharBtmp;
// btnCM3.Click += new System.EventHandler(btnSym_Click);
// gc3.SubItems.Add(btnCM3);
// DevComponents.DotNetBar.ButtonItem btnCM4 = GetCMButton(sym);
// btnCM4.Image = symCharBtmp;
// btnCM4.Click += new System.EventHandler(btnSym_Click);
// gc4.SubItems.Add(btnCM4);
// }
//}
//private void btnSym_Click(object sender, EventArgs e)
//{
// DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
// StartGridEditing(SelectionOption.Start); // If in a FlexGrid, start the editor for a cell
// _MyStepTabRibbon.MyStepRTB.InsertSymbol(Convert.ToInt32(b.Tag));
// //_MyStepTabRibbon.
//}
//private enum SelectionOption
//{
// Start,
// All,
// End
//}
//private void StartGridEditing(SelectionOption selOpt)
//{
// // Bug fix: B2012-203, B2012-204
// // Need to check if the selected table cell is in edit mode already.
// // if already in edit mode, we don't want to do the StartEditing code below, because it
// // will override the current cursor positioning and selection range.
// Control ctrl = FindActiveControl();
// if (ctrl == null) return; // B2018-008 If a null is returned, don't do anything
// if (ctrl is VlnFlexGrid)
// {
// // Selected table cell is not in edit mode. Go into edit mode and position acording
// // to the pass in selOpt.
// if (MyFlexGrid != null && MyFlexGrid.Editor == null)
// {
// MyFlexGrid.StartEditing();
// switch (selOpt)
// {
// case SelectionOption.Start:
// MyStepRTB.Select(0, 0);
// break;
// case SelectionOption.All:
// MyStepRTB.SelectAll();
// break;
// case SelectionOption.End:
// MyStepRTB.Select(MyStepRTB.TextLength, 0);
// break;
// default:
// MyStepRTB.Select(0, 0);
// break;
// }
// }
// }
//}
//private static DevComponents.DotNetBar.ButtonItem GetCMButton(Symbol sym)
//{
// DevComponents.DotNetBar.ButtonItem btnCM3 = new DevComponents.DotNetBar.ButtonItem();
// //btnCM3.Text = string.Format("{0}", (char)sym.Unicode);
// // to name button use unicode rather than desc, desc may have spaces or odd chars
// btnCM3.Name = "btnCM" + sym.Unicode.ToString();
// btnCM3.Tooltip = sym.Desc;
// btnCM3.Tag = string.Format(@"{0}", sym.Unicode);
// //btnCM3.FontBold = true;
// return btnCM3;
//}
//_MyStepTabRibbon.BuildSymbolGalleryForRO();
//part of CSM-C2024-027 / Part of 2024 PROMS Upgrades
//Paste Selected - will move individual ROs
@@ -2067,7 +2011,7 @@ namespace ROEditor
roTreeView_ClearAllMultiSelect();
rbtnRestore.Enabled = false; // RO Editor add symbols C2025 - 003
rbtnRestore.Enabled = false; // RO Editor add symbols C2022 - 003
rbtnSave.Enabled = false;
rbtnCancel.Enabled = true;
rbtnSaveAs.Enabled = false;
@@ -2925,29 +2869,6 @@ namespace ROEditor
}
/*
// Tool Bar Support
*/
private void tbar_OnClick(object obj, ToolBarButtonClickEventArgs tbbcea)
{
ToolBarButton tbb = tbbcea.Button;
// see which event should be called.
if (tbb.Text == "Cancel")
tbar_CancelClick();
else if (tbb.Text == "Save")
tbar_SaveClick();
else if (tbb.Text == "Save As")
tbar_SaveAsClick();
else if (tbb.Text == "Duplicate")
tbar_DuplicateClick();
else if (tbb.Text == "Restore")
tbar_RestoreClick();
else if (tbb.Text == "Zoom" || tbb.Text == "View Image")
ctlXMLEdit2.btnZoom_click(null, null);
}
private void tbar_RestoreClick()
{
ctlXMLEdit2.RestoreData();
@@ -3010,7 +2931,7 @@ namespace ROEditor
MessageBox.Show("The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
return false;
}
myro.SetAttribute("AccPageID", myro.GetAccPageIDString(acctmpl));
myro.SetAttribute("AccPageID", myro.GetAccPageIDString(acctmpl));
}
}
else
@@ -3038,6 +2959,7 @@ namespace ROEditor
newt = new TreeNode(mnutitle, img, img);
newt.Tag = myro;
newt.Name = myro.GetAttribute("RecID");
newt.Text = Regex.Replace(newt.Text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
TreeNewparent.Nodes.Add(newt);
}
}
@@ -3294,16 +3216,16 @@ namespace ROEditor
nd = curele.SelectSingleNode(nm);
if (nd == null) nd = curele.SelectSingleNode("*/" + nm);
if (nd == null)
nd = curele.GetCurrentOfMultiFields(curele, nm);
// 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");
nd = curele.GetCurrentOfMultiFields(curele, nm); // RO Editor add symbols C2022 - 003
string data;
if (nd == null)
data = " ";
else
{
data = nd.InnerText;
data = Regex.Replace(data, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
}
if (first == true)
{
item = new ListViewItem(data, ROIMAGE);
@@ -3380,12 +3302,7 @@ namespace ROEditor
roListView.Sort();
}
//private void roTreeView_AfterSelect_1(object sender, System.Windows.Forms.TreeViewEventArgs e)
//{
//}
public void getSymbols() // RO Editor add symbols C2025 - 003
public void getSymbols() // RO Editor add symbols C2022 - 003
{
Dictionary<int, string> ROSymbols = buildsymbols();
@@ -3410,7 +3327,7 @@ namespace ROEditor
}
}
private Dictionary<int, string> buildsymbols() // RO Editor add symbols C2025 - 003
private Dictionary<int, string> buildsymbols() // RO Editor add symbols C2022 - 003
{
Dictionary<int, string> symbols1 = new Dictionary<int, string>()
{
@@ -3613,7 +3530,7 @@ namespace ROEditor
}
private void rbtnSave_Click(object sender, EventArgs e) // RO Editor add symbols C2025 - 003
private void rbtnSave_Click(object sender, EventArgs e) // RO Editor add symbols C2022 - 003
{
tbar_SaveClick();
}
@@ -3644,7 +3561,7 @@ namespace ROEditor
ctlXMLEdit2.btnZoom_click(null, null);
}
private void rbtnSymbols_Click(object sender, EventArgs e) // RO Editor add symbols C2025 - 003
private void rbtnSymbols_Click(object sender, EventArgs e) // RO Editor add symbols C2022 - 003
{
DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender;
ctlXMLEdit2.TextBoxFocus.InsertSymbol(Convert.ToInt32(b.Tag));

View File

@@ -136,10 +136,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Volian.Base.Library\bin\Debug\Volian.Base.Library.dll</HintPath>
</Reference>
<Reference Include="Volian.Controls.Library, Version=1.0.9399.43177, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Volian.Controls.Library\bin\Debug\Volian.Controls.Library.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AboutROEditor.cs">