/// <summary> /// Standard constructor initializing the groupbox /// </summary> /// <param name="parentFrame">gui this GroupBox exists in</param> /// <param name="mySubstrate">substrate object which is represented by this grpboxtxt</param> /// <param name="param">substrate parameter which is represented by this grpboxtxt, /// must be referring to a physValue</param> /// <param name="mydelegate">function that is called when txtbox looses focus. can /// check the value on validity</param> /// <param name="xPos">x-coordinate of position of GroupBox</param> /// <param name="yPos">y-coordinate of position of GroupBox</param> /// <param name="helpText">text visualized as help while txtbox has focus</param> /// <param name="width">width of the GroupBox</param> /// <param name="height">height of the GroupBox</param> public GrpBoxPhys(gui_substrate parentFrame, substrate mySubstrate, String param, LeaveDelegate mydelegate, int xPos, int yPos, String helpText, int width, int height) : this() { // save parameters in local fields this.mySubstrate = mySubstrate; this.param = param; this.mydelegate = mydelegate; this.helpText = helpText; parent = parentFrame; // get to be displayed param from substrate physValue myValue = mySubstrate.get_params_of(param); // ToolTip tt = new ToolTip(); // set attributes of this GrpBoxTxt Bounds = new Rectangle(new Point(xPos, yPos), new Size(width, height)); // set attributes of groupbox grpBox.Bounds = new Rectangle(new Point(0, 0), new Size(width, height)); grpBox.Text = myValue.Symbol + ":"; tt.SetToolTip(grpBox, myValue.Label); // set attributes of textbox int cmb_width = 60; // width of combobox txtValue.Bounds = new Rectangle(new Point(6, 19), new Size(width - 4 - cmb_width - 6 - 6, height - 19 - 6)); txtValue.Text = System.Xml.XmlConvert.ToString(myValue.Value); tt.SetToolTip(txtValue, myValue.Label); // set attributes of ComboBox for unit cmbUnit.Bounds = new Rectangle(new Point(width - cmb_width - 6, 18), new Size(cmb_width, height - 18 - 6)); // TODO, hier sollte eine Liste eigefügt werden, welche dem Konstruktur // übergeben wird cmbUnit.Items.Add(myValue.Unit); cmbUnit.SelectedItem = myValue.Unit; tt.SetToolTip(cmbUnit, "unit"); }
/// <summary> /// Standard constructor initializing the groupbox /// </summary> /// <param name="parentFrame">gui this GroupBox exists in</param> /// <param name="mySubstrate">substrate object which is represented by this grpboxtxt</param> /// <param name="param">substrate parameter which is represented by this grpboxtxt</param> /// <param name="mydelegate">function that is called when txtbox looses focus. can /// check the value on validity</param> /// <param name="xPos">x-coordinate of position of GroupBox</param> /// <param name="yPos">y-coordinate of position of GroupBox</param> /// <param name="id_unit">id + unit of physValue</param> /// <param name="label">label of physValue, is the title of the GroupBox</param> /// <param name="helpText">text visualized as help while txtbox has focus</param> /// <param name="width">width of the GroupBox</param> /// <param name="height">height of the GroupBox</param> public GrpBoxTxt(gui_substrate parentFrame, substrate mySubstrate, String param, LeaveDelegate mydelegate, int xPos, int yPos, String id_unit, String label, String helpText, int width, int height) : this() { // save parameters in local fields this.mySubstrate = mySubstrate; this.param = param; this.mydelegate = mydelegate; this.helpText = helpText; parent = parentFrame; // get to be displayed param from substrate String value = mySubstrate.get_param_of_s(param); // ToolTip tt = new ToolTip(); // set attributes of this GrpBoxTxt Bounds = new Rectangle(new Point(xPos, yPos), new Size(width, height)); // set attributes of groupbox grpBox.Bounds = new Rectangle(new Point(0, 0), new Size(width, height)); grpBox.Text = id_unit + ":"; tt.SetToolTip(grpBox, label); // set attributes of txtBox txtValue.Bounds = new Rectangle(new Point(6, 19), new Size(width - 6 - 6, height - 19 - 6)); txtValue.Text = value; tt.SetToolTip(txtValue, label); }
/// <summary> /// Standard constructor initializing the groupbox /// </summary> /// <param name="parentFrame">gui this GroupBox exists in</param> /// <param name="mySubstrate">substrate object which is represented by this grpboxtxt</param> /// <param name="param">substrate parameter which is represented by this grpboxtxt, /// must be referring to a physValue</param> /// <param name="mydelegate">function that is called when txtbox looses focus. can /// check the value on validity</param> /// <param name="xPos">x-coordinate of position of GroupBox</param> /// <param name="yPos">y-coordinate of position of GroupBox</param> /// <param name="helpText">text visualized as help while txtbox has focus</param> public GrpBoxPhys(gui_substrate parentFrame, substrate mySubstrate, String param, LeaveDelegate mydelegate, int xPos, int yPos, String helpText) : this(parentFrame, mySubstrate, param, mydelegate, xPos, yPos, helpText, 120) { }
/// <summary> /// Standard constructor initializing the groupbox /// </summary> /// <param name="parentFrame">gui this GroupBox exists in</param> /// <param name="mySubstrate">substrate object which is represented by this grpboxtxt</param> /// <param name="param">substrate parameter which is represented by this grpboxtxt, /// must be referring to a physValue</param> /// <param name="xPos">x-coordinate of position of GroupBox</param> /// <param name="yPos">y-coordinate of position of GroupBox</param> public GrpBoxPhys(gui_substrate parentFrame, substrate mySubstrate, String param, int xPos, int yPos) : this(parentFrame, mySubstrate, param, checkIfDouble, xPos, yPos, "") { }
/// <summary> /// Standard constructor initializing the groupbox /// with default width and height /// </summary> /// <param name="parentFrame">gui this GroupBox exists in</param> /// <param name="mySubstrate">substrate object which is represented by this grpboxtxt</param> /// <param name="param">substrate parameter which is represented by this grpboxtxt</param> /// <param name="mydelegate">function that is called when txtbox looses focus. can /// check the value on validity</param> /// <param name="xPos">x-coordinate of position of GroupBox</param> /// <param name="yPos">y-coordinate of position of GroupBox</param> /// <param name="id_unit">id + unit of physValue</param> /// <param name="label">label of physValue, is the title of the GroupBox</param> /// <param name="helpText">text visualized as help while txtbox has focus</param> public GrpBoxTxt(gui_substrate parentFrame, substrate mySubstrate, String param, LeaveDelegate mydelegate, int xPos, int yPos, String id_unit, String label, String helpText) : this(parentFrame, mySubstrate, param, mydelegate, xPos, yPos, id_unit, label, helpText, 120) { }