示例#1
0
        public override KeyboardMode OnShowMobileKeyboard()
        {
            if (!IsTextInput())
            {
                return(null);
            }

            KeyboardMode result = new KeyboardMode();

            result.Secret = Hidden;

                        #if MOBILE
            if (Type == InputType.Number)
            {
                // Number keyboard:
                result.Type = TouchScreenKeyboardType.NumbersAndPunctuation;
            }
            else if (Type == InputType.Url)
            {
                // Url keyboard:
                result.Type = TouchScreenKeyboardType.URL;
            }
            else if (Type == InputType.Email)
            {
                // Email keyboard:
                result.Type = TouchScreenKeyboardType.EmailAddress;
            }
                        #endif

            return(result);
        }
示例#2
0
        public override KeyboardMode OnShowMobileKeyboard()
        {
            if (!IsTextInput())
            {
                return(null);
            }

            KeyboardMode result = new KeyboardMode();

            result.Secret = Hidden;
            return(result);
        }
示例#3
0
		/// <summary>Handles if the mobile keyboard should get displayed/hidden.</summary>
		/// <param name="mode">The state that defines how the keyboard should open.</param>
		public static bool HandleKeyboard(KeyboardMode mode){
			if(MobileKeyboard!=null){
				MobileKeyboard.active=false;
				MobileKeyboard=null;
			}
			
			if(mode==null){
				return false;
			}else{
				MobileKeyboard=TouchScreenKeyboard.Open(mode.StartText,mode.Type,Autocorrect,mode.Multiline,mode.Secret);
				KeyboardText=null;
				return true;
			}
		}
示例#4
0
        public override KeyboardMode OnShowMobileKeyboard()
        {
            KeyboardMode result = new KeyboardMode();

            return(result);
        }
示例#5
0
		public override KeyboardMode OnShowMobileKeyboard(){
			if(!IsTextInput()){
				return null;
			}
			
			KeyboardMode result=new KeyboardMode();
			result.Secret=Hidden;
			return result;
		}
示例#6
0
        /// <summary>Focuses this element so it receives events such as keypresses.</summary>
        public void focus()
        {
            HtmlDocument doc = htmlDocument;

            if (doc.activeElement == this)
            {
                return;
            }

            // Focus out first:
            FocusEvent fe = new FocusEvent("focusout");

            // It's trusted but doesn't bubble:
            fe.SetTrusted(false);
            fe.focusing      = this;
            fe.relatedTarget = this;

            if (doc.activeElement != null)
            {
                if (!doc.activeElement.dispatchEvent(fe))
                {
                    return;
                }
            }

            // Focus in next:
            fe.Reset();
            fe.EventType     = "focusin";
            fe.relatedTarget = doc.activeElement;

            if (!dispatchEvent(fe))
            {
                return;
            }

            // Blur next:
            fe.Reset();
            fe.relatedTarget = null;
            fe.EventType     = "blur";

            PowerUI.Input.LastFocusedDocument = doc;

            if (doc.activeElement != null)
            {
                (doc.activeElement as HtmlElement).Unfocus(fe);
            }

            doc.activeElement = this;

            // Update local style:
            Style.Computed.RefreshLocal();

                        #if MOBILE
            // Should we pop up the mobile keyboard?
            KeyboardMode mobile = OnShowMobileKeyboard();
            if (Input.HandleKeyboard(mobile))
            {
                Input.KeyboardText = value;
            }
                        #endif

            // Reset so we can recycle it:
            fe.Reset();
            fe.EventType = "focus";

            // Dispatch and check if it got cancelled:
            if (dispatchEvent(fe))
            {
                // Run the default for this element:
                OnFocusEvent(fe);
            }
        }
示例#7
0
		/// <summary>Handles if the mobile keyboard should get displayed/hidden.</summary>
		/// <param name="mode">The state that defines how the keyboard should open.</param>
		public static bool HandleKeyboard(KeyboardMode mode){
			if(MobileKeyboard!=null){
				MobileKeyboard.active=false;
				MobileKeyboard=null;
			}
			
			if(mode==null){
				return false;
			}else{
				MobileKeyboard=TouchScreenKeyboard.Open(mode.StartText,mode.Type,Autocorrect,mode.Multiline,mode.Secret);
				KeyboardText=null;
				return true;
			}
		}
		public override KeyboardMode OnShowMobileKeyboard(){
			KeyboardMode result=new KeyboardMode();
			return result;
		}