This is an automated email from the ASF dual-hosted git repository.
gregdove 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 cb08fb2411 Possible fix for SWF build of mx Slider (untested in SWF,
needs review).
cb08fb2411 is described below
commit cb08fb241157f508f55c3612eb01ac7de527ca8b
Author: greg-dove <[email protected]>
AuthorDate: Fri May 13 08:58:35 2022 +1200
Possible fix for SWF build of mx Slider (untested in SWF, needs review).
---
.../mx/controls/sliderClasses/SliderThumb.as | 5 ++
.../src/main/royale/mx/core/UIComponent.as | 2 +-
.../src/main/royale/mx/events/SliderEvent.as | 72 +++++++++++++++++++++-
3 files changed, 76 insertions(+), 3 deletions(-)
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/sliderClasses/SliderThumb.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/sliderClasses/SliderThumb.as
index 82dca99a92..05b1deacc4 100644
---
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/sliderClasses/SliderThumb.as
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/sliderClasses/SliderThumb.as
@@ -29,6 +29,10 @@ package mx.controls.sliderClasses
import mx.core.mx_internal;
import mx.events.SliderEvent;
import mx.controls.sliderClasses.SliderDirection;
+
+ COMPILE::SWF{
+ import flash.events.Event;
+ }
use namespace mx_internal;
@@ -204,6 +208,7 @@ package mx.controls.sliderClasses
* @private
*/
//porting notes, omitted, missing @todo review:
+ [SWFOverride(params="flash.events.Event",
altparams="org.apache.royale.events.Event:org.apache.royale.events.MouseEvent")]
protected function buttonReleased(event:Event):void
{
if (enabled)
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 672f5e9c22..81fac44a0b 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -4503,7 +4503,7 @@ COMPILE::JS
*/
COMPILE::SWF
{
- [SWFOverride(params="flash.events.Event",
altparams="org.apache.royale.events.Event:org.apache.royale.events.MouseEvent")]
+ [SWFOverride(params="flash.events.Event",
altparams="org.apache.royale.events.Event:org.apache.royale.events.MouseEvent:mx.events.FocusEvent")]
override public function dispatchEvent(event:Event):Boolean {
//trap the layout requests and ignore them if we have deferred
layout
if (event.type == "layoutNeeded") {
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/events/SliderEvent.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/events/SliderEvent.as
index 5211db8574..b0b6249f6e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/events/SliderEvent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/SliderEvent.as
@@ -24,6 +24,10 @@ package mx.events
import org.apache.royale.events.Event;
import org.apache.royale.events.IRoyaleEvent;
+COMPILE::SWF{
+ import FlashEvent=flash.events.Event;
+}
+
/**
* The SliderEvent class represents the event object passed to
* the event listener for the <code>change</code>, <code>thumbDrag</code>,
@@ -238,6 +242,7 @@ public class SliderEvent extends Event
* @playerversion AIR 1.1
* @productversion Flex 3
*/
+ COMPILE::JS
public function SliderEvent(type:String, bubbles:Boolean = false,
cancelable:Boolean = false,
thumbIndex:int = -1, value:Number = NaN,
@@ -253,6 +258,52 @@ public class SliderEvent extends Event
this.keyCode = keyCode;
}
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble
+ * up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @param thumbIndex The zero-based index of the thumb
+ * whose position has changed.
+ *
+ * @param value The new value of the slider.
+ *
+ * @param triggerEvent The type of input action.
+ * The value is an object of type flash.events.MouseEvent
+ * or flash.events.KeyboardEvent.
+ *
+ * @param clickTarget Whether the slider track or a slider thumb was
pressed.
+ *
+ * @param keyCode If the event was triggered by a key press,
+ * the keycode for the key.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::SWF
+ public function SliderEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ thumbIndex:int = -1, value:Number = NaN,
+ triggerEvent:FlashEvent = null,
+ clickTarget:String = null, keyCode:int = -1)
+ {
+ super(type, bubbles, cancelable);
+
+ this.thumbIndex = thumbIndex;
+ this.value = value;
+ this.triggerEvent = triggerEvent;
+ this.clickTarget = clickTarget;
+ this.keyCode = keyCode;
+ }
+
//--------------------------------------------------------------------------
//
// Properties
@@ -314,8 +365,8 @@ public class SliderEvent extends Event
/**
* Indicates the type of input action.
- * The value is an event object of type flash.events.MouseEvent
- * or flash.events.KeyboardEvent.
+ * The value is an event object of type mx.events.MouseEvent
+ * or mx.events.KeyboardEvent.
*
* @see flash.events.MouseEvent
* @see flash.events.KeyboardEvent
@@ -325,8 +376,25 @@ public class SliderEvent extends Event
* @playerversion AIR 1.1
* @productversion Flex 3
*/
+ COMPILE::JS
public var triggerEvent:Event;
+ /**
+ * Indicates the type of input action.
+ * The value is an event object of type flash.events.MouseEvent
+ * or flash.events.KeyboardEvent.
+ *
+ * @see flash.events.MouseEvent
+ * @see flash.events.KeyboardEvent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::SWF
+ public var triggerEvent:FlashEvent;
+
//----------------------------------
// value
//----------------------------------