flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [17/50] [abbrv] git commit: [flex-asjs] [refs/heads/dual] - replicate 8018076b5b703b0450df9b5cec3a8a4e0a34e70d to Basic
Date Thu, 09 Feb 2017 05:45:09 GMT
replicate 8018076b5b703b0450df9b5cec3a8a4e0a34e70d to Basic


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cf643d4d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cf643d4d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cf643d4d

Branch: refs/heads/dual
Commit: cf643d4d764d2fc07cac658b0568ce3b5081c7ce
Parents: 71c4efc
Author: Alex Harui <aharui@apache.org>
Authored: Mon Feb 6 12:15:23 2017 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Feb 6 12:15:23 2017 -0800

----------------------------------------------------------------------
 .../org/apache/flex/html/ToggleTextButton.as    | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cf643d4d/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
index be86d41..eae42dd 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/ToggleTextButton.as
@@ -23,10 +23,16 @@ package org.apache.flex.html
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.Event;
 
+    COMPILE::SWF
+    {
+        import flash.events.MouseEvent;
+    }
     COMPILE::JS
     {
         import org.apache.flex.core.WrappedHTMLElement;
+        import org.apache.flex.events.MouseEvent;
     }
 
     //--------------------------------------
@@ -44,6 +50,16 @@ package org.apache.flex.html
 	[Event(name="click", type="org.apache.flex.events.MouseEvent")]
 
     /**
+     *  Dispatched when ToggleTextButton is being selected/unselected.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="change", type="org.apache.flex.events.Event")]
+
+    /**
      *  The ToggleButton class is a TextButton that supports
      *  a selected property.
      *
@@ -65,6 +81,10 @@ package org.apache.flex.html
 		public function ToggleTextButton()
 		{
 			super();
+            COMPILE::SWF
+            {
+                addEventListener(MouseEvent.CLICK, internalMouseHandler);
+            }
             COMPILE::JS
             {
                 this.typeNames = 'toggleTextButton';
@@ -77,6 +97,7 @@ package org.apache.flex.html
         COMPILE::JS
         private var SELECTED:String = "selected";
 
+        [Bindable("change")]
         /**
          *  <code>true</code> if the Button is selected.
          *
@@ -165,6 +186,15 @@ package org.apache.flex.html
         private function clickHandler(event:Event):void
         {
             selected = !selected;
+            dispatchEvent(new Event("change"));
         }
+        
+        COMPILE::SWF
+        private function internalMouseHandler(event:MouseEvent) : void
+        {
+            selected = !selected;
+            dispatchEvent(new Event("change"));
+        }
+
 	}
 }


Mime
View raw message