/// <summary> /// Displays Rhino's check list box. /// </summary> /// <param name="title">The dialog title.</param> /// <param name="message">The dialog message.</param> /// <param name="items">A list of items to show.</param> /// <param name="checkState">A list of true/false boolean values.</param> /// <returns>An array or boolean values determining if the user checked the corresponding box. On error, null.</returns> public static bool[] ShowCheckListBox(string title, string message, System.Collections.IList items, System.Collections.Generic.IList <bool> checkState) { bool[] rc = null; if (items != null && items.Count > 0 && checkState != null && checkState.Count == items.Count) { ListBoxForm dlg = new ListBoxForm(title, message, items, checkState); if (dlg.ShowDialog(RhinoApp.MainWindow()) == System.Windows.Forms.DialogResult.OK) { rc = dlg.GetCheckedItemStates(); } } return(rc); }
public static object ShowListBox(string title, string message, System.Collections.IList items, object selectedItem) { object rc = null; if (items != null && items.Count > 0) { ListBoxForm dlg = new ListBoxForm(title, message, items, selectedItem); if (dlg.ShowDialog(RhinoApp.MainWindow()) == System.Windows.Forms.DialogResult.OK) { rc = dlg.SelectedItem(); } } return(rc); }
/// <summary> /// Displays Rhino's check list box. /// </summary> /// <param name="title">The dialog title.</param> /// <param name="message">The dialog message.</param> /// <param name="items">A list of items to show.</param> /// <param name="checkState">A list of true/false boolean values.</param> /// <returns>An array or boolean values determining if the user checked the corresponding box. On error, null.</returns> public static bool[] ShowCheckListBox(string title, string message, System.Collections.IList items, IList<bool> checkState) { bool[] rc = null; if (items != null && items.Count > 0 && checkState != null && checkState.Count == items.Count) { ListBoxForm dlg = new ListBoxForm(title, message, items, checkState); if (dlg.ShowDialog(RhinoApp.MainWindow()) == System.Windows.Forms.DialogResult.OK) rc = dlg.GetCheckedItemStates(); } return rc; }
public static object ShowListBox(string title, string message, System.Collections.IList items, object selectedItem) { object rc = null; if (items != null && items.Count > 0) { ListBoxForm dlg = new ListBoxForm(title, message, items, selectedItem); if (dlg.ShowDialog(RhinoApp.MainWindow()) == System.Windows.Forms.DialogResult.OK) rc = dlg.SelectedItem(); } return rc; }