B2021-077 – was sometimes asked to save changes after clicking on Save button

B2021-079 – increased the minimum width of the child fields grouping box
C2021-026 – when parent value changes, show in child fields that default to the parent value
This commit is contained in:
John Jenko 2021-08-13 18:47:45 +00:00
parent fea1b4ca9f
commit 746a247504

View File

@ -644,7 +644,9 @@ namespace ctlXMLEditLib
parentNode = node.SelectSingleNode(parent); parentNode = node.SelectSingleNode(parent);
// if not found with just the string, search the tree. // if not found with just the string, search the tree.
if (parentNode == null) parentNode = node.SelectSingleNode("*/" + parent); if (parentNode == null) parentNode = node.SelectSingleNode("*/" + parent);
if (parentNode != null && parentNode.InnerText == tb.Text) // C2021-026 if the text is grey it's a child field using the parent's value
// we need to clear the child's text box so that it will reset using the new parent's value
if (parentNode != null && (parentNode.InnerText == tb.Text || tb.ForeColor == SystemColors.GrayText))
{ {
tb.Text = ""; tb.Text = "";
break; break;
@ -776,9 +778,11 @@ namespace ctlXMLEditLib
} }
} }
} }
mysavexml=false; // data has been saved, don't allow it again.
DisplayFieldContents((XmlNode) editelem); // to refresh display after saving Parent/Child fields to show default values DisplayFieldContents((XmlNode) editelem); // to refresh display after saving Parent/Child fields to show default values
return(true); // B2021-077 we saved the information. set the need to save flags to false
mysavexml = false; // data has been saved, don't allow it again.
dosaveflag = false;
return (true);
} }
return (false); return (false);
} }
@ -1104,7 +1108,7 @@ namespace ctlXMLEditLib
} }
// get the widths and number of all children of this group box & use this to set the size // get the widths and number of all children of this group box & use this to set the size
// of the groupbox. // of the groupbox.
groupbox.Size = new System.Drawing.Size(Math.Max(55,maxChldWidth + 40), screeny - screenySave + 5);//maxxfortext + 40, maxyfortext + 10); groupbox.Size = new System.Drawing.Size(Math.Max(105,maxChldWidth + 40), screeny - screenySave + 5); // B2021-079 increased the minimum width
chldgrphgt = screeny - screenySave + 5; chldgrphgt = screeny - screenySave + 5;
Controls.Add(groupbox); Controls.Add(groupbox);
if (pcGrpBox == null) if (pcGrpBox == null)