Dialogs

public static class Dialogs

Methods

KillSplash

#Since v5.0
public static void KillSplash()
Destroy the splash screen if it is being displayed.

SetCustomColorDialog

#ExampleSince v5.0
public static void SetCustomColorDialog(EventHandler<GetColorEventArgs> handler)
handler (EventHandler<GetColorEventArgs>)

ShowAboutDialog

#Since v6.0
public static void ShowAboutDialog(bool forceSimpleDialog)
forceSimpleDialog (bool)

ShowCheckListBox

#Since v5.0
public static bool[] ShowCheckListBox(string title, string message, IList items, IList<bool> checkState)
Displays Rhino's check list box.
title (string)The dialog title.
message (string)The dialog message.
items (IList)A list of items to show.
checkState (IList<bool>)A list of true/false boolean values.
An array or boolean values determining if the user checked the corresponding box. On error, null.

ShowColorDialog

#Since v5.0 Obsolete v6.0
public static bool ShowColorDialog(IWin32Window parent, ref Color4f color, bool allowAlpha)
obsoleteUse ShowColorDialog(object parent, ref Color4f color, bool allowAlpha)
Displays the standard modal color picker dialog for floating point colors.
parent (IWin32Window)Parent window for this dialog, should always pass this if calling from a form or user control.
color (ref Color4f)The initial color to set the picker to and also accepts the user's choice.
allowAlpha (bool)Specifies if the color picker should allow changes to the alpha channel or not.
true if a color was picked, false if the user canceled the picker dialog.

ShowColorDialog

#Since v6.0
public static bool ShowColorDialog(object parent, ref Color4f color, bool allowAlpha, NamedColorList namedColorList, OnColorChangedEvent colorCallback)
Displays the standard modal color picker dialog for floating point colors.
parent (object)Parent window for this dialog, should always pass this if calling from a form or user control.
color (ref Color4f)The initial color to set the picker to and also accepts the user's choice.
allowAlpha (bool)Specifies if the color picker should allow changes to the alpha channel or not.
namedColorList (NamedColorList)If not null and contains at least one named color this list will replace the standard Rhino Color list displayed by the rhino color dialog.
colorCallback (Dialogs.OnColorChangedEvent)May be optionally passed to ShowColorDialog and will get called when the color value changes in the color dialog.
true if a color was picked, false if the user canceled the picker dialog.

ShowColorDialog

#Since v6.0
public static bool ShowColorDialog(object parent, ref Color4f color, bool allowAlpha, OnColorChangedEvent colorCallback)
Displays the standard modal color picker dialog for floating point colors.
parent (object)Parent window for this dialog, should always pass this if calling from a form or user control.
color (ref Color4f)The initial color to set the picker to and also accepts the user's choice.
allowAlpha (bool)Specifies if the color picker should allow changes to the alpha channel or not.
colorCallback (Dialogs.OnColorChangedEvent)May be optionally passed to ShowColorDialog and will get called when the color value changes in the color dialog.
true if a color was picked, false if the user canceled the picker dialog.

ShowColorDialog

#Since v6.0
public static bool ShowColorDialog(object parent, ref Color4f color, bool allowAlpha)
Displays the standard modal color picker dialog for floating point colors.
parent (object)Parent window for this dialog, should always pass this if calling from a form or user control.
color (ref Color4f)The initial color to set the picker to and also accepts the user's choice.
allowAlpha (bool)Specifies if the color picker should allow changes to the alpha channel or not.
true if a color was picked, false if the user canceled the picker dialog.

ShowColorDialog

#Since v5.0
public static bool ShowColorDialog(ref Color color, bool includeButtonColors, string dialogTitle, NamedColorList namedColorList)
Display Rhino's color selection dialog.
color (ref Color)[in/out] Default color for dialog, and will receive new color if function returns true.
includeButtonColors (bool)Display button face and text options at top of named color list.
dialogTitle (string)The title of the dialog.
namedColorList (NamedColorList)If not null and contains one or more named colors the Rhino color dialog named color list will be replaces with this list.
true if the color changed. false if the color has not changed or the user pressed cancel.

ShowColorDialog

#Since v5.0
public static bool ShowColorDialog(ref Color color, bool includeButtonColors, string dialogTitle)
Display Rhino's color selection dialog.
color (ref Color)[in/out] Default color for dialog, and will receive new color if function returns true.
includeButtonColors (bool)Display button face and text options at top of named color list.
dialogTitle (string)The title of the dialog.
true if the color changed. false if the color has not changed or the user pressed cancel.

ShowColorDialog

#ExampleSince v5.0
public static bool ShowColorDialog(ref Color color)
Display Rhino's color selection dialog.
color (ref Color)[in/out] Default color for dialog, and will receive new color if function returns true.
true if the color changed. false if the color has not changed or the user pressed cancel.

