コード例 #1
0
            public static System.Windows.Forms.DialogResult ShowNumberBox(string title, string message, ref double number, double minimum, double maximum)
            {
                string defaultText = String.Empty;

                if (number != RhinoMath.UnsetValue)
                {
                    defaultText = number.ToString();
                }
                StringBoxForm dlg = new StringBoxForm(title, message, defaultText);

                dlg.SetAsNumberInput(minimum, maximum);
                System.Windows.Forms.DialogResult rc = dlg.ShowDialog(RhinoApp.MainWindow());
                if (rc == System.Windows.Forms.DialogResult.OK)
                {
                    string text = dlg.GetText();
                    double.TryParse(text, out number);
                }
                return(rc);
            }
コード例 #2
0
 public static System.Windows.Forms.DialogResult ShowEditBox(string title, string message, string defaultText, bool multiline, out string text)
 {
     text = String.Empty;
     System.Windows.Forms.DialogResult rc;
     if (multiline)
     {
         EditBoxForm dlg = new EditBoxForm(title, message, defaultText);
         rc = dlg.ShowDialog(RhinoApp.MainWindow());
         if (rc == System.Windows.Forms.DialogResult.OK)
         {
             text = dlg.GetText();
         }
     }
     else
     {
         StringBoxForm dlg = new StringBoxForm(title, message, defaultText);
         rc = dlg.ShowDialog(RhinoApp.MainWindow());
         if (rc == System.Windows.Forms.DialogResult.OK)
         {
             text = dlg.GetText();
         }
     }
     return(rc);
 }
コード例 #3
0
ファイル: Dialogs.cs プロジェクト: jackieyin2015/rhinocommon
 public static System.Windows.Forms.DialogResult ShowNumberBox(string title, string message, ref double number, double minimum, double maximum)
 {
   string default_text = String.Empty;
   if (number != RhinoMath.UnsetValue)
     default_text = number.ToString();
   StringBoxForm dlg = new StringBoxForm(title, message, default_text);
   dlg.SetAsNumberInput(minimum, maximum);
   System.Windows.Forms.DialogResult rc = dlg.ShowDialog(RhinoApp.MainWindow());
   if (rc == System.Windows.Forms.DialogResult.OK)
   {
     string text = dlg.GetText();
     double.TryParse(text, out number);
   }
   return rc;
 }
コード例 #4
0
ファイル: Dialogs.cs プロジェクト: jackieyin2015/rhinocommon
 public static System.Windows.Forms.DialogResult ShowEditBox(string title, string message, string defaultText, bool multiline, out string text)
 {
   text = String.Empty;
   System.Windows.Forms.DialogResult rc;
   if (multiline)
   {
     EditBoxForm dlg = new EditBoxForm(title, message, defaultText);
     rc = dlg.ShowDialog(RhinoApp.MainWindow());
     if (rc == System.Windows.Forms.DialogResult.OK)
       text = dlg.GetText();
   }
   else
   {
     StringBoxForm dlg = new StringBoxForm(title, message, defaultText);
     rc = dlg.ShowDialog(RhinoApp.MainWindow());
     if (rc == System.Windows.Forms.DialogResult.OK)
       text = dlg.GetText();
   }
   return rc;
 }