public FGLRadioFieldWidget(AubitDesktop.Xml.XMLForm.FormField ffx, AubitDesktop.Xml.XMLForm.RipRADIO cbox, string config, int index, AubitDesktop.Xml.XMLForm.Matrix ma) { AubitDesktop.Xml.XMLForm.Radio cnew; cnew = new AubitDesktop.Xml.XMLForm.Radio(); cnew.action = cbox.action; cnew.autoNext = cbox.autoNext; cnew.comments = cbox.comments; cnew.config = cbox.config; cnew.format = cbox.format; cnew.gridWidth = cbox.gridWidth; cnew.posX = cbox.posX; cnew.posY = cbox.posY; cnew.shift = cbox.shift; cnew.width = cbox.width; cnew.pixelHeight = cbox.pixelHeight; cnew.pixelWidth = cbox.pixelWidth; List <string> items = FGLUtils.splitConfig(config); if (items.Count == 0) { cnew.Items = new AubitDesktop.Xml.XMLForm.Item[0]; } else { int b = 0; cnew.Items = new AubitDesktop.Xml.XMLForm.Item[(items.Count + 1) / 2]; for (int a = 0; a < cnew.Items.Length; a++) { cnew.Items[a] = new AubitDesktop.Xml.XMLForm.Item(); cnew.Items[a].name = items[b++]; if (b < items.Count) { cnew.Items[a].text = items[b++]; } } } makeRadio(ffx, cnew, config, index, ma); }
private void makeRadio(AubitDesktop.Xml.XMLForm.FormField ffx, AubitDesktop.Xml.XMLForm.Radio cbox, string config, int index, AubitDesktop.Xml.XMLForm.Matrix ma) { ATTRIB a; a = createAttribForWidget(ffx); //if (ffx.notNull != null && ffx.notNull == "1") notNull = true; //else notNull = false; if (cbox.comments != null) { a.ATTRIB_COMMENTS = new ATTRIB_COMMENTS(); a.ATTRIB_COMMENTS.Text = cbox.comments; } createRadioButtonWidget(a, ma, Convert.ToInt32(cbox.posY), index, Convert.ToInt32(cbox.posX), Convert.ToInt32(cbox.gridWidth), "", config, -1, ffx.sqlTabName + "." + ffx.colName, cbox.action, Convert.ToInt32(ffx.fieldId), ffx.include, cbox); adjustDisplayPropertiesForContext(); }
private void createRadioButtonWidget(ATTRIB thisAttribute, AubitDesktop.Xml.XMLForm.Matrix ma, int row, int index, int column, int columns, string widget, string config, int id, string tabcol, string action, int attributeNo, string incl, AubitDesktop.Xml.XMLForm.Radio r) { this.SetWidget(thisAttribute, ma, row, index, column, 1, columns, widget, config, id, tabcol, action, attributeNo, incl); int minWidth = 0; p = new FlowLayoutPanel(); p.FlowDirection = FlowDirection.TopDown; p.AutoSize = true; rbFieldWidget = new RadioButton[r.Items.Length]; strValues = new string[r.Items.Length]; if (r.Items.Length > 0) { for (int a = 0; a < r.Items.Length; a++) { strValues[a] = r.Items[a].name; RadioButton rb = new RadioButton(); if (r.Items[a].text != "-") { rb.Text = r.Items[a].text; } rbFieldWidget[a] = rb; p.Controls.Add(rb); rb.AutoSize = true; if (rb.Width > minWidth) { minWidth = rb.Width; } rb.Visible = true; rb.TabStop = true; rb.Enabled = true; } } SizeControl(ma, index, p); // p.BackColor = Color.Red; p.Visible = true; p.MinimumSize = new Size(minWidth, rbFieldWidget[0].Height * r.Items.Length); // p.AutoSize = true; p.CausesValidation = true; // p.Validating += new System.ComponentModel.CancelEventHandler(t_Validating); p.Enter += new EventHandler(t_GotFocus); p.TabStop = true; this.id = id; }
public FGLRadioFieldWidget(AubitDesktop.Xml.XMLForm.FormField ffx, AubitDesktop.Xml.XMLForm.Radio cbox, string config, int index, AubitDesktop.Xml.XMLForm.Matrix ma) { makeRadio(ffx, cbox, config, index, ma); setPixelSize(cbox.pixelWidth, cbox.pixelHeight); }