ShowColorDialog

#Since v5.0
public static bool ShowColorDialog(ref Color4f color, bool allowAlpha)
Displays the standard modal color picker dialog for floating point colors.
color (ref Color4f)The initial color to set the picker to and also accepts the user's choice.
allowAlpha (bool)Specifies if the color picker should allow changes to the alpha channel or not.
true if a color was picked, false if the user canceled the picker dialog.

ShowComboListBox

#Since v5.0
public static object ShowComboListBox(string title, string message, IList items)
Displays Rhino's combo list box.
title (string)The dialog title.
message (string)The dialog message.
items (IList)A list of items to show.

selected item.

null if the user canceled.

ShowContextMenu

#Since v5.0
public static int ShowContextMenu(IEnumerable<string> items, Point screenPoint, IEnumerable<int> modes)
Creates an ETO ContextMenu from an array of strings. Use the modes array to enable/disable menu items
items (IEnumerable<string>)
screenPoint (Point)
modes (IEnumerable<int>)

ShowEditBox

#Since v5.0
public static bool ShowEditBox(string title, string message, string defaultText, bool multiline, out string text)
Displays Rhino's string edit box.
title (string)The dialog title.
message (string)The dialog message.
defaultText (string)The default text.
multiline (bool)Set true for multi line editing.
text (out string)The modified text.
true of OK was clicked, false otherwise.

ShowLayerMaterialDialog

#Since v8.0
public static bool ShowLayerMaterialDialog(RhinoDoc doc, IEnumerable<int> layerIndices)
Show a modal dialog to edit the material in the layer specified in layerIndices.
doc (RhinoDoc)Rhino document
layerIndices (IEnumerable<int>)true if the new layer button will be visible.
True if the dialog was closed with the OK button. False if the dialog was closed with escape.

ShowLineTypes

#Since v8.0
public static Guid ShowLineTypes(string title, string message, RhinoDoc doc, Guid selectedLineTypeId)
title (string)
message (string)
doc (RhinoDoc)
selectedLineTypeId (Guid)

ShowLineTypes

#Since v6.7
public static object ShowLineTypes(string title, string message, RhinoDoc doc)
Displays Rhino's LineType list box.
title (string)The dialog title.
message (string)The dialog message.
doc (RhinoDoc)The active document.
The id of the selected item if successful, null on cancel.

ShowListBox

#Since v5.0
public static object ShowListBox(string title, string message, IList items, object selectedItem)
Displays Rhino's list box.
title (string)The dialog title.
message (string)The dialog message.
items (IList)A list of items to show.
selectedItem (object)The item to preselect.
The selected item if successful, null on cancel.

ShowListBox

#Since v5.0
public static object ShowListBox(string title, string message, IList items)
Displays Rhino's list box.
title (string)The dialog title.
message (string)The dialog message.
items (IList)A list of items to show.
The selected item if successful, null on cancel.

ShowMessage

#Since v6.0
public static ShowMessageResult ShowMessage(object parent, string message, string title, ShowMessageButton buttons, ShowMessageIcon icon, ShowMessageDefaultButton defaultButton, ShowMessageOptions options, ShowMessageMode mode)
Same as System.Windows.Forms.MessageBox.Show but using a message box tailored to Rhino.
parent (object)Parent window
message (string)Message box text content.
title (string)Message box title text.
buttons (ShowMessageButton)Which buttons to display in the message box.
icon (ShowMessageIcon)Which icon to display in the message box.
defaultButton (ShowMessageDefaultButton)Which button is the default button.
options (ShowMessageOptions)Additional message box options.
mode (ShowMessageMode)The modality of the message box.
One of the ShowMessageBoxResult values.

ShowMessage

#Since v6.0
public static ShowMessageResult ShowMessage(string message, string title, ShowMessageButton buttons, ShowMessageIcon icon)
Same as System.Windows.Forms.MessageBox.Show but using a message box tailored to Rhino.
message (string)Message box text content.
title (string)Message box title text.
buttons (ShowMessageButton)Which buttons to display in the message box.
icon (ShowMessageIcon)Which icon to display in the message box.
One of the ShowMessageBoxResult values.

ShowMessage

#Since v6.0
public static ShowMessageResult ShowMessage(string message, string title)
Same as System.Windows.Forms.MessageBox.Show but using a message box tailored to Rhino.
message (string)Message box text content.
title (string)Message box title text.
One of the ShowMessageBoxResult values.

ShowMessageBox

