You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/11/25 19:10:39 UTC

[royale-asjs] branch develop updated (9b812c1 -> 5a5cc46)

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

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


    from 9b812c1  how did DateField ever work?
     new 383f819  mvoe to TextInput
     new 5a5cc46  handle selection differently.  Should fix #583

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/royale/spark/components/RadioButton.as    | 54 ++++++++++++++--------
 .../royale/spark/components/RadioButtonGroup.as    | 16 +++----
 .../src/main/royale/spark/components/TextInput.as  | 10 ++++
 .../components/supportClasses/SkinnableTextBase.as |  5 --
 4 files changed, 53 insertions(+), 32 deletions(-)


[royale-asjs] 01/02: mvoe to TextInput

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 383f819ce032299060041a439bdc66f94b9ea18f
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Nov 25 09:52:24 2019 -0800

    mvoe to TextInput
---
 .../SparkRoyale/src/main/royale/spark/components/TextInput.as  | 10 ++++++++++
 .../spark/components/supportClasses/SkinnableTextBase.as       |  5 -----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextInput.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextInput.as
index bc232b8..f67eb83 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextInput.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextInput.as
@@ -330,6 +330,16 @@ public class TextInput extends SkinnableTextBase
     }
     // END
     
+    override public function set maxChars(value:int):void
+    {
+        super.maxChars = value;
+        COMPILE::JS
+        {
+            (element as HTMLInputElement).maxLength = value;
+            //dispatchEvent(new Event('htmlTextChanged'));
+        }  
+    }
+
     COMPILE::JS
 	override protected function createElement():WrappedHTMLElement
 	{
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 4b975f7..daaf95e 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
@@ -1234,11 +1234,6 @@ public class SkinnableTextBase extends SkinnableComponent
             return;
             
         _maxChars = value;
-		COMPILE::JS
-		{
-			(element as HTMLInputElement).maxLength = value;
-			//dispatchEvent(new Event('htmlTextChanged'));
-		}  
     } 
 
     //----------------------------------


[royale-asjs] 02/02: handle selection differently. Should fix #583

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5a5cc462d7c05155b9c1a3c78e00e2baf867a5d3
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Nov 25 11:01:52 2019 -0800

    handle selection differently.  Should fix #583
---
 .../main/royale/spark/components/RadioButton.as    | 54 ++++++++++++++--------
 .../royale/spark/components/RadioButtonGroup.as    | 16 +++----
 2 files changed, 43 insertions(+), 27 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButton.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButton.as
index 7ec51bc..e505f92 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButton.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButton.as
@@ -288,7 +288,6 @@ public class RadioButton extends ToggleButtonBase
             {
                 (rbicon.element as HTMLInputElement).checked = value;
             }
-            group.setSelection(this, false);
         dispatchEvent(new Event("selectedChanged"));
     }    
 
@@ -309,7 +308,7 @@ public class RadioButton extends ToggleButtonBase
      *  @private
      *  Default inital index value
      */
-    //mx_internal var indexNumber:int = 0;
+    mx_internal var indexNumber:int = 0;
     
     /**
      *  @private
@@ -320,7 +319,7 @@ public class RadioButton extends ToggleButtonBase
      *  property, if initially set, is needed when the radio button is readded
      *  to the group.
      */
-    //mx_internal var radioButtonGroup:RadioButtonGroup = null;
+    mx_internal var radioButtonGroup:RadioButtonGroup = null;
      
     //--------------------------------------------------------------------------
     //
@@ -386,10 +385,10 @@ public class RadioButton extends ToggleButtonBase
      *  Spark radio button groups are prefixed with _fx to differentiate the
      *  Halo groups which are stored in the same table.
      */
-    /* private function get autoGroupIndex():String
+    private function get autoGroupIndex():String
     {
         return "_spark_" + groupName;
-    } */
+    }
 
     //----------------------------------
     //  group
