/// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     isAwaitingInput = false;
     if (acceptedText != null) {
         if (textField != null) acceptedText(textField.text);
         acceptedText = null;
     }
     Hide();
 }
Example #2
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     label.text                = labelText;
     inputField.text           = text;
     inputField.characterLimit = maxLength;
     m_acceptedText            = acceptedText;
     m_isAwaitingInput         = true;
     Show();
 }
		/// <summary>
		/// Starts the text input field.
		/// </summary>
		/// <param name="labelText">The label text.</param>
		/// <param name="text">The current value to use for the input field.</param>
		/// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
		/// <param name="acceptedText">The delegate to call when accepting text.</param>
		public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText) {
			if (label != null) label.text = labelText;
			if (textField != null) {
				textField.text = text;
				textField.characterLimit = maxLength;
			}
			this.acceptedText = acceptedText;
			Show();
			isAwaitingInput = true;
		}
Example #4
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     isAwaitingInput = false;
     if (acceptedText != null)
     {
         //if (textField != null) acceptedText(textField.text);
         acceptedText = null;
     }
     Hide();
 }
Example #5
0
		/// <summary>
		/// Starts the text input field.
		/// </summary>
		/// <param name="labelText">The label text.</param>
		/// <param name="text">The current value to use for the input field.</param>
		/// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
		/// <param name="acceptedText">The delegate to call when accepting text.</param>
		public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText) {
			Show();
			if (label != null) label.text = labelText;
			if (uiInput != null) {
				uiInput.defaultText = text;
				uiInput.characterLimit = maxLength;
				uiInput.value = text;
				uiInput.isSelected = true;
			}
			this.acceptedText = acceptedText;
		}
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 private void AcceptTextInput()
 {
     Hide();
     if (acceptedText != null)
     {
         if (textField != null)
         {
             acceptedText(textField.text);
         }
         acceptedText = null;
     }
 }
Example #7
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     if (acceptedText != null)
     {
         if (uiInput != null)
         {
             acceptedText(uiInput.value);
         }
         acceptedText = null;
     }
     Hide();
 }
Example #8
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     m_isAwaitingInput = false;
     if (m_acceptedText != null)
     {
         if (inputField != null)
         {
             m_acceptedText(inputField.text);
         }
         m_acceptedText = null;
     }
     Hide();
     onAccept.Invoke();
 }
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     isAwaitingInput = false;
     if (acceptedText != null)
     {
         if (textField != null)
         {
             acceptedText(textField.text);
         }
         acceptedText = null;
     }
     Hide();
     onAccept.Invoke();
 }
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null)
     {
         label.text = labelText;
     }
     if (textField != null)
     {
         textField.text           = text;
         textField.characterLimit = maxLength;
     }
     this.acceptedText = acceptedText;
     Show();
     isAwaitingInput = true;
 }
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 private void AcceptTextInput()
 {
     Hide();
     if (acceptedText != null)
     {
         if (IsKeyCodeReturn(acceptKey))
         {
             textField.text = textField.text.Replace("\n", "");
         }
         if (textField != null)
         {
             acceptedText(textField.text);
         }
         acceptedText = null;
     }
 }
Example #12
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null)
     {
         label.text = labelText;
     }
     if (uiInput != null)
     {
         uiInput.defaultText    = text;
         uiInput.characterLimit = maxLength;
         uiInput.value          = text;
         uiInput.isSelected     = true;
     }
     this.acceptedText = acceptedText;
     Show();
 }
Example #13
0
 /// <summary>
 /// Sets up the text input controls.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null)
     {
         label.text = labelText;
     }
     if (textField != null)
     {
         textField.text      = text;
         textField.maxLength = maxLength;
         textField.TakeFocus();
         ignoreFirstAccept = (acceptKey != KeyCode.None) && Input.GetKeyDown(acceptKey);
         ignoreFirstCancel = (cancelKey != KeyCode.None) && Input.GetKeyDown(cancelKey);
     }
     this.acceptedText = acceptedText;
     Show();
 }
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 private void AcceptTextInput()
 {
     Hide();
     if (acceptedText != null) {
         if (textField != null) acceptedText(textField.text);
         acceptedText = null;
     }
 }
Example #15
0
		/// <summary>
		/// Accepts the text input and calls the accept handler delegate.
		/// </summary>
		public void AcceptTextInput() {
			if (acceptedText != null) {
				if (uiInput != null) acceptedText(uiInput.value);
				acceptedText = null;
			}
			Hide();
		}
Example #16
0
 /// <summary>
 /// Starts the text input field.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null) label.text = labelText;
     if (textField != null) {
         textField.text = text;
         textField.characterLimit = maxLength;
         textField.keyboardType = TouchScreenKeyboardType.EmailAddress;
     }
     this.acceptedText = acceptedText;
     Show();
     isAwaitingInput = true;
     textFieldLabel = labelText;
 }
Example #17
0
 /// <summary>
 /// Accepts the text input and calls the accept handler delegate.
 /// </summary>
 public void AcceptTextInput()
 {
     //Prevent the keyboard from dismissing
     //if(EventSystem.current.alreadySelecting == true) return;
     isAwaitingInput = false;
     Debug.Log ("AcceptTextInput fired!");
     //if(Input.GetButtonDown("Submit")){
         Debug.Log ("Submit fired!");
         if (acceptedText != null) {
             //Debug.Log ("TextField");
             //Debug.Log (textFieldLabel);
             //Debug.Log (textField.text);
             if (textField != null) {
                 //Set the lua text field variables
                 //Debug.Log ("Set the lua variable!");
                 acceptedText(textField.text);
             }
             acceptedText = null;
         }
         Hide();
         onAccept.Invoke();
     //}
 }
 /// <summary>
 /// Sets up the text input controls.
 /// </summary>
 /// <param name="labelText">The label text.</param>
 /// <param name="text">The current value to use for the input field.</param>
 /// <param name="maxLength">Max length, or <c>0</c> for unlimited.</param>
 /// <param name="acceptedText">The delegate to call when accepting text.</param>
 public void StartTextInput(string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 {
     if (label != null) label.text = labelText;
     if (textField != null) {
         textField.text = text;
         textField.maxLength = maxLength;
         textField.TakeFocus();
         ignoreFirstAccept = (acceptKey != KeyCode.None) && Input.GetKeyDown(acceptKey);
         ignoreFirstCancel = (cancelKey != KeyCode.None) && Input.GetKeyDown(cancelKey);
     }
     this.acceptedText = acceptedText;
     Show();
 }