DialogsSetCustomColorDialog Method |
[Missing <summary> documentation for "M:Rhino.UI.Dialogs.SetCustomColorDialog(System.EventHandler{Rhino.UI.GetColorEventArgs})"]
Namespace: Rhino.UI
[Missing <param name="handler"/> documentation for "M:Rhino.UI.Dialogs.SetCustomColorDialog(System.EventHandler{Rhino.UI.GetColorEventArgs})"]
using Rhino; using Rhino.Commands; using Rhino.UI; using System.Windows.Forms; namespace examples_cs { public class ReplaceColorDialogCommand : Command { public override string EnglishName { get { return "csReplaceColorDialog"; } } private ColorDialog m_dlg = null; protected override Result RunCommand(RhinoDoc doc, RunMode mode) { Dialogs.SetCustomColorDialog(OnSetCustomColorDialog); return Result.Success; } void OnSetCustomColorDialog(object sender, GetColorEventArgs e) { m_dlg = new ColorDialog(); if (m_dlg.ShowDialog(null) == DialogResult.OK) { var c = m_dlg.Color; e.SelectedColor = c; } } } }
from Rhino import * from Rhino.Commands import * from Rhino.UI import * from System.Windows.Forms import * m_dlg = None def RunCommand(): Dialogs.SetCustomColorDialog(OnSetCustomColorDialog) return Result.Success def OnSetCustomColorDialog(sender, e): m_dlg = ColorDialog() if m_dlg.ShowDialog(None) == DialogResult.OK: c = m_dlg.Color e.SelectedColor = c if __name__ == "__main__": RunCommand()