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

This commit is contained in:
2025-09-24 16:26:44 -04:00
parent 563c133676
commit cc66eb5329

View File

@@ -237,12 +237,12 @@ namespace ctlXMLEditLib
private bool dosaveflag; private bool dosaveflag;
private VlnXmlElement editelem; private VlnXmlElement editelem;
private XmlDocument editdoc; private XmlDocument editdoc;
private TextBox zoomtextbox; private RichTextBox zoomtextbox;
// the following is used for handling images. Note that if we want to have more // the following is used for handling images. Note that if we want to have more
// than one image defined in an ro, this should be become a list. // than one image defined in an ro, this should be become a list.
private TextBox GraphicsFiletextbox; private RichTextBox GraphicsFiletextbox;
private TextBox GraphicsWdtextbox; private RichTextBox GraphicsWdtextbox;
private TextBox GraphicsHttextbox; private RichTextBox GraphicsHttextbox;
private System.Windows.Forms.Button btnFindFile; private System.Windows.Forms.Button btnFindFile;
private string GraphicsText; private string GraphicsText;
private ToolTip zmtooltip; private ToolTip zmtooltip;
@@ -378,7 +378,7 @@ namespace ctlXMLEditLib
private void SetRequiredFields(ArrayList reqfields) private void SetRequiredFields(ArrayList reqfields)
{ {
Object o; Object o;
TextBox hwnd; RichTextBox hwnd;
string field, msg; string field, msg;
int indx; int indx;
foreach (string strfld in reqfields) foreach (string strfld in reqfields)
@@ -405,7 +405,7 @@ namespace ctlXMLEditLib
} }
else if (o != null) else if (o != null)
{ {
hwnd = (TextBox) o; hwnd = (RichTextBox) o;
if (hwnd.Tag != null) if (hwnd.Tag != null)
{ {
TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag;
@@ -419,7 +419,7 @@ namespace ctlXMLEditLib
// C2021-026 If this is a Parent/Child field that has no value saved in the database // C2021-026 If this is a Parent/Child field that has no value saved in the database
// then use the parent's value and display it as grey colored text. // then use the parent's value and display it as grey colored text.
private void GetDefaultParentValue(TextBox tb, XmlNode node, string chldName) private void GetDefaultParentValue(RichTextBox tb, XmlNode node, string chldName)
{ {
XmlNode parentNode = null; XmlNode parentNode = null;
// PCChildren contains a list strings reprenting the Children setup in the current Working Draft Parent/Child property // PCChildren contains a list strings reprenting the Children setup in the current Working Draft Parent/Child property
@@ -463,13 +463,13 @@ namespace ctlXMLEditLib
private void DisplayFieldContents(XmlNode node) private void DisplayFieldContents(XmlNode node)
{ {
Object o; Object o;
TextBox hwnd; RichTextBox hwnd;
XmlNode nd; XmlNode nd;
// if we have an image, check it for validity, i.e. file exists, etc.?? // if we have an image, check it for validity, i.e. file exists, etc.??
foreach (string str in myHT.Keys) foreach (string str in myHT.Keys)
{ {
o = myHT[str]; o = myHT[str];
hwnd = (TextBox) o; hwnd = (RichTextBox)o;
nd = node.SelectSingleNode(str); nd = node.SelectSingleNode(str);
// if not found with just the string, search the tree. // if not found with just the string, search the tree.
if (nd==null)nd = node.SelectSingleNode("*/"+str); if (nd==null)nd = node.SelectSingleNode("*/"+str);
@@ -546,7 +546,7 @@ namespace ctlXMLEditLib
// height/width data of the image. // height/width data of the image.
if (GraphicsFiletextbox != null && GraphicsFiletextbox.Text != "") UpdateHtWd(); if (GraphicsFiletextbox != null && GraphicsFiletextbox.Text != "") UpdateHtWd();
} }
public TextBox GetGraphicsFiletextbox() public RichTextBox GetGraphicsFiletextbox()
{ {
return GraphicsFiletextbox; return GraphicsFiletextbox;
} }
@@ -858,7 +858,7 @@ namespace ctlXMLEditLib
// 'normalizedString') or a multiline text box(type is 'string'). Also, a radio // 'normalizedString') or a multiline text box(type is 'string'). Also, a radio
// button is passed in if this was called to handle an element within a combo type. // button is passed in if this was called to handle an element within a combo type.
// This button is saved for a given text box so that initialization of these combo types can occur. // This button is saved for a given text box so that initialization of these combo types can occur.
private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, TextBox mytextbox, RadioButton radio, private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, RichTextBox mytextbox, RadioButton radio,
bool img, string imgname) bool img, string imgname)
{ {
// set up for text box tag, which stores whether field is required and // set up for text box tag, which stores whether field is required and
@@ -909,9 +909,9 @@ namespace ctlXMLEditLib
else else
{ {
mytextbox.Multiline = true; mytextbox.Multiline = true;
mytextbox.AcceptsReturn = true; mytextbox.AcceptsTab = true;
mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4; mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4;
mytextbox.ScrollBars = ScrollBars.Vertical; mytextbox.ScrollBars = RichTextBoxScrollBars.Vertical;
zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom"); zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom");
} }
@@ -992,7 +992,7 @@ namespace ctlXMLEditLib
radio.CheckedChanged += new System.EventHandler(this.radiocheckchg); radio.CheckedChanged += new System.EventHandler(this.radiocheckchg);
gbox.Controls.Add(radio); gbox.Controls.Add(radio);
TextBox tb = new TextBox(); RichTextBox tb = new RichTextBox();
tb.Location = new Point(boxx+20, y+25); tb.Location = new Point(boxx+20, y+25);
if (!first) tb.Visible = false; if (!first) tb.Visible = false;
myHT.Add(element.Name,tb); myHT.Add(element.Name,tb);
@@ -1144,8 +1144,8 @@ namespace ctlXMLEditLib
} }
else else
{ {
TextBox mytextbox; RichTextBox mytextbox;
mytextbox = new TextBox(); mytextbox = new RichTextBox();
mytextbox.Location = new Point(screenx+indent, screeny); mytextbox.Location = new Point(screenx+indent, screeny);
string tFieldName = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName); string tFieldName = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName);
mytextbox.Name = tFieldName; mytextbox.Name = tFieldName;
@@ -1391,7 +1391,7 @@ namespace ctlXMLEditLib
// The following can be used to validate the text, i.e. check the text against // The following can be used to validate the text, i.e. check the text against
// the pattern. this needs written yet (5/16/02) // the pattern. this needs written yet (5/16/02)
private void MyValidatingCode(TextBox tb) private void MyValidatingCode(RichTextBox tb)
{ {
//get the text box's tag which contains a flag for whether this is required & //get the text box's tag which contains a flag for whether this is required &
//if it has a pattern. If it has a pattern, validate the field against the pattern. //if it has a pattern. If it has a pattern, validate the field against the pattern.
@@ -1422,7 +1422,7 @@ namespace ctlXMLEditLib
// save which box we're on, for zoom processing. // save which box we're on, for zoom processing.
private void textbox_zoombtn(object sender, System.EventArgs e) private void textbox_zoombtn(object sender, System.EventArgs e)
{ {
TextBox textbox = (TextBox) sender; RichTextBox textbox = (RichTextBox) sender;
if (textbox.Multiline == true || textbox == GraphicsFiletextbox) if (textbox.Multiline == true || textbox == GraphicsFiletextbox)
zoomtextbox = textbox; zoomtextbox = textbox;
else else
@@ -1433,7 +1433,7 @@ namespace ctlXMLEditLib
{ {
try try
{ {
MyValidatingCode((TextBox) sender); MyValidatingCode((RichTextBox) sender);
} }
catch(Exception ex) catch(Exception ex)
@@ -1460,7 +1460,10 @@ namespace ctlXMLEditLib
btnZoom_click(null, null); btnZoom_click(null, null);
} }
} }
public void btnSymbols_click(object sender, System.EventArgs e)
{
}
public void btnZoom_click(object sender, System.EventArgs e) public void btnZoom_click(object sender, System.EventArgs e)
{ {
//TextBox tb = (TextBox) sender; //TextBox tb = (TextBox) sender;