You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pu...@apache.org on 2019/12/17 10:31:04 UTC

[royale-asjs] branch develop updated: added displayAsPassword in SkinnableTextBase.as

This is an automated email from the ASF dual-hosted git repository.

pushminakazi pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 8d08fc1  added displayAsPassword in SkinnableTextBase.as
8d08fc1 is described below

commit 8d08fc19fba385e3b7dd2739c3c23719c2689d59
Author: pashminakazi <42...@users.noreply.github.com>
AuthorDate: Tue Dec 17 15:30:53 2019 +0500

    added displayAsPassword in SkinnableTextBase.as
---
 .../components/supportClasses/SkinnableTextBase.as | 79 ++++++++++++++--------
 1 file changed, 49 insertions(+), 30 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
index 8f6f098..c4cc32b 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
@@ -1002,28 +1002,40 @@ public class SkinnableTextBase extends SkinnableComponent
     //----------------------------------
     //  displayAsPassword
     //----------------------------------
-    
-    //[Inspectable(category="General", defaultValue="false")]
+    /**
+     *  @private
+     *  Storage for the displayAsPassword property.
+     */
+    private var _displayAsPassword:Boolean = false;
 
     /**
-     *  @copy flash.text.TextField#displayAsPassword
-     * 
+     *  @private
+     */
+	private var _passwordBead:PasswordInputBead;
+    private var displayAsPasswordChanged:Boolean = false;
+
+    [Bindable("displayAsPasswordChanged")]
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Indicates whether this control is used for entering passwords.
+     *  If <code>true</code>, the field does not display entered text,
+     *  instead, each text character entered into the control
+     *  appears as the  character "&#42;".
+     *
      *  @default false
-     * 
+     *  @tiptext Specifies whether to display '*'
+     *  instead of the actual characters
+     *  @helpid 3197
+     *
      *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Royale 0.9.4
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
-     public function get displayAsPassword():Boolean
+    public function get displayAsPassword():Boolean
     {
-        /* if (textDisplay)
-            return textDisplay.displayAsPassword;
-
-        // want the default to be false
-        var v:* = textDisplayProperties.displayAsPassword
-        return (v === undefined) ? false : v; */
-		return false;
+        return _displayAsPassword;
     }
 
     /**
@@ -1031,21 +1043,28 @@ public class SkinnableTextBase extends SkinnableComponent
      */
     public function set displayAsPassword(value:Boolean):void
     {
-        /* if (textDisplay)
-        {
-            textDisplay.displayAsPassword = value;
-            textDisplayProperties = BitFlagUtil.update(
-                                    uint(textDisplayProperties), 
-                                    DISPLAY_AS_PASSWORD_PROPERTY_FLAG, true);
-        }
-        else
-        {
-            textDisplayProperties.displayAsPassword = value;
-        }
+        if (value == _displayAsPassword)
+            return;
 
-        // Generate an UPDATE_COMPLETE event.
-        invalidateProperties();      */               
-    } 
+        _displayAsPassword = value;
+//        displayAsPasswordChanged = true;
+//
+//        invalidateProperties();
+//        invalidateSize();
+//        invalidateDisplayList();;
+		
+		if (_displayAsPassword && _passwordBead == null) {
+			_passwordBead = new PasswordInputBead();
+			addBead(_passwordBead);
+		}
+		else if (!_displayAsPassword && _passwordBead != null) {
+			removeBead(_passwordBead);
+			_passwordBead = null;
+		}
+
+        dispatchEvent(new Event("displayAsPasswordChanged"));
+    }
+    
 
     //----------------------------------
     //  editable


Re: [royale-asjs] branch develop updated: added displayAsPassword in SkinnableTextBase.as

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Pashmina,

This commit causes fail of build. ->
http://apacheroyaleci2.westus2.cloudapp.azure.com:8080/job/royale-asjs_jsonly/417/console

Thanks,
Piotr

wt., 17 gru 2019 o 11:31 <pu...@apache.org> napisaƂ(a):

