Esempio n. 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);
            }
Esempio n. 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);
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
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;
 }