C2021-019: Override Watermark Text and Color

This commit is contained in:
2021-07-06 15:16:40 +00:00
parent aa9c2574bf
commit a3f89c5fa0
10 changed files with 135 additions and 12 deletions

View File

@@ -16,11 +16,13 @@ namespace VEPROMS
private StepTabRibbon _MyStepTabRibbon;
private Dictionary<string, StepRTB> _DicStepRtb;
private Dictionary<string, CheckBox> _DicCheckBox;
private Dictionary<string, ComboBox> _DicComboBox;
public frmPSI(ProcedureInfo pi)
{
InitializeComponent();
_DicStepRtb = new Dictionary<string, StepRTB>();
_DicCheckBox = new Dictionary<string, CheckBox>();
_DicComboBox = new Dictionary<string, ComboBox>();
InitializeSpecificControls(pi);
_MyStepTabRibbon = new StepTabRibbon();
}
@@ -92,6 +94,23 @@ namespace VEPROMS
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
}
// C2021-019: override of watermark text/color - provide support for combo box in PSI dialog
if (fld.type.ToLower() == "combo")
{
ComboBox cmb = new ComboBox();
_DicComboBox.Add(fld.name, cmb);
cmb.Location = new Point((int)fld.x * 2, (int)fld.y * 2);
cmb.Visible = true;
cmb.Width = (int)fld.width * 2;
string tmp = fld.text;
string[] tmps = tmp.Split(",".ToCharArray());
foreach (string t in tmps) cmb.Items.Add(t);
string val = procConfig.GetValue("PSI", fld.name);
if (val != null && val != "") cmb.SelectedItem = val;
this.panelPSI.Controls.Add(cmb);
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
}
}
if (maxx > xB4Scroll)
{
@@ -163,6 +182,18 @@ namespace VEPROMS
procConfig.SetValue("PSI", fld.name, newval);
}
}
// C2021-019: override of watermark text/color - save combo box selection
else if (fld.type.ToLower() == "combo")
{
ComboBox cmbcur = _DicComboBox[fld.name];
string newval = cmbcur.Text;
string oldval = procConfig.GetValue("PSI", fld.name);
if (newval != oldval)
{
isDirty = true;
procConfig.SetValue("PSI", fld.name, newval);
}
}
}
if (isDirty)
{