/* VISIBILITY RELATIONS */ // *** Visibility ComboBox Management *** // // When a Combobox has relation visibility, the one that defines if // the control related is visible is the 0 index item. If the item // selected is 0, then means that related controls are not visible. // If the item selected is >0 then they are visible. public static void ComboBoxVisibility(object sender, EventArgs e) { CComboBox control = sender as CComboBox; //SetComboboxVisibility(control); foreach (ICustomControl related in control.cd.RelatedVisibility) { if (control.SelectedIndex > 0 || Model.getInstance().progMode) { related.cd.Visible = true; } else if (control.SelectedIndex <= 0) { if (related is CCheckBox || related is CComboBox) { SetDependentVisibility(related); } related.cd.Visible = false; } if (!related.cd.operatorVisibility && !Model.getInstance().progMode) { related.cd.Visible = false; } } }
public void comboBoxToolStripMenuItem_Click(object sender, EventArgs e) { CComboBox comboBox = ControlFactory.BuildCComboBox(model.currentClickedControl); editor = new ControlEditor(); editor.Show(comboBox); }
// *** Coupled ComboBox Management *** // When a combo box is coupled with another one, the // index of those must change at the same time to the same value. public static void ComboBoxCoupled(object sender, EventArgs e) { CComboBox control = sender as CComboBox; foreach (CComboBox related in control.cd.CoupledControls.Where(r => r.cd.Type == "CComboBox")) { if (related.Items.Count == control.Items.Count) { (related as CComboBox).SelectedIndex = control.SelectedIndex; } } }