public FormEditText(object verifyValue)
 {
     if (verifyValue != null)
     {
         this.verifyValue = (VerifyValue)verifyValue;
     }
     InitializeComponent();
 }
 private void Hide()
 {
     // release delegate
     verifyCallback    = null;
     okCallback        = null;
     visible           = false;
     forceDelayedClose = false;
     Close();
 }
Exemple #3
0
 /// <summary>
 /// Opens the input dialog
 /// </summary>
 /// <param name='label'>
 /// Label for the text field
 /// </param>
 /// <param name='value'>
 /// Initial value of the text field
 /// </param>
 /// <param name='okCallback'>
 /// Callback that will be invoked if the dialog is closed via ok
 /// </param>
 /// <param name='verifyCallback'>
 /// Callback that will be invoked after the value was changed to check if the ok button is available
 /// </param>
 public static CUTextInputDialog ShowDialog(string label, string value, ValueAvailable okCallback,
                                            VerifyValue verifyCallback)
 {
     if (!visible)
     {
         Instance.Display(label, value, okCallback, verifyCallback);
     }
     return(Instance);
 }
 private void Display(string label, string value, ValueAvailable okCallback, VerifyValue verifyCallback)
 {
     this.label               = label;
     this.value               = value;
     this.okCallback          = okCallback;
     this.verifyCallback      = verifyCallback;
     visible                  = true;
     wasGuiPaintedAtLeastOnce = false;
     forceDelayedClose        = false;
     Validate();
     CenterAt(new Vector2(400, 400));
     ShowPopup();
     Focus();
 }
 private void Hide()
 {
     // release delegate
     verifyCallback = null;
     okCallback = null;
     visible = false;
     forceDelayedClose = false;
     Close();
 }
 private void Display(string label, string value, ValueAvailable okCallback, VerifyValue verifyCallback)
 {
     this.label = label;
     this.value = value;
     this.okCallback = okCallback;
     this.verifyCallback = verifyCallback;
     visible = true;
     wasGuiPaintedAtLeastOnce = false;
     forceDelayedClose = false;
     Validate();
     CenterAt(new Vector2(400, 400));
     ShowPopup();
     Focus();
 }
 /// <summary>
 /// Opens the input dialog
 /// </summary>
 /// <param name='label'>
 /// Label for the text field
 /// </param>
 /// <param name='value'>
 /// Initial value of the text field
 /// </param>
 /// <param name='okCallback'>
 /// Callback that will be invoked if the dialog is closed via ok
 /// </param>
 /// <param name='verifyCallback'>
 /// Callback that will be invoked after the value was changed to check if the ok button is available
 /// </param>
 public static CUTextInputDialog ShowDialog(string label, string value, ValueAvailable okCallback, VerifyValue verifyCallback)
 {
     if (!visible) {
         Instance.Display(label, value, okCallback, verifyCallback);
     }
     return Instance;
 }