@@ -419,7 +418,7 @@ public class RadioButton extends ToggleButtonBase
     public function get group():RadioButtonGroup
     {
         // Debugger asks too soon.
-        /* if (!document)
+        if (!mxmlDocument)
             return _group;
 
         if (!_group)
@@ -431,27 +430,27 @@ public class RadioButton extends ToggleButtonBase
                 var g:RadioButtonGroup;
                 try
                 {
-                    g = RadioButtonGroup(document[groupName]);
+                    g = RadioButtonGroup(mxmlDocument[groupName]);
                 }
                 catch(e:Error)
                 {
                     // Special automaticRadioButtonGroup slot to hold generated
                     // radio button groups.  Shared with halo so prefix
                     // groupName to differentiate.
-                    if (document.automaticRadioButtonGroups &&
-                        document.automaticRadioButtonGroups[autoGroupIndex])
+                    if (mxmlDocument.automaticRadioButtonGroups &&
+                        mxmlDocument.automaticRadioButtonGroups[autoGroupIndex])
                     {
                         g = RadioButtonGroup(
-                            document.automaticRadioButtonGroups[autoGroupIndex]);
+                            mxmlDocument.automaticRadioButtonGroups[autoGroupIndex]);
                     }
                 }
                 if (!g)
                 {
-                    g = new RadioButtonGroup(IFlexDisplayObject(document));
+                    g = new RadioButtonGroup(IFlexDisplayObject(mxmlDocument));
                     
-                    if (!document.automaticRadioButtonGroups)
-                        document.automaticRadioButtonGroups = [];
-                    document.automaticRadioButtonGroups[autoGroupIndex] = g;                        
+                    if (!mxmlDocument.automaticRadioButtonGroups)
+                        mxmlDocument.automaticRadioButtonGroups = [];
+                    mxmlDocument.automaticRadioButtonGroups[autoGroupIndex] = g;                        
                 }
                 else if (!(g is RadioButtonGroup))
                 {
@@ -460,7 +459,7 @@ public class RadioButton extends ToggleButtonBase
 
                 _group = g;
             }
-        } */
+        }
 
         return _group;
     }
@@ -633,7 +632,7 @@ public class RadioButton extends ToggleButtonBase
      *  @private
      *  Update properties before measurement/layout.
      */
-    /* override protected function commitProperties():void
+    /*override protected function commitProperties():void
     {
         if (groupChanged)
         {
@@ -645,7 +644,7 @@ public class RadioButton extends ToggleButtonBase
         // skin state is set, enabled and selected will return the correct values,
         // and the correct skin will be used.
         super.commitProperties();
-    } */
+    }*/
 
     /**
      *  @private
@@ -706,14 +705,14 @@ public class RadioButton extends ToggleButtonBase
      *  Create radio button group if it does not exist
      *  and add the instance to the group. 
      */
-    /* private function addToGroup():RadioButtonGroup
+    private function addToGroup():RadioButtonGroup
     {        
         var g:RadioButtonGroup = group; // Trigger getting the group
         if (g)
             g.addInstance(this);
               
         return g;
-    } */
+    }
 
     /**
      *  @private
@@ -904,6 +903,23 @@ public class RadioButton extends ToggleButtonBase
             }
         }
     } */
+    
+    /**
+     * The method called when added to a parent. The DateField class uses
+     * this opportunity to install additional beads.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     */
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        addToGroup();
+        if (selected)
+            group.setSelection(this, false);
+    }
 }
 
 }
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButtonGroup.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButtonGroup.as
index f3af122..eaa411a 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButtonGroup.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RadioButtonGroup.as
@@ -534,16 +534,16 @@ public class RadioButtonGroup extends EventDispatcher
      *  Add a radio button to the group.  This can be called by
      *  RadioButton or via the addedHandler when applying a state.
      */
-    /* mx_internal function addInstance(instance:RadioButton):void
+    mx_internal function addInstance(instance:RadioButton):void
     {
         // During a state transition, called when rb is removed from 
         // display list.
-        instance.addEventListener(Event.REMOVED, radioButton_removedHandler);
+        //instance.addEventListener(Event.REMOVED, radioButton_removedHandler);
         
         radioButtons.push(instance);
 
 		// Apply group indices in "tab order" or "breadth-first" order.
-        radioButtons.sort(readOrderCompare);
+        //radioButtons.sort(readOrderCompare);
         for (var i:int = 0; i < radioButtons.length; i++)
             radioButtons[i].indexNumber = i;
         
@@ -560,14 +560,14 @@ public class RadioButtonGroup extends EventDispatcher
         instance.invalidateSkinState();
         
         dispatchEvent(new Event("numRadioButtonsChanged"));
-    } */
+    }
 
     /**
      *  @private
      *  Remove a radio button from the group.  This can be called by
      *  RadioButton or via the removedHandler when removing a state.
      */
-    /* private function removeInstance(instance:RadioButton):void
+    private function removeInstance(instance:RadioButton):void
     {
         if (instance)
         {
@@ -585,7 +585,7 @@ public class RadioButtonGroup extends EventDispatcher
                 {
                     // During a state transition, called when rb is added back 
                     // to display list.
-                    instance.addEventListener(Event.ADDED, radioButton_addedHandler);
+                    //instance.addEventListener(Event.ADDED, radioButton_addedHandler);
         
                     // Don't set the group to null.  If this is being removed
                     // because the state changed, the group will be needed
@@ -613,12 +613,12 @@ public class RadioButtonGroup extends EventDispatcher
             if (foundInstance)
                 dispatchEvent(new Event("numRadioButtonsChanged"));
         }
-    } */
+    }
 
     /**
      *  @private
      */
-    public function setSelection(value:RadioButton, fireChange:Boolean = true):void
+    mx_internal function setSelection(value:RadioButton, fireChange:Boolean = true):void
     {
         if (_selection == value)
             return;