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

[royale-asjs] branch develop updated (87721bc -> af8690e)

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

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


    from 87721bc  Restoring XML to passing tests (removed [Ignore]s). Fixes #93. Added new tests for children() length tests under various combinations of parsing flags (ignoreComments/whitespace/processing instructions).
     new 41ee718  Added controller to mx radio button.
     new c01c7cd  Let controller time selection after click.
     new af8690e  Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

The 3 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:
 .../MXRoyale/src/main/resources/defaults.css       |  6 ++
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |  1 +
 .../src/main/royale/mx/controls/RadioButton.as     | 10 ---
 .../controllers/RadioButtonMouseController.as      | 82 ++++++++++++++++++++++
 4 files changed, 89 insertions(+), 10 deletions(-)
 create mode 100644 frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as


[royale-asjs] 03/03: Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

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

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

commit af8690e47c6671bb3257f0a8049444a4bdf7b1b8
Merge: c01c7cd 87721bc
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Mon Aug 12 10:13:54 2019 +0300

    Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

 frameworks/projects/XML/src/main/royale/XML.as     |  19 +--
 .../flexUnitTests/xml/XMLTesterGeneralTest.as      | 185 ++++++++++-----------
 .../flexUnitTests/xml/XMLTesterGeneralTest.as      | 174 +++++++++----------
 3 files changed, 187 insertions(+), 191 deletions(-)


[royale-asjs] 01/03: Added controller to mx radio button.

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

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

commit 41ee718a2d1f59378e1edc7867a92893b42157f3
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Sun Aug 11 15:01:05 2019 +0300

    Added controller to mx radio button.
    
    Reference #443
---
 .../MXRoyale/src/main/resources/defaults.css       |  6 ++
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |  1 +
 .../controllers/RadioButtonMouseController.as      | 78 ++++++++++++++++++++++
 3 files changed, 85 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 6c51083..df73449 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -639,6 +639,11 @@ GridLines
 	verticalTickAligned: true;
 }
 
+RadioButton
+{
+	IBeadController:  ClassReference("mx.controls.beads.controllers.RadioButtonMouseController");			
+}
+
 .bothGridLines
 {
 	gridDirection : "both";
@@ -778,6 +783,7 @@ charts|DataTip
 	{
 		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ValueToggleButtonModel");
 		IBeadView:  ClassReference("mx.controls.beads.RadioButtonView");			
+		IBeadController:  ClassReference("mx.controls.beads.controllers.RadioButtonMouseController");			
 	}
 	
 	TextArea
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index fab546e..2ae8d66 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -220,6 +220,7 @@ internal class MXRoyaleClasses
 	import mx.controls.beads.CheckBoxView; CheckBoxView;
 	import mx.controls.beads.RadioButtonView; RadioButtonView;
 	}
+	import mx.controls.beads.controllers.RadioButtonMouseController; RadioButtonMouseController;
     import mx.controls.beads.NumericStepperView; NumericStepperView;
     import mx.controls.beads.DateFieldView; DateFieldView;
     import mx.controls.dateFieldClasses.DateFieldDateChooser; DateFieldDateChooser;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as
new file mode 100644
index 0000000..0f7339e
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls.beads.controllers
+{
+
+import org.apache.royale.core.IStrand;
+import org.apache.royale.events.IEventDispatcher;
+import org.apache.royale.events.MouseEvent;
+import org.apache.royale.core.IBeadController;
+import mx.controls.RadioButton;
+import org.apache.royale.events.Event;
+import mx.events.ItemClickEvent;
+import mx.controls.RadioButtonGroup;
+
+/**
+ *  The RadioButtonMouseController is the default controller for the radio button emulation class.
+ *  It is responsible for creating the item click event
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+
+	public class RadioButtonMouseController implements IBeadController
+	{
+        public function set strand(value:IStrand):void
+        {
+            (value as IEventDispatcher).addEventListener(MouseEvent.CLICK, clickHandler);
+        }
+
+        protected function clickHandler(event:Event):void
+        {
+            // Dispatch an itemClick event from the RadioButtonGroup.
+            var radioButton:RadioButton = event.target as RadioButton;
+            var group:RadioButtonGroup = radioButton.group;
+            var itemClickEvent:ItemClickEvent =
+                new ItemClickEvent(ItemClickEvent.ITEM_CLICK);
+            itemClickEvent.label = radioButton.label;
+            // TODO is this worth the performance price?
+            itemClickEvent.index = getRadioIndex(radioButton, group);
+            itemClickEvent.relatedObject = radioButton;
+            itemClickEvent.item = radioButton.value;
+            group.dispatchEvent(itemClickEvent);
+        }
+
+        private function getRadioIndex(radioButton:RadioButton, group:RadioButtonGroup):int
+        {
+            for (var i:int = 0; i < group.numRadioButtons; i++)
+            {
+                if (group.getRadioButtonAt(i) == radioButton)
+                {
+                    return i;
+                }
+            }
+            return -1;
+        }
+
+	}
+
+}


[royale-asjs] 02/03: Let controller time selection after click.

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

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

commit c01c7cdb6e926ffa3ccfe24a73c76568f0ab7454
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Mon Aug 12 10:04:35 2019 +0300

    Let controller time selection after click.
    
    Reference #443.
---
 .../MXRoyale/src/main/royale/mx/controls/RadioButton.as        | 10 ----------
 .../controls/beads/controllers/RadioButtonMouseController.as   |  4 ++++
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
index aa3f1f4..4c19e74 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/RadioButton.as
@@ -237,7 +237,6 @@ public class RadioButton extends Button
     {
         rbicon = new RadioButtonIcon()
         rbicon.id = '_radio_' + RadioButton.radioCounter++;
-        rbicon.element.addEventListener("change", rbChangeHandler);
         
         textNode = document.createTextNode('') as window.Text;
         
@@ -253,15 +252,6 @@ public class RadioButton extends Button
         return element;
     }
     
-    /**
-     * @royaleignorecoercion HTMLInputElement
-     */
-    COMPILE::JS
-    private function rbChangeHandler(event:Event):void
-    {
-        selected = (rbicon.element as HTMLInputElement).checked    
-    }
-    
     COMPILE::JS
     override public function set id(value:String):void
     {
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as
index 0f7339e..b43d82d 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/controllers/RadioButtonMouseController.as
@@ -58,6 +58,10 @@ import mx.controls.RadioButtonGroup;
             itemClickEvent.index = getRadioIndex(radioButton, group);
             itemClickEvent.relatedObject = radioButton;
             itemClickEvent.item = radioButton.value;
+            if (!radioButton.selected)
+            {
+                radioButton.selected = true;
+            }
             group.dispatchEvent(itemClickEvent);
         }