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

carlosrovira 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 902d600  fix some issues in jewel radiobutton
     new d7778b9  Merge branch 'develop' of 
https://github.com/apache/royale-asjs into develop
902d600 is described below

commit 902d6002a269c002918b2000ea248dac31cdd022
Author: Carlos Rovira <[email protected]>
AuthorDate: Wed May 2 16:06:41 2018 +0200

    fix some issues in jewel radiobutton
---
 .../royale/org/apache/royale/jewel/RadioButton.as  | 87 +++++++++++++---------
 1 file changed, 53 insertions(+), 34 deletions(-)

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
index e043f6c..4874d10 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
@@ -35,7 +35,6 @@ package org.apache.royale.jewel
         import org.apache.royale.core.UIBase;
         import org.apache.royale.core.WrappedHTMLElement;
         import org.apache.royale.html.util.addElementToWrapper;
-        import org.apache.royale.utils.cssclasslist.addStyles;
     }
 
     //--------------------------------------
@@ -48,7 +47,7 @@ package org.apache.royale.jewel
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
+     *  @productversion Royale 0.9.3
      */
        [Event(name="click", type="org.apache.royale.events.MouseEvent")]
 
@@ -58,14 +57,16 @@ package org.apache.royale.jewel
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
+     *  @productversion Royale 0.9.3
      */
     [Event(name="change", type="org.apache.royale.events.Event")]
 
+    
+
     /**
-     *  The Jewel radio button component is an enhanced version of the
-     *  standard HTML <input type="radio">, or "radio button" element. A radio 
button
-     *  consists of a small circle and, typically, text that clearly 
communicates a
+     *  The Jewel radio button component in SWF is a specialized button.
+     * 
+     *  A radio button consists of a small circle and, typically, text that 
clearly communicates a
      *  condition that will be set when the user clicks or touches it. Radio 
buttons
      *  always appear in groups of two or more and, while they can be 
individually
      *  selected, can only be deselected by selecting a different radio button 
in the
@@ -74,7 +75,7 @@ package org.apache.royale.jewel
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
+     *  @productversion Royale 0.9.3
      */
     COMPILE::SWF
        public class RadioButton extends UIButtonBase implements IStrand
@@ -85,17 +86,21 @@ package org.apache.royale.jewel
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.8
+                *  @productversion Royale 0.9.3
                 */
                public function RadioButton()
                {
             super();
 
+            classSelectorList = new ClassSelectorList(this);
+
             typeNames = "jewel radiobutton";
 
                        
addEventListener(org.apache.royale.events.MouseEvent.CLICK, 
internalMouseHandler);
                }
 
+        protected var classSelectorList:ClassSelectorList;
+
                protected static var dict:Dictionary = new Dictionary(true);
 
                /**
@@ -104,7 +109,7 @@ package org.apache.royale.jewel
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.8
+                *  @productversion Royale 0.9.3
                 */
                public function get groupName() : String
                {
@@ -121,7 +126,7 @@ package org.apache.royale.jewel
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.8
+                *  @productversion Royale 0.9.3
                 */
                public function get text():String
                {
@@ -140,7 +145,7 @@ package org.apache.royale.jewel
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.8
+                *  @productversion Royale 0.9.3
                 */
                public function get selected():Boolean
                {
@@ -170,7 +175,7 @@ package org.apache.royale.jewel
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.8
+                *  @productversion Royale 0.9.3
                 */
                public function get value():Object
                {
@@ -187,7 +192,7 @@ package org.apache.royale.jewel
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.8
+                *  @productversion Royale 0.9.3
                 */
                public function get selectedValue():Object
                {
@@ -241,26 +246,45 @@ package org.apache.royale.jewel
                }
        }
     
+    //--------------------------------------
+    //  Events
+    //--------------------------------------
+
     /**
      *  Dispatched when the user clicks on RadioButton.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
+     *  @productversion Royale 0.9.3
      */
-    [Event(name="click", type="org.apache.royale.events.MouseEvent")]
-    
+       [Event(name="click", type="org.apache.royale.events.MouseEvent")]
+
     /**
      *  Dispatched when RadioButton is being selected/unselected.
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.8
+     *  @productversion Royale 0.9.3
      */
     [Event(name="change", type="org.apache.royale.events.Event")]
-    
+
+    /**
+     *  The Jewel radio button component in JS is an enhanced version of the
+     *  standard HTML <input type="radio">, or "radio button" element.
+     * 
+     *  A radio button consists of a small circle and, typically, text that 
clearly communicates a
+     *  condition that will be set when the user clicks or touches it. Radio 
buttons
+     *  always appear in groups of two or more and, while they can be 
individually
+     *  selected, can only be deselected by selecting a different radio button 
in the
+     *  same group (which deselects all other radio buttons in the group).
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.3
+     */
     COMPILE::JS
     public class RadioButton extends UIBase
     {
@@ -270,7 +294,7 @@ package org.apache.royale.jewel
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
-         *  @productversion Royale 0.8
+         *  @productversion Royale 0.9.3
          */
                public function RadioButton()
                {
@@ -322,11 +346,12 @@ package org.apache.royale.jewel
          */
         override protected function createElement():WrappedHTMLElement
         {
-            var label:HTMLLabelElement = document.createElement('label') as 
HTMLLabelElement;
-            
-            icon = addElementToWrapper(this,'input') as HTMLInputElement;
-            icon.type = "radio";
-            icon.id = '_radio_' + + Math.random();
+            label = document.createElement('label') as HTMLLabelElement;
+
+            icon = addElementToWrapper(this, 'input') as HTMLInputElement;
+            icon.type = 'radio';
+            icon.id = '_radio_' + Math.random();
+            icon.value = String(value);
             label.appendChild(icon);
 
             textNode = document.createTextNode('') as Text;
@@ -334,16 +359,10 @@ package org.apache.royale.jewel
             radio = document.createElement('span') as HTMLSpanElement;
             radio.appendChild(textNode);
             label.appendChild(radio);
-            //radio.addEventListener('mouseover', mouseOverHandler, false);
-            //radio.addEventListener('mouseout', mouseOutHandler, false);
-
-            // (textNode as WrappedHTMLElement).royale_wrapper = this;
-            // (icon as WrappedHTMLElement).royale_wrapper = this;
-            // (radio as WrappedHTMLElement).royale_wrapper = this;
-
+            
             positioner = label as WrappedHTMLElement;
             _positioner.royale_wrapper = this;
-
+            
             return element;
         }
 
@@ -411,9 +430,9 @@ package org.apache.royale.jewel
         {
             return icon.value;
         }
-        public function set value(v:Object):void
+        public function set value(value:Object):void
         {
-            icon.value = v as String;
+            icon.value = String(value);
         }
         
         public function get selectedValue():Object

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to