Updates to DropDownPanel, Baseline, & Controls

This commit is contained in:
2026-08-05 15:16:53 -04:00
parent 6f0fcdded2
commit 6d7d127b63
14 changed files with 356 additions and 453 deletions
@@ -16,15 +16,20 @@ namespace Volian.Controls.Library
private EPFields myEPFields;
private AnnotationConfig MyConfig;
private StepTabRibbon _MyStepTabRibbon;
private Dictionary<string, TextBox> _DicTB;
private Dictionary<string, CheckBox> _DicCheckBox;
private Dictionary<string, ComboBox> _DicComboBox;
private Dictionary<string, ComboBox> _DicSingleRO;
private Dictionary<string, ListBoxMulti> _DicMultiRO;
private readonly StepTabRibbon _MyStepTabRibbon;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, TextBox> _DicTB;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, CheckBox> _DicCheckBox;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, ComboBox> _DicComboBox;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, ComboBox> _DicSingleRO;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<string, ListBoxMulti> _DicMultiRO;
private TablePropertiesControl _TablePropControl;
private string multiseparator = ",";
private readonly string multiseparator = ",";
public frmEPAnnotationDetails(AnnotationInfo currAnn)
{
@@ -58,13 +63,15 @@ namespace Volian.Controls.Library
if (EP.type.ToLower() != "tableinput")
{
Label wlbl = new Label();
wlbl.Text = EP.label;
wlbl.Visible = true;
wlbl.TextAlign = ContentAlignment.MiddleLeft;
wlbl.Anchor = AnchorStyles.Left | AnchorStyles.Top;
wlbl.Width = (8 * MaxCharsInLabel) + 5;
panelEP.Controls.Add(wlbl, 0, panelEP.RowCount - 1);
Label wlbl = new Label
{
Text = EP.label,
Visible = true,
TextAlign = ContentAlignment.MiddleLeft,
Anchor = AnchorStyles.Left | AnchorStyles.Top,
Width = (8 * MaxCharsInLabel) + 5
};
panelEP.Controls.Add(wlbl, 0, panelEP.RowCount - 1);
}
if (EP.type.ToLower() == "text")
@@ -99,9 +106,11 @@ namespace Volian.Controls.Library
}
if (EP.type.ToLower() == "logical")
{
CheckBox cb = new CheckBox();
cb.Text = EP.text;
cb.Visible = true;
CheckBox cb = new CheckBox
{
Text = EP.text,
Visible = true
};
string val = MyConfig.GetValue("EP", EP.name);
cb.Checked = val != null && val != "" && val.ToUpper()[0] == 'Y';
_DicCheckBox.Add(EP.name, cb);
@@ -110,8 +119,10 @@ namespace Volian.Controls.Library
}
if (EP.type.ToLower() == "combo")
{
ComboBox cmb = new ComboBox();
cmb.Visible = true;
ComboBox cmb = new ComboBox
{
Visible = true
};
string tmp = EP.text;
string[] tmps = tmp.Split(",".ToCharArray());
foreach (string t in tmps) cmb.Items.Add(t.Trim());
@@ -124,10 +135,12 @@ namespace Volian.Controls.Library
}
if (EP.type.ToLower() == "rosingle")
{
ComboBox cmb = new ComboBox();
cmb.Visible = true;
ComboBox cmb = new ComboBox
{
Visible = true
};
List<ROListItem> tmps = EP.getROList(currAnn, true);
List<ROListItem> tmps = EP.getROList(currAnn, true);
cmb.DisplayMember = "Text";
cmb.ValueMember = "Value";
cmb.DataSource = tmps;
@@ -156,9 +169,11 @@ namespace Volian.Controls.Library
if (EP.type.ToLower() == "tableinput" && _TablePropControl == null)
{
string val = MyConfig.GetValue("EP", EP.name);
_TablePropControl = new TablePropertiesControl(EP.name, EP.label, val);
_TablePropControl.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
panelEP.Controls.Add(_TablePropControl, 1, panelEP.RowCount - 1);
_TablePropControl = new TablePropertiesControl(EP.name, EP.label, val)
{
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
};
panelEP.Controls.Add(_TablePropControl, 1, panelEP.RowCount - 1);
}