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

This commit is contained in:
2026-01-28 14:47:00 -05:00
parent 0ae45eb918
commit 77c6298067
9 changed files with 295 additions and 20 deletions

View File

@@ -96,10 +96,11 @@ namespace ROEditor
private System.Windows.Forms.Label lblW2;
private System.Windows.Forms.Label lblW3;
private System.Windows.Forms.Label lblW4;
ctlXMLEditLib.roRichTextBox tbSingleTxtWid; // RO Editor add symbols C2022 - 003
ctlXMLEditLib.roRichTextBox tbVariableTxtWid;
ctlXMLEditLib.roRichTextBox tbTableWid;
ctlXMLEditLib.roRichTextBox tbXYPlotWid;
private System.Windows.Forms.TextBox tbSingleTxtWid;
private System.Windows.Forms.TextBox tbVariableTxtWid;
private System.Windows.Forms.TextBox tbTableWid;
private System.Windows.Forms.TextBox tbXYPlotWid;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
/// <summary>
@@ -218,10 +219,11 @@ 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 ctlXMLEditLib.roRichTextBox(); // RO Editor add symbols C2022 - 003
this.tbTableWid = new ctlXMLEditLib.roRichTextBox();
this.tbVariableTxtWid = new ctlXMLEditLib.roRichTextBox ();
this.tbSingleTxtWid = new ctlXMLEditLib.roRichTextBox();
this.tbXYPlotWid = new System.Windows.Forms.TextBox();
this.tbTableWid = new System.Windows.Forms.TextBox();
this.tbVariableTxtWid = new System.Windows.Forms.TextBox();
this.tbSingleTxtWid = new System.Windows.Forms.TextBox();
this.lblW4 = new System.Windows.Forms.Label();
this.lblW3 = new System.Windows.Forms.Label();
this.lblW2 = new System.Windows.Forms.Label();
@@ -280,6 +282,7 @@ namespace ROEditor
this.tbXYPlotWid.Size = new System.Drawing.Size(40, 22);
this.tbXYPlotWid.TabIndex = 11;
this.tbXYPlotWid.Text = "";
this.tbXYPlotWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// tbTableWid
//
@@ -288,6 +291,7 @@ namespace ROEditor
this.tbTableWid.Size = new System.Drawing.Size(40, 22);
this.tbTableWid.TabIndex = 10;
this.tbTableWid.Text = "";
this.tbTableWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// tbVariableTxtWid
//
@@ -296,6 +300,7 @@ namespace ROEditor
this.tbVariableTxtWid.Size = new System.Drawing.Size(40, 22);
this.tbVariableTxtWid.TabIndex = 9;
this.tbVariableTxtWid.Text = "";
this.tbVariableTxtWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// tbSingleTxtWid
//
@@ -304,6 +309,7 @@ namespace ROEditor
this.tbSingleTxtWid.Size = new System.Drawing.Size(40, 22);
this.tbSingleTxtWid.TabIndex = 8;
this.tbSingleTxtWid.Text = "";
this.tbSingleTxtWid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBox_KeyDown);
//
// lblW4
//
@@ -586,5 +592,33 @@ namespace ROEditor
this.Close();
}
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)
{
MessageBox.Show("Symbols are not allowed in the field. Clipbroad: '" + clpBrd + "'");
Clipboard.Clear();
}
}
}
}
}