#Since v5.0 Obsolete v6.0
[Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public static DialogResult ShowMessageBox(string message, string title, MessageBoxButtons buttons, MessageBoxIcon icon)
obsoleteUse ShowMessage
Same as System.Windows.Forms.MessageBox.Show but using a message box tailored to Rhino.
message (string)
title (string)
buttons (MessageBoxButtons)
icon (MessageBoxIcon)

ShowMessageBox

#Since v5.0 Obsolete v6.0
[Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public static DialogResult ShowMessageBox(string message, string title)
obsoleteUse ShowMessage
Same as System.Windows.Forms.MessageBox.Show but using a message box tailored to Rhino.
message (string)
title (string)

ShowMultiListBox

#Since v5.12
public static string[] ShowMultiListBox(string title, string message, IList<string> items, IList<string> defaults = null)
Displays Rhino's multiple selection list box.
title (string)The dialog title.
message (string)The dialog message.
items (IList<string>)A list of items to show.
defaults (IList<string> = null)The items to preselect.
The selected items if successful, null on cancel.

ShowNumberBox

#Since v5.0
public static bool ShowNumberBox(string title, string message, ref double number, double minimum, double maximum)
Displays Rhino's number edit box.
title (string)The dialog title.
message (string)The dialog message.
number (ref double)The default and return value.
minimum (double)The minimum allowable value.
maximum (double)The maximum allowable value.
true of OK was clicked, false otherwise.

ShowNumberBox

#Since v5.0
public static bool ShowNumberBox(string title, string message, ref double number)
Displays Rhino's number edit box.
title (string)The dialog title.
message (string)The dialog message.
number (ref double)The default and return value.
true of OK was clicked, false otherwise.

ShowPrintWidths

#Since v8.0
public static double ShowPrintWidths(string title, string message, double selectedWidth)
Shows the print widths dialogs
title (string)
message (string)
selectedWidth (double)
The selected print width

ShowPrintWidths

#Since v8.0
public static double ShowPrintWidths(string title, string message)
Shows the print widths dialogs
title (string)
message (string)
The selected print width

ShowPropertyListBox

#Since v5.0
public static string[] ShowPropertyListBox(string title, string message, IList items, IList<string> values)
Displays Rhino's property list box.
title (string)The dialog title.
message (string)The dialog message.
items (IList)A list of property names.
values (IList<string>)A list of property values.
A list of property values if successful, null otherwise.

ShowPropertyListBox

#Since v8.0
public static string[] ShowPropertyListBox(string title, string message, List<KeyValuePair<string, string>> items)
Displays Rhino's property list box.
title (string)The dialog title.
message (string)The dialog message.
items (List<KeyValuePair<string, string>>)A list of key value pairs
A list of property values if successful, null otherwise.

ShowSelectLayerDialog

#Since v5.0
public static bool ShowSelectLayerDialog(ref int layerIndex, string dialogTitle, bool showNewLayerButton, bool showSetCurrentButton, ref bool initialSetCurrentState)
Displays Rhino's single layer selection dialog.
layerIndex (ref int)Initial layer for the dialog, and will receive selected layer if function returns DialogResult.OK.
dialogTitle (string)The dialog title.
showNewLayerButton (bool)true if the new layer button will be visible.
showSetCurrentButton (bool)true if the set current button will be visible.
initialSetCurrentState (ref bool)true if the current state will be initially set.
True if the dialog was closed with the OK button. False if the dialog was closed with escape.

ShowSelectLinetypeDialog

#Since v6.0
public static bool ShowSelectLinetypeDialog(ref int linetypeIndex, bool displayByLayer)
Displays Rhino's single linetype selection dialog.
linetypeIndex (ref int)Initial linetype for the dialog, and will receive selected linetype if function returns true.
displayByLayer (bool)Displays the "ByLayer" linetype in the list. Defaults to false.
True if the dialog was closed with the OK button. False if the dialog was closed with escape.

ShowSelectMultipleLayersDialog

#Since v5.9
public static bool ShowSelectMultipleLayersDialog(IEnumerable<int> defaultLayerIndices, string dialogTitle, bool showNewLayerButton, out int[] layerIndices)
defaultLayerIndices (IEnumerable<int>)
dialogTitle (string)
showNewLayerButton (bool)
layerIndices (out int[])
True if the dialog was closed with the OK button. False if the dialog was closed with escape.

ShowSemiModal

#Since v5.0 Obsolete v6.0
[Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] public static DialogResult ShowSemiModal(Form form)
Show a windows form that is modal in the sense that this function does not return until the form is closed, but also allows for interaction with other elements of the Rhino user interface.
form (Form)The form must have buttons that are assigned to the "AcceptButton" and "CancelButton".
One of the System.Windows.Forms.DialogResult values.

ShowSunDialog

#Since v6.0
public static bool ShowSunDialog(Sun sun)
Show the modal sun dialog.
sun (Sun)
Returns true if the user clicked OK, or false if the user canceled.

ShowTextDialog

#Since v5.0
public static void ShowTextDialog(string message, string title)
Display a text dialog similar to the dialog used for the "What" command.
message (string)Text to display as the message content.
title (string)Test to display as the form title.