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 VlnXmlElement editelem;
private XmlDocument editdoc;
private TextBox zoomtextbox;
private RichTextBox zoomtextbox;
// 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.
private TextBox GraphicsFiletextbox;
private TextBox GraphicsWdtextbox;
private TextBox GraphicsHttextbox;
private RichTextBox GraphicsFiletextbox;
private RichTextBox GraphicsWdtextbox;
private RichTextBox GraphicsHttextbox;
private System.Windows.Forms.Button btnFindFile;
private string GraphicsText;
private ToolTip zmtooltip;
@@ -378,7 +378,7 @@ namespace ctlXMLEditLib
private void SetRequiredFields(ArrayList reqfields)
{
Object o;
TextBox hwnd;
RichTextBox hwnd;
string field, msg;
int indx;
foreach (string strfld in reqfields)
@@ -405,7 +405,7 @@ namespace ctlXMLEditLib
}
else if (o != null)
{
hwnd = (TextBox) o;
hwnd = (RichTextBox) o;
if (hwnd.Tag != null)
{
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
// 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;
// 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)
{
Object o;
TextBox hwnd;
RichTextBox hwnd;
XmlNode nd;
// if we have an image, check it for validity, i.e. file exists, etc.??
foreach (string str in myHT.Keys)
{
o = myHT[str];
hwnd = (TextBox) o;
hwnd = (RichTextBox)o;
nd = node.SelectSingleNode(str);
// if not found with just the string, search the tree.
if (nd==null)nd = node.SelectSingleNode("*/"+str);
@@ -546,7 +546,7 @@ namespace ctlXMLEditLib
// height/width data of the image.
if (GraphicsFiletextbox != null && GraphicsFiletextbox.Text != "") UpdateHtWd();
}
public TextBox GetGraphicsFiletextbox()
public RichTextBox GetGraphicsFiletextbox()
{
return GraphicsFiletextbox;
}
@@ -858,7 +858,7 @@ namespace ctlXMLEditLib
// '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.
// 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)
{
// set up for text box tag, which stores whether field is required and
@@ -909,9 +909,9 @@ namespace ctlXMLEditLib
else
{
mytextbox.Multiline = true;
mytextbox.AcceptsReturn = true;
mytextbox.AcceptsTab = true;
mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4;
mytextbox.ScrollBars = ScrollBars.Vertical;
mytextbox.ScrollBars = RichTextBoxScrollBars.Vertical;
zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom");
}
@@ -992,7 +992,7 @@ namespace ctlXMLEditLib
radio.CheckedChanged += new System.EventHandler(this.radiocheckchg);
gbox.Controls.Add(radio);
TextBox tb = new TextBox();
RichTextBox tb = new RichTextBox();
tb.Location = new Point(boxx+20, y+25);
if (!first) tb.Visible = false;
myHT.Add(element.Name,tb);
@@ -1144,8 +1144,8 @@ namespace ctlXMLEditLib
}
else
{
TextBox mytextbox;
mytextbox = new TextBox();
RichTextBox mytextbox;
mytextbox = new RichTextBox();
mytextbox.Location = new Point(screenx+indent, screeny);
string tFieldName = (pcChildIdx == 0) ? CvtUserFldToFld(element.Name) : CvtUserFldToFld(pcChildFldName);
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 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 &
//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.
private void textbox_zoombtn(object sender, System.EventArgs e)
{
TextBox textbox = (TextBox) sender;
RichTextBox textbox = (RichTextBox) sender;
if (textbox.Multiline == true || textbox == GraphicsFiletextbox)
zoomtextbox = textbox;
else
@@ -1433,7 +1433,7 @@ namespace ctlXMLEditLib
{
try
{
MyValidatingCode((TextBox) sender);
MyValidatingCode((RichTextBox) sender);
}
catch(Exception ex)
@@ -1460,7 +1460,10 @@ namespace ctlXMLEditLib
btnZoom_click(null, null);
}
}
public void btnSymbols_click(object sender, System.EventArgs e)
{
}
public void btnZoom_click(object sender, System.EventArgs e)
{
//TextBox tb = (TextBox) sender;