> This is an automated email from the ASF dual-hosted git repository.
>
> pushminakazi pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
>
> The following commit(s) were added to refs/heads/develop by this push:
>      new 8d08fc1  added displayAsPassword in SkinnableTextBase.as
> 8d08fc1 is described below
>
> commit 8d08fc19fba385e3b7dd2739c3c23719c2689d59
> Author: pashminakazi <42...@users.noreply.github.com>
> AuthorDate: Tue Dec 17 15:30:53 2019 +0500
>
>     added displayAsPassword in SkinnableTextBase.as
> ---
>  .../components/supportClasses/SkinnableTextBase.as | 79
> ++++++++++++++--------
>  1 file changed, 49 insertions(+), 30 deletions(-)
>
> diff --git
> a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
> b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
> index 8f6f098..c4cc32b 100644
> ---
> a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
> +++
> b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableTextBase.as
> @@ -1002,28 +1002,40 @@ public class SkinnableTextBase extends
> SkinnableComponent
>      //----------------------------------
>      //  displayAsPassword
>      //----------------------------------
> -
> -    //[Inspectable(category="General", defaultValue="false")]
> +    /**
> +     *  @private
> +     *  Storage for the displayAsPassword property.
> +     */
> +    private var _displayAsPassword:Boolean = false;
>
>      /**
> -     *  @copy flash.text.TextField#displayAsPassword
> -     *
> +     *  @private
> +     */
> +       private var _passwordBead:PasswordInputBead;
> +    private var displayAsPasswordChanged:Boolean = false;
> +
> +    [Bindable("displayAsPasswordChanged")]
> +    [Inspectable(category="General", defaultValue="false")]
> +
> +    /**
> +     *  Indicates whether this control is used for entering passwords.
> +     *  If <code>true</code>, the field does not display entered text,
> +     *  instead, each text character entered into the control
> +     *  appears as the  character "&#42;".
> +     *
>       *  @default false
> -     *
> +     *  @tiptext Specifies whether to display '*'
> +     *  instead of the actual characters
> +     *  @helpid 3197
> +     *
>       *  @langversion 3.0
> -     *  @playerversion Flash 10
> -     *  @playerversion AIR 1.5
> -     *  @productversion Royale 0.9.4
> +     *  @playerversion Flash 9
> +     *  @playerversion AIR 1.1
> +     *  @productversion Flex 3
>       */
> -     public function get displayAsPassword():Boolean
> +    public function get displayAsPassword():Boolean
>      {
> -        /* if (textDisplay)
> -            return textDisplay.displayAsPassword;
> -
> -        // want the default to be false
> -        var v:* = textDisplayProperties.displayAsPassword
> -        return (v === undefined) ? false : v; */
> -               return false;
> +        return _displayAsPassword;
>      }
>
>      /**
> @@ -1031,21 +1043,28 @@ public class SkinnableTextBase extends
> SkinnableComponent
>       */
>      public function set displayAsPassword(value:Boolean):void
>      {
> -        /* if (textDisplay)
> -        {
> -            textDisplay.displayAsPassword = value;
> -            textDisplayProperties = BitFlagUtil.update(
> -                                    uint(textDisplayProperties),
> -                                    DISPLAY_AS_PASSWORD_PROPERTY_FLAG,
> true);
> -        }
> -        else
> -        {
> -            textDisplayProperties.displayAsPassword = value;
> -        }
> +        if (value == _displayAsPassword)
> +            return;
>
> -        // Generate an UPDATE_COMPLETE event.
> -        invalidateProperties();      */
> -    }
> +        _displayAsPassword = value;
> +//        displayAsPasswordChanged = true;
> +//
> +//        invalidateProperties();
> +//        invalidateSize();
> +//        invalidateDisplayList();;
> +
> +               if (_displayAsPassword && _passwordBead == null) {
> +                       _passwordBead = new PasswordInputBead();
> +                       addBead(_passwordBead);
> +               }
> +               else if (!_displayAsPassword && _passwordBead != null) {
> +                       removeBead(_passwordBead);
> +                       _passwordBead = null;
> +               }
> +
> +        dispatchEvent(new Event("displayAsPasswordChanged"));
> +    }
> +
>
>      //----------------------------------
>      //  editable
>
>

-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*