Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoveEvent.as and ValidationResultEvent.as Added #149

Merged
merged 9 commits into from Apr 6, 2018
Expand Up @@ -37,6 +37,8 @@ internal class MXRoyaleClasses
import mx.containers.ControlBar; ControlBar;
import mx.controls.ToolTip; ToolTip;
import mx.controls.beads.ToolTipBead; ToolTipBead;
import mx.events.MoveEvent; MoveEvent;
import mx.events.ValidationResultEvent; ValidationResultEvent;
import mx.containers.Tile; Tile;
import mx.containers.DividedBox; DividedBox;
import mx.containers.beads.ApplicationLayout; ApplicationLayout;
Expand Down
161 changes: 161 additions & 0 deletions frameworks/projects/MXRoyale/src/main/royale/mx/events/MoveEvent.as
@@ -0,0 +1,161 @@
////////////////////////////////////////////////////////////////////////////////
//
// 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.events
{
/* import mx.events.Event;*/
import org.apache.royale.events.Event;
import org.apache.royale.events.IRoyaleEvent;
/**
* Represents event objects that are dispatched when a Flex component moves.
*
* @see mx.core.UIComponent
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Royale 0.9.3
* @royalesuppresspublicvarwarning
*/
public class MoveEvent extends Event
{
/* include "../core/Version.as"; */

//--------------------------------------------------------------------------
//
// Class constants
//
//--------------------------------------------------------------------------

/**
* The <code>MoveEvent.MOVE</code> constant defines the value of the
* <code>type</code> property of the event object for a <code>move</code> event.
*
* <p>The properties of the event object have the following values:</p>
* <table class="innertable">
* <tr><th>Property</th><th>Value</th></tr>
* <tr><td><code>bubbles</code></td><td>false</td></tr>
* <tr><td><code>cancelable</code></td><td>false</td></tr>
* <tr><td><code>currentTarget</code></td><td>The Object that defines the
* event listener that handles the event. For example, if you use
* <code>myButton.addEventListener()</code> to register an event listener,
* myButton is the value of the <code>currentTarget</code>. </td></tr>
* <tr><td><code>oldX</code></td><td>The previous x coordinate of the object, in pixels.</td></tr>
* <tr><td><code>oldY</code></td><td>The previous y coordinate of the object, in pixels.</td></tr>
* <tr><td><code>target</code></td><td>The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the <code>currentTarget</code> property to always access the
* Object listening for the event.</td></tr>
* </table>
*
* @eventType move
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Royale 0.9.3
*/
public static const MOVE:String = "move";

//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------

/**
* 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 oldX The previous x coordinate of the object, in pixels.
*
* @param oldY The previous y coordinate of the object, in pixels.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Royale 0.9.3
*/
public function MoveEvent(type:String, bubbles:Boolean = false,
cancelable:Boolean = false,
oldX:Number = NaN, oldY:Number = NaN)
{
super(type, bubbles, cancelable);

this.oldX = oldX;
this.oldY = oldY;
}

//--------------------------------------------------------------------------
//
// Properties
//
//--------------------------------------------------------------------------

//----------------------------------
// oldX
//----------------------------------

/**
* The previous <code>x</code> coordinate of the object, in pixels.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Royale 0.9.3
*/
public var oldX:Number;

//----------------------------------
// oldY
//----------------------------------

/**
* The previous <code>y</code> coordinate of the object, in pixels.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Royale 0.9.3
*/
public var oldY:Number;

//--------------------------------------------------------------------------
//
// Overridden methods: Event
//
//--------------------------------------------------------------------------

/**
* @private
*/
override public function cloneEvent():IRoyaleEvent
{
return new MoveEvent(type, bubbles, cancelable, oldX, oldY);
}
}

}