You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pe...@apache.org on 2018/03/22 14:53:00 UTC
[royale-asjs] branch feature/MXRoyale updated: Adding TextArea.
HTML/JS side of TextArea working.
This is an automated email from the ASF dual-hosted git repository.
pent pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/MXRoyale by this push:
new 03b4de0 Adding TextArea. HTML/JS side of TextArea working.
03b4de0 is described below
commit 03b4de0072d81eaa54bb2982a8b8533b2d735ba6
Author: Peter Ent <pe...@apache.org>
AuthorDate: Thu Mar 22 10:52:57 2018 -0400
Adding TextArea. HTML/JS side of TextArea working.
---
.../MXRoyale/src/main/resources/defaults.css | 14 +
.../src/main/resources/mx-royale-manifest.xml | 1 +
.../src/main/royale/mx/controls/TextArea.as | 2636 ++++++++++++++++++++
.../src/main/royale/mx/core/ScrollControlBase.as | 1425 +++++++++++
.../src/main/royale/mx/core/UIComponent.as | 2 +-
.../src/main/royale/mx/events/ScrollEvent.as | 217 ++
6 files changed, 4294 insertions(+), 1 deletion(-)
diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 92cbd8c..f79af38 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -34,6 +34,20 @@
Button
{
IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageAndTextModel");
+ border: 0.5px solid black;
+ background-color: #EEEEEE;
+ padding: 4px 4px;
+ text-align: center;
+ text-decoration: none;
+ display: inline-block;
+ font-size: 12px;
+}
+Button:hover {
+ background-color: #CCCCCC;
+}
+Button:active {
+ background-color: #999999;
+ color: white;
}
Container
diff --git a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index 1ebfb41..2d57f6b 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -28,6 +28,7 @@
<component id="Label" class="mx.controls.Label" />
<component id="RadioButton" class="mx.controls.RadioButton" />
<component id="RadioButtonGroup" class="mx.controls.RadioButtonGroup" />
+ <component id="TextArea" class="mx.controls.TextArea" />
<component id="TextInput" class="mx.controls.TextInput" />
<component id="Box" class="mx.containers.Box" />
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
new file mode 100644
index 0000000..9164d6d
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
@@ -0,0 +1,2636 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+COMPILE::JS {
+ import goog.DEBUG;
+ import goog.events;
+ import org.apache.royale.core.WrappedHTMLElement;
+ import org.apache.royale.html.util.addElementToWrapper;
+}
+/*
+import flash.accessibility.AccessibilityProperties;
+import flash.display.DisplayObject;
+import flash.events.Event;
+import flash.events.FocusEvent;
+import flash.events.IOErrorEvent;
+import flash.events.MouseEvent;
+import flash.events.TextEvent;
+import flash.system.IME;
+import flash.system.IMEConversionMode;
+import flash.text.StyleSheet;
+import flash.text.TextField;
+import flash.text.TextFieldAutoSize;
+import flash.text.TextFieldType;
+import flash.text.TextFormat;
+import flash.text.TextLineMetrics;
+*/
+import mx.controls.listClasses.BaseListData;
+import mx.core.IDataRenderer;
+import mx.core.ScrollControlBase;
+import mx.events.FlexEvent;
+
+import org.apache.royale.core.ITextModel;
+import org.apache.royale.events.Event;
+import org.apache.royale.html.accessories.PasswordInputBead;
+
+/*
+import mx.events.ScrollEvent;
+import mx.events.ScrollEventDetail;
+import mx.events.ScrollEventDirection;
+import mx.managers.IFocusManager;
+import mx.managers.IFocusManagerComponent;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+
+use namespace mx_internal;
+*/
+
+//--------------------------------------
+// Events
+//--------------------------------------
+
+/**
+ * Dispatched when text in the TextArea control changes
+ * through user input.
+ * This event does not occur if you use data binding or
+ * ActionScript code to change the text.
+ *
+ * <p>Even though the default value of the <code>Event.bubbles</code> property
+ * is <code>true</code>, this control dispatches the event with
+ * the <code>Event.bubbles</code> property set to <code>false</code>.</p>
+ *
+ * @eventType flash.events.Event.CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="change", type="org.apache.royale.evets.Event")]
+
+/**
+ * Dispatched when the <code>data</code> property changes.
+ *
+ * <p>When you use a component as an item renderer,
+ * the <code>data</code> property contains the data to display.
+ * You can listen for this event and update the component
+ * when the <code>data</code> property changes.</p>
+ *
+ * @eventType mx.events.FlexEvent.DATA_CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dataChange", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when a user clicks a hyperlink in text defined by the
+ * <code>htmlText</code> property, where the URL begins with <code>"event:"</code>.
+ * The remainder of the URL after
+ * <code>"event:"</code> is placed in the text property of the <code>link</code> event object.
+ *
+ * <p>When you handle the <code>link</code> event, the hyperlink is not automatically executed;
+ * you need to execute the hyperlink from within your event handler.
+ * You typically use the <code>navigateToURL()</code> method to execute the hyperlink.
+ * This allows you to modify the hyperlink, or even prohibit it from occurring,
+ * in your application. </p>
+ *
+ * @eventType flash.events.TextEvent.LINK
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+//[Event(name="link", type="flash.events.TextEvent")]
+
+/**
+ * Dispatched when the user types, deletes, or pastes text into the control.
+ * No event is dispatched when the user presses the Delete key, or Backspace key.
+ *
+ * <p>Even though the default value of the <code>TextEvent.bubbles</code> property
+ * is <code>true</code>, this control dispatches the event with
+ * the <code>TextEvent.bubbles</code> property set to <code>false</code>.</p>
+ *
+ * @eventType flash.events.TextEvent.TEXT_INPUT
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+//[Event(name="textInput", type="flash.events.TextEvent")]
+
+
+
+/**
+ * The TextArea control is a multiline text field
+ * with a border and optional scroll bars.
+ * The TextArea control supports the HTML rendering capabilities
+ * of Flash Player and AIR.
+ *
+ * <p>If you disable a TextArea control, it displays its contents in the
+ * color specified by the <code>disabledColor</code> style.
+ * You can also set a TextArea control to read-only
+ * to disallow editing of the text.
+ * To conceal input text by displaying characters as asterisks,
+ * set the TextArea's <code>displayAsPassword</code> property.</p>
+ *
+ * <p>The TextArea control has the following default sizing characteristics:</p>
+ * <table class="innertable">
+ * <tr>
+ * <th>Characteristic</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>Default size</td>
+ * <td>width: 160 pixels; height: 44 pixels</td>
+ * </tr>
+ * <tr>
+ * <td>Minimum size</td>
+ * <td>0 pixels</td>
+ * </tr>
+ * <tr>
+ * <td>Maximum size</td>
+ * <td>10000 by 10000 pixels</td>
+ * </tr>
+ * </table>
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:TextArea></code> tag inherits the attributes
+ * of its superclass and adds the following attributes:</p>
+ *
+ * <pre>
+ * <mx:TextArea
+ * <b>Properties</b>
+ * condenseWhite="false|true"
+ * data="undefined"
+ * displayAsPassword="false|true"
+ * editable="true|false"
+ * horizontalScrollPolicy="auto|on|off"
+ * horizontalScrollPosition="0"
+ * htmlText="null"
+ * imeMode="null"
+ * length="0"
+ * listData="null"
+ * maxChars="0"
+ * restrict="null"
+ * selectionBeginIndex="0"
+ * selectionEndIndex="0"
+ * styleSheet="null"
+ * text=""
+ * textHeight="<i>height of text</i>" [read-only]
+ * textWidth="<i>width of text</i>" [read-only]
+ * verticalScrollPolicy="auto|on|off"
+ * verticalScrollPosition="0"
+ * wordWrap="true|false"
+ *
+ * <b>Styles</b>
+ * disabledColor="0xAAB3B3"
+ * focusAlpha="0.5"
+ * focusRoundedCorners"tl tr bl br"
+ * paddingLeft="0""
+ * paddingRight="0""
+ *
+ * <b>Events</b>
+ * change="<i>No default</i>"
+ * />
+ * </pre>
+ *
+ * @see mx.controls.Label
+ * @see mx.controls.Text
+ * @see mx.controls.TextInput
+ * @see mx.controls.RichTextEditor
+ * @see mx.controls.textClasses.TextRange
+ *
+ * @includeExample examples/TextAreaExample.mxml
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class TextArea extends ScrollControlBase
+ implements IDataRenderer
+// implements IDataRenderer, IDropInListItemRenderer,
+// IFocusManagerComponent, IIMESupport, IListItemRenderer,
+// IFontContextComponent
+
+{
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function TextArea()
+ {
+ super();
+ typeNames = "TextArea";
+
+ // ScrollControlBase variables.
+ //_horizontalScrollPolicy = ScrollPolicy.AUTO;
+ //_verticalScrollPolicy = ScrollPolicy.AUTO;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var inSetter:Boolean;
+
+ /**
+ * @private
+ * Flag that indicates whether scroll Events should be dispatched
+ */
+// private var allowScrollEvent:Boolean = true;
+
+ /**
+ * @private
+ * Flag that will block default data/listData behavior.
+ */
+// private var textSet:Boolean;
+
+ /**
+ * @private
+ */
+// private var selectionChanged:Boolean = false;
+
+ /**
+ * @private
+ */
+// private var errorCaught:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ addElementToWrapper(this,'textarea');
+ goog.events.listen(element, 'input', textChangeHandler);
+ return element;
+ }
+
+ //----------------------------------
+ // accessibilityProperties
+ //----------------------------------
+
+ //----------------------------------
+ // baselinePosition
+ //----------------------------------
+
+ /**
+ * @private
+ * The baselinePosition of a TextArea is calculated for its textField.
+ */
+// override public function get baselinePosition():Number
+// {
+// if (!validateBaselinePosition())
+// return NaN;
+//
+// return textField.y + textField.baselinePosition;
+// }
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var enabledChanged:Boolean = false;
+
+ [Inspectable(category="General", enumeration="true,false", defaultValue="true")]
+
+ /**
+ * @private
+ * Disable scrollbars and text field if we're disabled.
+ */
+ override public function set enabled(value:Boolean):void
+ {
+ if (value == enabled)
+ return;
+
+ super.enabled = value;
+ enabledChanged = true;
+
+ COMPILE::JS {
+ element["disabled"] = !value;
+ }
+// if (verticalScrollBar)
+// verticalScrollBar.enabled = value;
+//
+// if (horizontalScrollBar)
+// horizontalScrollBar.enabled = value;
+//
+// invalidateProperties();
+//
+// if (border && border is IInvalidating)
+// IInvalidating(border).invalidateDisplayList();
+ }
+
+ //----------------------------------
+ // fontContext
+ //----------------------------------
+
+ /**
+ * @private
+ */
+// public function get fontContext():IFlexModuleFactory
+// {
+// return moduleFactory;
+// }
+
+ /**
+ * @private
+ */
+// public function set fontContext(moduleFactory:IFlexModuleFactory):void
+// {
+// this.moduleFactory = moduleFactory;
+// }
+
+ //----------------------------------
+ // horizontalScrollPosition
+ //----------------------------------
+
+ /**
+ * @private
+ * Position of the horizontal scrollbar.
+ */
+// private var _hScrollPosition:Number;
+//
+// [Bindable("scroll")]
+// [Bindable("viewChanged")]
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * Pixel position in the content area of the leftmost pixel
+ * that is currently displayed.
+ * (The content area includes all contents of a control, not just
+ * the portion that is currently displayed.)
+ * This property is always set to 0, and ignores changes,
+ * if <code>wordWrap</code> is set to <code>true</code>.
+ *
+ * @default 0
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override public function set horizontalScrollPosition(value:Number):void
+// {
+ // Dispatch viewChanged event in ScrollControlBase super/
+// super.horizontalScrollPosition = value;
+//
+// // Set _hScrollPosition since it is compared against everytime
+// // in updateDisplayList().
+// _hScrollPosition = value;
+//
+// if (textField)
+// {
+// textField.scrollH = value;
+// // This works around a player bug.
+// textField.background = false;
+// }
+// else
+// {
+// invalidateProperties();
+// }
+// }
+
+ //----------------------------------
+ // horizontalScrollPolicy
+ //----------------------------------
+
+// [Inspectable(enumeration="off,on,auto", defaultValue="auto")]
+
+ /**
+ * Specifies whether the horizontal scroll bar is
+ * always on (<code>ScrollPolicy.ON</code>),
+ * always off (<code>ScrollPolicy.OFF</code>),
+ * or turns on when needed (<code>ScrollPolicy.AUTO</code>).
+ *
+ * @default ScrollPolicy.AUTO
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override public function get horizontalScrollPolicy():String
+// {
+// return height <= 40 ? ScrollPolicy.OFF : _horizontalScrollPolicy;
+// }
+
+ //----------------------------------
+ // maxHorizontalScrollPosition
+ //----------------------------------
+
+ /**
+ * Maximum value of <code>horizontalScrollPosition</code>.
+ * <p>The default value is 0, which means that horizontal scrolling is not
+ * required.</p>
+ * This property is always set to 0
+ * if <code>wordWrap</code> is set to <code>true</code>.
+ *
+ * <p>The value of the <code>maxHorizontalScrollPosition</code> property is
+ * computed from the data and size of component, and must not be set by
+ * the application code.</p>
+ *
+ * @default 0
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override public function get maxHorizontalScrollPosition():Number
+// {
+// return textField ? textField.maxScrollH : 0;
+// }
+
+ //----------------------------------
+ // maxVerticalScrollPosition
+ //----------------------------------
+
+ /**
+ * Maximum value of <code>verticalScrollPosition</code>.
+ * The default value is 0, which means that vertical scrolling is not
+ * required.
+ *
+ * <p>The value of the <code>maxVerticalScrollPosition</code> property is
+ * computed from the data and size of component, and must not be set by
+ * the application code.</p>
+ *
+ * @tiptext The maximum pixel offset into the content from the top edge
+ * @helpid 3182
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override public function get maxVerticalScrollPosition():Number
+// {
+// return textField ? textField.maxScrollV - 1 : 0;
+// }
+
+ //----------------------------------
+ // tabIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the tabIndex property.
+ */
+// private var _tabIndex:int = -1;
+
+ /**
+ * @private
+ */
+// private var tabIndexChanged:Boolean = false;
+
+ /**
+ * @private
+ * Tab order in which the control receives the focus when navigating
+ * with the Tab key.
+ *
+ * @default -1
+ * @tiptext tabIndex of the component
+ * @helpid 3184
+ */
+// public function get tabIndex():int
+// {
+// return _tabIndex;
+// }
+
+ /**
+ * @private
+ */
+// public function set tabIndex(value:int):void
+// {
+// if (value == _tabIndex)
+// return;
+//
+// _tabIndex = value;
+// tabIndexChanged = true;
+//
+// invalidateProperties();
+// }
+
+ //----------------------------------
+ // textField
+ //----------------------------------
+
+ /**
+ * The internal UITextField that renders the text of this TextArea.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected var textField:IUITextField;
+
+ //----------------------------------
+ // verticalScrollPosition
+ //----------------------------------
+
+ /**
+ * @private
+ * Position of the vertical scrollbar.
+ */
+// private var _vScrollPosition:Number;
+
+// [Bindable("scroll")]
+// [Bindable("viewChanged")]
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * Line number of the top row of characters that is currently displayed.
+ * The default value is 0.
+ *
+ * @tiptext The pixel offset into the content from the top edge
+ * @helpid 3181
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override public function set verticalScrollPosition(value:Number):void
+// {
+// // Dispatch viewChanged event in ScrollControlBase super.
+// super.verticalScrollPosition = value;
+//
+// // Set scrollV since it is compared against everytime
+// // in updateDisplayList().
+// _vScrollPosition = value;
+//
+// if (textField)
+// {
+// textField.scrollV = value + 1;
+// // This works around a player bug.
+// textField.background = false;
+// }
+// else
+// {
+// invalidateProperties();
+// }
+// }
+
+ //----------------------------------
+ // verticalScrollPolicy
+ //----------------------------------
+
+// [Inspectable(enumeration="off,on,auto", defaultValue="auto")]
+
+ /**
+ * Whether the vertical scroll bar is
+ * always on (<code>ScrollPolicy.ON</code>),
+ * always off (<code>ScrollPolicy.OFF</code>),
+ * or turns on when needed (<code>ScrollPolicy.AUTO</code>).
+ *
+ * @default ScrollPolicy.AUTO
+ * @tiptext Specifies if vertical scrollbar is on, off,
+ * or automatically adjusts
+ * @helpid 3428
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override public function get verticalScrollPolicy():String
+// {
+// return height <= 40 ? ScrollPolicy.OFF : _verticalScrollPolicy;
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // condenseWhite
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the condenseWhite property.
+ */
+ private var _condenseWhite:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var condenseWhiteChanged:Boolean = false;
+
+ [Bindable("condenseWhiteChanged")]
+ [Inspectable(category="General", defaultValue="")]
+
+ /**
+ * Specifies whether extra white space (spaces, line breaks,
+ * and so on) should be removed in a TextArea control with HTML text.
+ *
+ * <p>The <code>condenseWhite</code> property only affects text set with
+ * the <code>htmlText</code> property, not the <code>text</code> property.
+ * If you set text with the <code>text</code> property,
+ * <code>condenseWhite</code> is ignored.</p>
+ *
+ * <p>If you set the <code>condenseWhite</code> property to <code>true</code>,
+ * you must use standard HTML commands such as <code><br></code>
+ * and <code><p></code> to place line breaks in the text field.</p>
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get condenseWhite():Boolean
+ {
+ return _condenseWhite;
+ }
+
+ /**
+ * @private
+ */
+ public function set condenseWhite(value:Boolean):void
+ {
+ if (value == _condenseWhite)
+ return;
+
+ _condenseWhite = value;
+ condenseWhiteChanged = true;
+
+ // Changing the condenseWhite property needs to trigger
+ // the same response as changing the htmlText property
+ // if this TextArea is displaying HTML.
+// if (isHTML)
+// htmlTextChanged = true;
+//
+// invalidateProperties();
+// invalidateSize();
+// invalidateDisplayList();
+
+ dispatchEvent(new Event("condenseWhiteChanged"));
+ }
+
+ //----------------------------------
+ // data
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the data property.
+ */
+ private var _data:Object;
+
+ [Bindable("dataChange")]
+ [Inspectable(environment="none")]
+
+ /**
+ * Lets you pass a value to the component
+ * when you use it in an item renderer or item editor.
+ * You typically use data binding to bind a field of the <code>data</code>
+ * property to a property of this component.
+ *
+ * <p>When you use the control as a drop-in item renderer or drop-in
+ * item editor, Flex automatically writes the current value of the item
+ * to the <code>text</code> property of this control.</p>
+ *
+ * <p>You do not set this property in MXML.</p>
+ *
+ * @default null
+ * @see mx.core.IDataRenderer
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get data():Object
+ {
+ return _data;
+ }
+
+ /**
+ * @private
+ */
+ public function set data(value:Object):void
+ {
+ var newText:*;
+
+ _data = value;
+
+// if (_listData)
+// {
+// newText = _listData.label;
+// }
+// else if (_data != null)
+// {
+// if (_data is String)
+// newText = String(_data);
+// else
+// newText = _data.toString();
+// }
+//
+// if (newText !== undefined && !textSet)
+// {
+// text = newText;
+// textSet = false;
+// }
+
+ dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+ }
+
+ //----------------------------------
+ // displayAsPassword
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the displayAsPassword proeprty.
+ */
+ private var _displayAsPassword:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var displayAsPasswordChanged:Boolean = false;
+
+ [Bindable("displayAsPasswordChanged")]
+ [Inspectable(category="General", defaultValue="false")]
+
+ /**
+ * Indicates whether this control is used for entering passwords.
+ * If <code>true</code>, the field does not display entered text,
+ * instead, each text character entered into the control
+ * appears as the character "*".
+ *
+ * @default false
+ *
+ * @tiptext Specifies whether to display '*'
+ * instead of the actual characters
+ * @helpid 3177
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get displayAsPassword():Boolean
+ {
+ return _displayAsPassword;
+ }
+
+ /**
+ * @private
+ */
+ public function set displayAsPassword(value:Boolean):void
+ {
+ if (value == _displayAsPassword)
+ return;
+
+ _displayAsPassword = value;
+ displayAsPasswordChanged = true;
+
+// invalidateProperties();
+// invalidateSize();
+// invalidateDisplayList();
+
+ if (GOOG::DEBUG)
+ trace("displayAsPassword not implemented");
+
+ dispatchEvent(new Event("displayAsPasswordChanged"));
+ }
+
+ //----------------------------------
+ // editable
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the editable property.
+ */
+ private var _editable:Boolean = true;
+
+ /**
+ * @private
+ */
+ private var editableChanged:Boolean = false;
+
+ [Bindable("editableChanged")]
+ [Inspectable(category="General", defaultValue="true")]
+
+ /**
+ * Indicates whether the user is allowed to edit the text in this control.
+ * If <code>true</code>, the user can edit the text.
+ *
+ * @default true;
+ *
+ * @tiptext Specifies whether the component is editable or not
+ * @helpid 3176
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get editable():Boolean
+ {
+ return _editable;
+ }
+
+ /**
+ * @private
+ */
+ public function set editable(value:Boolean):void
+ {
+ if (value == _editable)
+ return;
+
+ _editable = value;
+ editableChanged = true;
+
+ COMPILE::JS {
+ element["readOnly"] = !value;
+ }
+
+ //invalidateProperties();
+
+ dispatchEvent(new Event("editableChanged"));
+ }
+
+ //----------------------------------
+ // enableIME
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the IME should
+ * be enabled when the component receives focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+// public function get enableIME():Boolean
+// {
+// return editable;
+// }
+
+ //----------------------------------
+ // htmlText
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the htmlText property.
+ * In addition to being set in the htmlText setter,
+ * it is automatically updated at two other times.
+ * 1. When the 'text' or 'htmlText' is pushed down into
+ * the textField in commitProperties(), this causes
+ * the textField to update its own 'htmlText'.
+ * Therefore in commitProperties() we reset this storage var
+ * to be in sync with the textField.
+ * 2. When the TextFormat of the textField changes
+ * because a CSS style has changed (see validateNow()
+ * in UITextField), the textField also updates its own 'htmlText'.
+ * Therefore in textField_textFieldStyleChangeHandler()
+ */
+ private var _htmlText:String = "";
+
+ /**
+ * @private
+ */
+// private var htmlTextChanged:Boolean = false;
+
+ /**
+ * @private
+ * The last value of htmlText that was set.
+ * We have to keep track of this because when you set the htmlText
+ * of a TextField and read it back, you don't get what you set.
+ * In general it will have additional HTML markup corresponding
+ * to the defaultTextFormat set from the CSS styles.
+ * If this var is null, it means that 'text' rather than 'htmlText'
+ * was last set.
+ */
+ private var explicitHTMLText:String = null;
+//
+// [Bindable("htmlTextChanged")]
+// [CollapseWhiteSpace]
+// [Inspectable(category="General", defaultValue="")]
+// [NonCommittingChangeEvent("change")]
+
+ /**
+ * Specifies the text displayed by the TextArea control, including HTML markup that
+ * expresses the styles of that text.
+ * When you specify HTML text in this property, you can use the subset of HTML
+ * tags that is supported by the Flash TextField control.
+ *
+ * <p>When you set this property, the HTML markup is applied
+ * after the CSS styles for the TextArea instance are applied.
+ * When you get this property, the HTML markup includes
+ * the CSS styles.</p>
+ *
+ * <p>For example, if you set this to be a string such as,
+ * <code>"This is an example of <b>bold</b> markup"</code>,
+ * the text "This is an example of <b>bold</b> markup" appears
+ * in the TextArea with whatever CSS styles normally apply.
+ * Also, the word "bold" appears in boldface font because of the
+ * <code><b></code> markup.</p>
+ *
+ * <p>HTML markup uses characters such as < and >,
+ * which have special meaning in XML (and therefore in MXML). So,
+ * code such as the following does not compile:</p>
+ *
+ * <pre>
+ * <mx:TextArea htmlText="This is an example of <b>bold</b> markup"/>
+ * </pre>
+ *
+ * <p>There are three ways around this problem.</p>
+ *
+ * <ul>
+ *
+ * <li>
+ *
+ * <p>Set the <code>htmlText</code> property in an ActionScript method called as
+ * an <code>initialize</code> handler:</p>
+ *
+ * <pre>
+ * <mx:TextArea id="myTextArea" initialize="myTextArea_initialize()"/>
+ * </pre>
+ *
+ * <p>where the <code>myTextArea_initialize</code> method is in a script CDATA section:</p>
+ *
+ * <pre>
+ * <fx:Script>
+ * <![CDATA[
+ * private function myTextArea_initialize():void {
+ * myTextArea.htmlText = "This is an example of <b>bold</b> markup";
+ * }
+ * ]]>
+ * </fx:Script>
+ *
+ * </pre>
+ *
+ * <p>This is the simplest approach because the HTML markup
+ * remains easily readable.
+ * Notice that you must assign an <code>id</code> to the TextArea
+ * so you can refer to it in the <code>initialize</code>
+ * handler.</p>
+ *
+ * </li>
+ *
+ * <li>
+ *
+ * <p>Specify the <code>htmlText</code> property by using a child tag
+ * with a CDATA section. A CDATA section in XML contains character data
+ * where characters like < and > aren't given a special meaning.</p>
+ *
+ * <pre>
+ * <mx:TextArea>
+ * <mx:htmlText><![CDATA[This is an example of <b>bold</b> markup]]></mx:htmlText>
+ * <mx:TextArea/>
+ * </pre>
+ *
+ * <p>You must write the <code>htmlText</code> property as a child tag
+ * rather than as an attribute on the <code><mx:TextArea></code> tag
+ * because XML doesn't allow CDATA for the value of an attribute.
+ * Notice that the markup is readable, but the CDATA section makes
+ * this approach more complicated.</p>
+ *
+ * </li>
+ *
+ * <li>
+ *
+ * <p>Use an <code>hmtlText</code> attribute where any occurences
+ * of the HTML markup characters < and > in the attribute value
+ * are written instead of the XML "entities" <code>&lt;</code>
+ * and <code>&gt;</code>:</p>
+ *
+ * <pre>
+ * <mx:TextArea htmlText="This is an example of &lt;b&gt;bold&lt;/b&gt; markup"/&gt;
+ * </pre>
+ *
+ * Adobe does not recommend this approach because the HTML markup becomes
+ * nearly impossible to read.
+ *
+ * </li>
+ *
+ * </ul>
+ *
+ * <p>If the <code>condenseWhite</code> property is <code>true</code>
+ * when you set the <code>htmlText</code> property, multiple
+ * white-space characters are condensed, as in HTML-based browsers;
+ * for example, three consecutive spaces are displayed
+ * as a single space.
+ * The default value for <code>condenseWhite</code> is
+ * <code>false</code>, so you must set <code>condenseWhite</code>
+ * to <code>true</code> to collapse the white space.</p>
+ *
+ * <p>If you read back the <code>htmlText</code> property quickly
+ * after setting it, you get the same string that you set.
+ * However, after the LayoutManager runs, the value changes
+ * to include additional markup that includes the CSS styles.</p>
+ *
+ * <p>Setting the <code>htmlText</code> property affects the <code>text</code>
+ * property in several ways.
+ * If you read the <code>text</code> property quickly after setting
+ * the <code>htmlText</code> property, you get <code>null</code>,
+ * which indicates that the <code>text</code> corresponding to the new
+ * <code>htmlText</code> has not yet been determined.
+ * However, after the LayoutManager runs, the <code>text</code> property
+ * value changes to the <code>htmlText</code> string with all the
+ * HTML markup removed; that is,
+ * the value is the characters that the TextArea actually displays.</p>
+ *
+ * <p>Conversely, if you set the <code>text</code> property,
+ * any previously set <code>htmlText</code> is irrelevant.
+ * If you read the <code>htmlText</code> property quickly after setting
+ * the <code>text</code> property, you get <code>null</code>,
+ * which indicates that the <code>htmlText</code> that corresponds to the new
+ * <code>text</code> has not yet been determined.
+ * However, after the LayoutManager runs, the <code>htmlText</code> property
+ * value changes to the new text plus the HTML markup for the CSS styles.</p>
+ *
+ * <p>To make the LayoutManager run immediately, you can call the
+ * <code>validateNow()</code> method on the TextArea.
+ * For example, you could set some <code>htmlText</code>,
+ * call the <code>validateNow()</code> method, and immediately
+ * obtain the corresponding <code>text</code> that doesn't have
+ * the HTML markup.</p>
+ *
+ * <p>If you set both <code>text</code> and <code>htmlText</code> properties
+ * in ActionScript, whichever is set last takes effect.
+ * Do not set both in MXML, because MXML does not guarantee that
+ * the properties of an instance get set in any particular order.</p>
+ *
+ * <p>Setting either <code>text</code> or <code>htmlText</code> property
+ * inside a loop is a fast operation, because the underlying TextField
+ * that actually renders the text is not updated until
+ * the LayoutManager runs.</p>
+ *
+ * <p>If you try to set this property to <code>null</code>,
+ * it is set, instead, to the empty string.
+ * If the property temporarily has the value <code>null</code>,
+ * it indicates that the <code>text</code> has been recently set
+ * and the corresponding <code>htmlText</code>
+ * has not yet been determined.</p>
+ *
+ * @default ""
+ *
+ * @see flash.text.TextField#htmlText
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get htmlText():String
+ {
+ //return _htmlText;
+ COMPILE::SWF
+ {
+ return ITextModel(model).html;
+ }
+ COMPILE::JS
+ {
+ return (element as HTMLInputElement).value;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set htmlText(value:String):void
+ {
+ COMPILE::SWF
+ {
+ ITextModel(model).html = value;
+ }
+ COMPILE::JS
+ {
+ (element as HTMLInputElement).value = value;
+ dispatchEvent(new Event('htmlTextChanged'));
+ }
+// textSet = true;
+//
+// // The htmlText property can't be set to null,
+// // only to the empty string, because if you set the htmlText
+// // of a TextField to null it throws an RTE.
+// // If the getter returns null, it means that 'text' was just set
+// // and the value of 'htmlText' isn't yet known, because the 'text'
+// // hasn't been committed into the textField and the 'htmlText'
+// // hasn't yet been read back out of the textField.
+// if (!value)
+// value = "";
+//
+// _htmlText = value;
+// htmlTextChanged = true;
+//
+// // The text property is unknown until commitProperties(),
+// // when we push the htmlText into the TextField and it
+// // calculates the text.
+// // But you can call validateNow() to make this happen right away.
+// _text = null;
+//
+// explicitHTMLText = value;
+//
+// invalidateProperties();
+// invalidateSize();
+// invalidateDisplayList();
+//
+// // Trigger bindings to htmlText.
+// dispatchEvent(new Event("htmlTextChanged"));
+//
+// // commitProperties() will dispatch a "valueCommit" event
+// // after the TextField determines the 'text' based on the
+// // 'htmlText'; this event will trigger any bindings to 'text'.
+ }
+
+ //----------------------------------
+ // imeMode
+ //----------------------------------
+
+ /**
+ * @private
+ */
+// private var _imeMode:String = null;
+
+ /**
+ * Specifies the IME (input method editor) mode.
+ * The IME enables users to enter text in Chinese, Japanese, and Korean.
+ * Flex sets the specified IME mode when the control gets the focus,
+ * and sets it back to the previous value when the control loses the focus.
+ *
+ * <p>The flash.system.IMEConversionMode class defines constants for the
+ * valid values for this property.
+ * You can also specify <code>null</code> to specify no IME.</p>
+ *
+ * @default null
+ *
+ * @see flash.system.IMEConversionMode
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get imeMode():String
+// {
+// return _imeMode;
+// }
+//
+// /**
+// * @private
+// */
+// public function set imeMode(value:String):void
+// {
+// _imeMode = value;
+// }
+
+ //----------------------------------
+ // isHTML
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private function get isHTML():Boolean
+ {
+ return explicitHTMLText != null;
+ }
+
+ //----------------------------------
+ // length
+ //----------------------------------
+
+ /**
+ * The number of characters of text displayed in the TextArea.
+ *
+ * @default 0
+ *
+ * @tiptext The number of characters in the TextArea
+ * @helpid 3173
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get length():int
+ {
+ return text != null ? text.length : -1;
+ }
+
+ //----------------------------------
+ // listData
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the listData property.
+ */
+ private var _listData:BaseListData;
+
+ [Bindable("dataChange")]
+ [Inspectable(environment="none")]
+
+ /**
+ * When a component is used as a drop-in item renderer or drop-in
+ * item editor, Flex initializes the <code>listData</code> property
+ * of the component with the appropriate data from the list control.
+ * The component can then use the <code>listData</code> property
+ * to initialize the <code>data</code> property of the drop-in
+ * item renderer or drop-in item editor.
+ *
+ * <p>You do not set this property in MXML or ActionScript;
+ * Flex sets it when the component is used as a drop-in item renderer
+ * or drop-in item editor.</p>
+ *
+ * @default null
+ * @see mx.controls.listClasses.IDropInListItemRenderer
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get listData():BaseListData
+ {
+ return _listData;
+ }
+
+ /**
+ * @private
+ */
+ public function set listData(value:BaseListData):void
+ {
+ _listData = value;
+ }
+
+ //----------------------------------
+ // maxChars
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the maxChars property.
+ */
+ private var _maxChars:int = 0;
+
+ /**
+ * @private
+ */
+ private var maxCharsChanged:Boolean = false;
+
+ [Bindable("maxCharsChanged")]
+ [Inspectable(category="General", defaultValue="0")]
+
+ /**
+ * Maximum number of characters that users can enter in the text field.
+ * This property does not limit the length of text specified by the
+ * setting the control's <code>text</code> or <code>htmlText</code>property.
+ *
+ * <p>The default value of 0, which indicates no limit.</p>
+ *
+ * @tiptext The maximum number of characters that the TextArea can contain
+ * @helpid 3172
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get maxChars():int
+ {
+ return _maxChars;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxChars(value:int):void
+ {
+ if (value == _maxChars)
+ return;
+
+ _maxChars = value;
+ maxCharsChanged = true;
+
+ COMPILE::JS {
+ element["maxLength"] = value;
+ }
+
+ //invalidateProperties();
+
+ dispatchEvent(new Event("maxCharsChanged"));
+ }
+
+ //----------------------------------
+ // restrict
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the restrict property.
+ */
+ private var _restrict:String = null;
+
+ /**
+ * @private
+ */
+ private var restrictChanged:Boolean = false;
+
+ [Bindable("restrictChanged")]
+ [Inspectable(category="General")]
+
+ /**
+ * Indicates the set of characters that a user can enter into the control.
+ * If the value of the <code>restrict</code> property is <code>null</code>,
+ * you can enter any character. If the value of the <code>restrict</code>
+ * property is an empty string, you cannot enter any character.
+ * This property only restricts user interaction; a script
+ * can put any text into the text field. If the value of
+ * the <code>restrict</code> property is a string of characters,
+ * you may enter only characters in that string into the
+ * text field.
+ *
+ * <p>Flex scans the string from left to right. You can specify a range by
+ * using the hyphen (-) character.
+ * If the string begins with a caret (^) character, all characters are
+ * initially accepted and succeeding characters in the string are excluded
+ * from the set of accepted characters. If the string does not begin with a
+ * caret (^) character, no characters are initially accepted and succeeding
+ * characters in the string are included in the set of accepted characters.</p>
+ *
+ * <p>Because some characters have a special meaning when used
+ * in the <code>restrict</code> property, you must use
+ * backslash characters to specify the literal characters -, ^, and \.
+ * When you use the <code>restrict</code> property as an attribute
+ * in an MXML tag, use single backslashes, as in the following
+ * example: \^\-\\.
+ * When you set the <code>restrict</code> In and ActionScript expression,
+ * use double backslashes, as in the following example: \\^\\-\\\.</p>
+ *
+ * @default null
+ *
+ * @see flash.text.TextField#restrict
+ *
+ * @tiptext The set of characters that may be entered into the TextArea
+ * @helpid 3174
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get restrict():String
+ {
+ return _restrict;
+ }
+
+ /**
+ * @private
+ */
+ public function set restrict(value:String):void
+ {
+ if (value == _restrict)
+ return;
+
+ _restrict = value;
+ restrictChanged = true;
+
+ //invalidateProperties();
+ if (GOOG::DEBUG)
+ trace("restrict not implemented");
+
+ dispatchEvent(new Event("restrictChanged"));
+ }
+
+ //----------------------------------
+ // selectable
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for selectable property.
+ */
+// private var _selectable:Boolean = true;
+
+ /**
+ * @private
+ * Change flag for selectable property.
+ */
+// private var selectableChanged:Boolean = false;
+
+// [Inspectable(category="General", defaultValue="true")]
+
+ /**
+ * Specifies whether the text can be selected.
+ * Making the text selectable lets you copy text from the control.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get selectable():Boolean
+// {
+// return _selectable;
+// }
+//
+// /**
+// * @private
+// */
+// public function set selectable(value:Boolean):void
+// {
+// if (value == selectable)
+// return;
+//
+// _selectable = value;
+// selectableChanged = true;
+//
+// invalidateProperties();
+// }
+
+ //----------------------------------
+ // selectionBeginIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the selectionBeginIndex property.
+ */
+// private var _selectionBeginIndex:int = 0;
+//
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * The zero-based character index value of the first character
+ * in the current selection.
+ * For example, the first character is 0, the second character is 1,
+ * and so on.
+ * When the control gets the focus, the selection is visible if the
+ * <code>selectionBeginIndex</code> and <code>selectionEndIndex</code>
+ * properties are both set.
+ *
+ * @default 0
+ *
+ * @tiptext The zero-based index value of the first character
+ * in the selection.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get selectionBeginIndex():int
+// {
+// return textField ?
+// textField.selectionBeginIndex :
+// _selectionBeginIndex;
+// }
+
+ /**
+ * @private
+ */
+// public function set selectionBeginIndex(value:int):void
+// {
+// _selectionBeginIndex = value;
+// selectionChanged = true;
+//
+// invalidateProperties();
+// }
+
+ //----------------------------------
+ // selectionEndIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the selectionEndIndex property.
+ */
+// private var _selectionEndIndex:int = 0;
+
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * The zero-based index of the position <i>after</i>the last character
+ * in the current selection (equivalent to the one-based index of the last
+ * character).
+ * If the last character in the selection, for example, is the fifth
+ * character, this property has the value 5.
+ * When the control gets the focus, the selection is visible if the
+ * <code>selectionBeginIndex</code> and <code>selectionEndIndex</code>
+ * properties are both set.
+ *
+ * @default 0
+ *
+ * @tiptext The zero-based index value of the last character
+ * in the selection.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get selectionEndIndex():int
+// {
+// return textField ?
+// textField.selectionEndIndex :
+// _selectionEndIndex;
+// }
+
+ /**
+ * @private
+ */
+// public function set selectionEndIndex(value:int):void
+// {
+// _selectionEndIndex = value;
+// selectionChanged = true;
+//
+// invalidateProperties();
+// }
+
+ //----------------------------------
+ // styleSheet
+ //----------------------------------
+
+ /**
+ * @private
+ * Change flag for the styleSheet property
+ */
+// private var styleSheetChanged:Boolean = false;
+//
+// /**
+// * @private
+// * Storage for the styleSheet property.
+// */
+// private var _styleSheet:StyleSheet;
+//
+// /**
+// * A flash.text.StyleSheet object that can perform rendering
+// * on the TextArea control's text.
+// * Used for detailed control of HTML styles for the text.
+// * For more information, see the flash.text.StyleSheet
+// * class documentation.
+// *
+// * @see flash.text.StyleSheet
+// *
+// * @default null
+// *
+// * @langversion 3.0
+// * @playerversion Flash 9
+// * @playerversion AIR 1.1
+// * @productversion Flex 3
+// */
+// public function get styleSheet():StyleSheet
+// {
+// return _styleSheet;
+// }
+//
+// /**
+// * @private
+// */
+// public function set styleSheet(value:StyleSheet):void
+// {
+// _styleSheet = value;
+// styleSheetChanged = true;
+// htmlTextChanged = true;
+//
+// invalidateProperties();
+// }
+
+ //----------------------------------
+ // text
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the text property.
+ * In addition to being set in the 'text' setter,
+ * it is automatically updated at another time:
+ * When the 'text' or 'htmlText' is pushed down into
+ * the textField in commitProperties(), this causes
+ * the textField to update its own 'text'.
+ * Therefore in commitProperties() we reset this storage var
+ * to be in sync with the textField.
+ */
+ private var _text:String = "";
+
+ /**
+ * @private
+ */
+ private var textChanged:Boolean = false;
+
+ [Bindable("textChanged")]
+ [CollapseWhiteSpace]
+ [Inspectable(category="General", defaultValue="")]
+ [NonCommittingChangeEvent("change")]
+
+ /**
+ * Plain text that appears in the control.
+ * Its appearance is determined by the CSS styles of this Label control.
+ *
+ * <p>Any HTML tags in the text string are ignored,
+ * and appear as entered in the string.
+ * To display text formatted using HTML tags,
+ * use the <code>htmlText</code> property instead.
+ * If you set the <code>htmlText</code> property,
+ * the HTML replaces any text you had set using this propety, and the
+ * <code>text</code> property returns a plain-text version of the
+ * HTML text, with all HTML tags stripped out.
+ * For more information see the <code>htmlText</code> property.</p>
+ *
+ * <p>To include the special characters left angle bracket (<),
+ * right angle bracket (>), or ampersand (&) in the text,
+ * wrap the text string in the CDATA tag.
+ * Alternatively, you can use HTML character entities for the
+ * special characters, for example, <code>&lt;</code>.</p>
+ *
+ * <p>If you try to set this property to <code>null</code>,
+ * it is set, instead, to the empty string.
+ * The <code>text</code> property can temporarily have the value <code>null</code>,
+ * which indicates that the <code>htmlText</code> has been recently set
+ * and the corresponding <code>text</code> value
+ * has not yet been determined.</p>
+ *
+ * @default ""
+ * @tiptext Gets or sets the TextArea content
+ * @helpid 3179
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get text():String
+ {
+ //return _text;
+ COMPILE::SWF
+ {
+ return ITextModel(model).text;
+ }
+ COMPILE::JS
+ {
+ return (element as HTMLInputElement).value;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ COMPILE::SWF
+ {
+ inSetter = true;
+ ITextModel(model).text = value;
+ inSetter = false;
+ }
+ COMPILE::JS
+ {
+ (element as HTMLTextAreaElement).value = value;
+ dispatchEvent(new Event('textChange'));
+ }
+// textSet = true;
+//
+// // The text property can't be set to null, only to the empty string.
+// // If the getter returns null, it means that 'htmlText' was just set
+// // and the value of 'text' isn't yet known, because the 'htmlText'
+// // hasn't been committed into the textField and the 'text'
+// // hasn't yet been read back out of the textField.
+// if (!value)
+// value = "";
+//
+// if (!isHTML && value == _text)
+// return;
+//
+// _text = value;
+// textChanged = true;
+//
+// // The htmlText property is unknown until commitProperties(),
+// // when we push the text into the TextField and it
+// // calculates the htmlText.
+// // But you can call validateNow() to make this happen right away.
+// _htmlText = null;
+//
+// explicitHTMLText = null;
+//
+// invalidateProperties();
+// invalidateSize();
+// invalidateDisplayList();
+//
+// // Trigger bindings to 'text'.
+// dispatchEvent(new Event("textChanged"));
+//
+// // commitProperties() will dispatch an "htmlTextChanged" event
+// // after the TextField determines the 'htmlText' based on the
+// // 'text'; this event will trigger any bindings to 'htmlText'.
+//
+ dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+ }
+
+ //----------------------------------
+ // textHeight
+ //----------------------------------
+
+ /**
+ * @private
+ */
+// private var _textHeight:Number;
+
+ /**
+ * The height of the text.
+ *
+ * <p>The value of the <code>textHeight</code> property is correct only
+ * after the component has been validated.
+ * If you set <code>text</code> and then immediately ask for the
+ * <code>textHeight</code>, you might receive an incorrect value.
+ * You should wait for the component to validate
+ * or call the <code>validateNow()</code> method before you get the value.
+ * This behavior differs from that of the flash.text.TextField control,
+ * which updates the value immediately.</p>
+ *
+ * @see flash.text.TextField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get textHeight():Number
+// {
+// return _textHeight;
+// }
+
+ //----------------------------------
+ // textWidth
+ //----------------------------------
+
+ /**
+ * @private
+ */
+// private var _textWidth:Number;
+
+ /**
+ * The width of the text.
+ *
+ * <p>The value of the <code>textWidth</code> property is correct only
+ * after the component has been validated.
+ * If you set <code>text</code> and then immediately ask for the
+ * <code>textWidth</code>, you might receive an incorrect value.
+ * You should wait for the component to validate
+ * or call the <code>validateNow()</code> method before you get the value.
+ * This behavior differs from that of the flash.text.TextField control,
+ * which updates the value immediately.</p>
+ *
+ * @see flash.text.TextField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get textWidth():Number
+// {
+// return _textWidth;
+// }
+
+ //----------------------------------
+ // wordWrap
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the wordWrap property.
+ */
+ private var _wordWrap:Boolean = true;
+
+ /**
+ * @private
+ */
+ private var wordWrapChanged:Boolean = false;
+
+ [Bindable("wordWrapChanged")]
+ [Inspectable(category="General", defaultValue="true")]
+
+ /**
+ * Indicates whether the text automatically wraps at the end of a line.
+ * If <code>true</code>, the text wraps to occupy
+ * multiple lines, if necessary.
+ *
+ * @default true
+ *
+ * @tiptext If true, lines will wrap. If false, long lines get clipped.
+ * @helpid 3175
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get wordWrap():Boolean
+ {
+ return _wordWrap;
+ }
+
+ /**
+ * @private
+ */
+ public function set wordWrap(value:Boolean):void
+ {
+ if (value == _wordWrap)
+ return;
+
+ _wordWrap = value;
+ wordWrapChanged = true;
+
+ invalidateProperties();
+ invalidateDisplayList();
+
+ dispatchEvent(new Event("wordWrapChanged"));
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+// override protected function createChildren():void
+// {
+// super.createChildren();
+//
+// createTextField(-1);
+// }
+
+ /**
+ * @private
+ */
+ override protected function commitProperties():void
+ {
+ super.commitProperties();
+
+// if (hasFontContextChanged() && textField != null)
+// {
+// removeTextField();
+// createTextField(-1);
+// accessibilityPropertiesChanged = true;
+// condenseWhiteChanged = true;
+// displayAsPasswordChanged = true;
+// editableChanged = true;
+// enabledChanged = true;
+// maxCharsChanged = true;
+// restrictChanged = true;
+// selectableChanged = true;
+// tabIndexChanged = true;
+// wordWrapChanged = true;
+// textChanged = true;
+// selectionChanged = true;
+// }
+
+// if (accessibilityPropertiesChanged)
+// {
+// textField.accessibilityProperties = _accessibilityProperties;
+//
+// accessibilityPropertiesChanged = false;
+// }
+
+// if (condenseWhiteChanged)
+// {
+// textField.condenseWhite = _condenseWhite;
+//
+// condenseWhiteChanged = false;
+// }
+
+// if (displayAsPasswordChanged)
+// {
+// textField.displayAsPassword = _displayAsPassword;
+//
+// displayAsPasswordChanged = false;
+// }
+
+// if (editableChanged)
+// {
+// textField.type = _editable && enabled ?
+// TextFieldType.INPUT :
+// TextFieldType.DYNAMIC;
+//
+// editableChanged = false;
+// }
+
+// if (enabledChanged)
+// {
+// textField.enabled = enabled;
+//
+// enabledChanged = false;
+// }
+
+// if (maxCharsChanged)
+// {
+// textField.maxChars = _maxChars;
+//
+// maxCharsChanged = false;
+// }
+
+// if (restrictChanged)
+// {
+// textField.restrict = _restrict;
+//
+// restrictChanged = false;
+// }
+
+// if (selectableChanged)
+// {
+// textField.selectable = _selectable;
+//
+// selectableChanged = false;
+// }
+
+// if (styleSheetChanged)
+// {
+// textField.styleSheet = _styleSheet;
+//
+// styleSheetChanged = false;
+// }
+
+// if (tabIndexChanged)
+// {
+// textField.tabIndex = _tabIndex;
+//
+// tabIndexChanged = false;
+// }
+
+// if (wordWrapChanged)
+// {
+// textField.wordWrap = _wordWrap;
+//
+// wordWrapChanged = false;
+// }
+
+// if (textChanged || htmlTextChanged)
+// {
+// // If the 'text' and 'htmlText' properties have both changed,
+// // the last one set wins.
+// if (isHTML)
+// textField.htmlText = explicitHTMLText;
+// else
+// textField.text = _text;
+//
+// textFieldChanged(false, true)
+//
+// textChanged = false;
+// htmlTextChanged = false;
+// }
+
+// if (selectionChanged)
+// {
+// textField.setSelection(_selectionBeginIndex, _selectionEndIndex);
+//
+// selectionChanged = false;
+// }
+
+// if (!isNaN(_hScrollPosition))
+// horizontalScrollPosition = _hScrollPosition;
+//
+// if (!isNaN(_vScrollPosition))
+// verticalScrollPosition = _vScrollPosition;
+ }
+
+ /**
+ * @private
+ */
+ override protected function measure():void
+ {
+ super.measure();
+
+// measuredMinWidth = DEFAULT_MEASURED_MIN_WIDTH;
+// measuredWidth = DEFAULT_MEASURED_WIDTH;
+// // TextArea is minimum of two lines of text
+// measuredMinHeight = measuredHeight = 2 * DEFAULT_MEASURED_MIN_HEIGHT;
+ }
+
+ /**
+ * @private
+ * Position the internal textfield taking scrollbars into consideration.
+ */
+ override protected function updateDisplayList(unscaledWidth:Number,
+ unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+// var vm:EdgeMetrics = viewMetrics;
+//
+// vm.left += getStyle("paddingLeft");
+// vm.top += getStyle("paddingTop");
+// vm.right += getStyle("paddingRight");
+// vm.bottom += getStyle("paddingBottom");
+//
+// textField.move(vm.left, vm.top);
+//
+// var w:Number = unscaledWidth - vm.left - vm.right;
+// var h:Number = unscaledHeight - vm.top - vm.bottom;
+//
+// // If there's a border, add another line of pixels to the textField
+// // that go under the border but allow for descenders on some fonts.
+// if (vm.top + vm.bottom > 0)
+// h++;
+//
+// // maxScrollV doesnt get proper value if width < 4
+// textField.setActualSize(Math.max(4, w), Math.max(4, h));
+//
+// // For some reason the textfield resizes itself when initialized
+// // and needs to be forced back to its new size.
+//// textField.background = false;
+//
+// // textField gets proper values of scroll properties after 1 update
+// // so scroll bars adjustment would need to wait.
+// if (!initialized)
+// {
+// callLater(invalidateDisplayList);
+// }
+// else
+// {
+// // maxScrollV isn't updated yet in some cases
+// callLater(adjustScrollBars);
+// }
+//
+// // Reset the scrolling position here.
+// // This is most important at init time if someone
+// // explicitly sets a position as well as text,
+// // because setting the text causes a scroll event
+// // with the last known scrollpositions a frame later,
+// // overridding what we just set.
+//
+// if (isNaN(_hScrollPosition))
+// _hScrollPosition = 0;
+// if (isNaN(_vScrollPosition))
+// _vScrollPosition = 0;
+//
+// var p:Number = Math.min(textField.maxScrollH, _hScrollPosition);
+// if (p != textField.scrollH)
+// horizontalScrollPosition = p;
+// p = Math.min(textField.maxScrollV - 1, _vScrollPosition);
+// if (p != textField.scrollV - 1)
+// verticalScrollPosition = p;
+ }
+
+ /**
+ * @private
+ * Focus should always be on the internal TextField.
+ */
+// override public function setFocus():void
+// {
+// // We want to preserve the scroll position rather than
+// // scroll to the line containing the caret.
+// var vScrollPos:int = verticalScrollPosition;
+// // we dont want to dispatch a scroll event on focus.
+// allowScrollEvent = false;
+// textField.setFocus();
+// verticalScrollPosition = vScrollPos;
+// allowScrollEvent = true;
+// }
+
+ /**
+ * @private
+ */
+// override protected function isOurFocus(target:DisplayObject):Boolean
+// {
+// return target == textField || super.isOurFocus(target);
+// }
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Creates the text field child and adds it as a child of this component.
+ *
+ * @param childIndex The index of where to add the child.
+ * If -1, the text field is appended to the end of the list.
+ */
+// mx_internal function createTextField(childIndex:int):void
+// {
+// if (!textField)
+// {
+// textField = IUITextField(createInFontContext(UITextField));
+//
+// textField.autoSize = TextFieldAutoSize.NONE;
+// textField.enabled = enabled;
+// textField.ignorePadding = true;
+// textField.multiline = true;
+// textField.selectable = true;
+// textField.styleName = this;
+// textField.tabEnabled = true;
+// textField.type = TextFieldType.INPUT;
+// textField.useRichTextClipboard = true;
+// textField.wordWrap = true;
+//
+// textField.addEventListener(Event.CHANGE, textField_changeHandler);
+// textField.addEventListener(Event.SCROLL, textField_scrollHandler);
+// textField.addEventListener(IOErrorEvent.IO_ERROR,
+// textField_ioErrorHandler);
+// textField.addEventListener(TextEvent.TEXT_INPUT,
+// textField_textInputHandler);
+// textField.addEventListener("textFieldStyleChange",
+// textField_textFieldStyleChangeHandler)
+// textField.addEventListener("textFormatChange",
+// textField_textFormatChangeHandler)
+// textField.addEventListener("textInsert",
+// textField_textModifiedHandler);
+// textField.addEventListener("textReplace",
+// textField_textModifiedHandler);
+// textField.addEventListener("textFieldWidthChange",
+// textField_textFieldWidthChangeHandler);
+//
+// // can't use NativeDragEvent.NATIVE_DRAG_DROP b/c we need AIR for that
+// // ideally we don't need to listen for this event as doing a dragDrop should
+// // dispatch a TEXT_INPUT and a CHANGE event for us (see SDK-19816)
+// textField.addEventListener("nativeDragDrop", textField_nativeDragDropHandler);
+//
+// if (childIndex == -1)
+// addChild(DisplayObject(textField));
+// else
+// addChildAt(DisplayObject(textField), childIndex);
+// }
+// }
+
+ /**
+ * @private
+ * Removes the text field from this component.
+ */
+// mx_internal function removeTextField():void
+// {
+// if (textField)
+// {
+// textField.removeEventListener(Event.CHANGE, textField_changeHandler);
+// textField.removeEventListener(Event.SCROLL, textField_scrollHandler);
+// textField.removeEventListener(IOErrorEvent.IO_ERROR,
+// textField_ioErrorHandler);
+// textField.removeEventListener(TextEvent.TEXT_INPUT,
+// textField_textInputHandler);
+// textField.removeEventListener("textFieldStyleChange",
+// textField_textFieldStyleChangeHandler)
+// textField.removeEventListener("textFormatChange",
+// textField_textFormatChangeHandler)
+// textField.removeEventListener("textInsert",
+// textField_textModifiedHandler);
+// textField.removeEventListener("textReplace",
+// textField_textModifiedHandler);
+// textField.removeEventListener("textFieldWidthChange",
+// textField_textFieldWidthChangeHandler);
+// textField.removeEventListener("nativeDragDrop", textField_nativeDragDropHandler);
+//
+// removeChild(DisplayObject(textField));
+// textField = null;
+// }
+// }
+
+ /**
+ * Returns a TextLineMetrics object with information about the text
+ * position and measurements for a line of text in the control.
+ * The component must be validated to get a correct number.
+ * If you set the <code>text</code> or <code>htmlText</code> property
+ * and then immediately call
+ * <code>getLineMetrics()</code> you may receive an incorrect value.
+ * You should either wait for the component to validate
+ * or call <code>validateNow()</code>.
+ * This is behavior differs from that of the flash.text.TextField class,
+ * which updates the value immediately.
+ *
+ * @param lineIndex The zero-based index of the line for which to get the metrics.
+ *
+ * @return The object that contains information about the text position
+ * and measurements for the specified line of text in the control.
+ *
+ * @see flash.text.TextField
+ * @see flash.text.TextLineMetrics
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function getLineMetrics(lineIndex:int):TextLineMetrics
+// {
+// return textField ? textField.getLineMetrics(lineIndex) : null;
+// }
+
+ /**
+ * Selects the text in the range specified by the parameters.
+ * If the control is not in focus, the selection highlight will not show
+ * until the control gains focus. Also, if the focus is gained by clicking
+ * on the control, any previous selection would be lost.
+ * If the two parameter values are the same,
+ * the new selection is an insertion point.
+ *
+ * @param beginIndex The zero-based index of the first character in the
+ * selection; that is, the first character is 0, the second character
+ * is 1, and so on.
+ *
+ * @param endIndex The zero-based index of the position <i>after</i>
+ * the last character in the selection (equivalent to the one-based
+ * index of the last character).
+ * If the parameter is 5, the last character in the selection, for
+ * example, is the fifth character.
+ * When the TextArea control gets the focus, the selection is visible
+ * if the <code>selectionBeginIndex</code> and <code>selectionEndIndex</code>
+ * properties are both set.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function setSelection(beginIndex:int, endIndex:int):void
+// {
+// _selectionBeginIndex = beginIndex;
+// _selectionEndIndex = endIndex;
+// selectionChanged = true;
+//
+// invalidateProperties();
+// }
+
+ /**
+ * @private
+ * Setting the 'htmlText' of textField changes its 'text',
+ * and vice versa, so afterwards doing so we call this method
+ * to update the storage vars for various properties.
+ * Afterwards, the Label's 'text', 'htmlText', 'textWidth',
+ * and 'textHeight' are all in sync with each other
+ * and are identical to the TextField's.
+ */
+// private function textFieldChanged(styleChangeOnly:Boolean,
+// dispatchValueCommitEvent:Boolean):void
+// {
+// var changed1:Boolean;
+// var changed2:Boolean;
+//
+// if (!styleChangeOnly)
+// {
+// changed1 = _text != textField.text;
+// _text = textField.text;
+// }
+//
+// changed2 = _htmlText != textField.htmlText;
+// _htmlText = textField.htmlText;
+//
+// // If the 'text' property changes, trigger bindings to it
+// // and conditionally dispatch a 'valueCommit' event.
+// if (changed1)
+// {
+// dispatchEvent(new Event("textChanged"));
+//
+// if (dispatchValueCommitEvent)
+// dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+// }
+// // If the 'htmlText' property changes, trigger bindings to it.
+// if (changed2)
+// dispatchEvent(new Event("htmlTextChanged"));
+//
+// _textWidth = textField.textWidth;
+// _textHeight = textField.textHeight;
+// }
+
+ /**
+ * @private
+ */
+// private function adjustScrollBars():void
+// {
+// var visibleRows:Number =
+// textField.bottomScrollV - textField.scrollV + 1;
+//
+// setScrollBarProperties(textField.width + textField.maxScrollH,
+// textField.width, textField.numLines,
+// visibleRows);
+// }
+
+ /**
+ * @private
+ * Some other components which use a TextArea as an internal
+ * subcomponent need access to its UITextField, but can't access the
+ * textField var because it is protected and therefore available
+ * only to subclasses.
+ */
+// mx_internal function getTextField():IUITextField
+// {
+// return textField;
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden event handlers: UIComponent
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+// override protected function focusInHandler(event:FocusEvent):void
+// {
+// if (event.target == this)
+// systemManager.stage.focus = TextField(textField);
+//
+// var fm:IFocusManager = focusManager;
+//
+// if (editable && fm)
+// fm.showFocusIndicator = true;
+//
+// if (fm)
+// fm.defaultButtonEnabled = false;
+//
+// super.focusInHandler(event);
+//
+// if (_imeMode != null && _editable)
+// {
+// // When IME.conversionMode is unknown it cannot be
+// // set to anything other than unknown(English)
+// try
+// {
+// if (!errorCaught &&
+// IME.conversionMode != IMEConversionMode.UNKNOWN)
+// {
+// IME.conversionMode = _imeMode;
+// }
+// errorCaught = false;
+// }
+// catch(e:Error)
+// {
+// // Once an error is thrown, focusIn is called
+// // again after the Alert is closed, throw error
+// // only the first time.
+// errorCaught = true;
+// var message:String = resourceManager.getString(
+// "controls", "unsupportedMode", [ _imeMode ]);
+// throw new Error(message);
+// }
+// }
+// }
+
+ /**
+ * @private
+ * Gets called by internal field so we remove focus rect.
+ */
+// override protected function focusOutHandler(event:FocusEvent):void
+// {
+// var fm:IFocusManager = focusManager;
+//
+// if (fm)
+// fm.defaultButtonEnabled = true;
+//
+// super.focusOutHandler(event);
+//
+// dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden event handlers: ScrollControlBase
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Mouse wheel scroll handler.
+ * TextField scrolls automatically so we don't need to handle this.
+ */
+// override protected function mouseWheelHandler(event:MouseEvent):void
+// {
+// event.stopPropagation();
+// }
+
+ /**
+ * @private
+ * We got a scroll event so update everything
+ */
+// override protected function scrollHandler(event:Event):void
+// {
+// // TextField.scroll bubbles so you might see it here
+// if (event is ScrollEvent)
+// {
+// if (!liveScrolling &&
+// ScrollEvent(event).detail == ScrollEventDetail.THUMB_TRACK)
+// {
+// return;
+// }
+//
+// super.scrollHandler(event);
+//
+// textField.scrollH = horizontalScrollPosition;
+// textField.scrollV = verticalScrollPosition + 1;
+//
+// _vScrollPosition = textField.scrollV - 1;
+// _hScrollPosition = textField.scrollH;
+// }
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * dispatch change event in response to a textChange event
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.0
+ */
+ COMPILE::JS
+ public function textChangeHandler(event:Event):void
+ {
+ if (!inSetter)
+ {
+ dispatchEvent(new Event("change"));
+ }
+ }
+
+ /**
+ * @private
+ * Only gets called on keyboard not programmatic setting of text.
+ */
+// private function textField_changeHandler(event:Event):void
+// {
+// textFieldChanged(false, false);
+//
+// adjustScrollBars();
+//
+// // Kill any programmatic change we might be looking at.
+// textChanged = false;
+// htmlTextChanged = false;
+//
+// // Stop this bubbling "change" event
+// // and dispatch another one that doesn't bubble.
+// event.stopImmediatePropagation();
+// dispatchEvent(new Event(Event.CHANGE));
+// }
+
+ /**
+ * @private
+ */
+// private function textField_scrollHandler(event:Event):void
+// {
+// if (initialized && allowScrollEvent)
+// {
+// // delta is positive when scrolling down/right and
+// // negative in the opposite direction
+// var deltaX:int = textField.scrollH - horizontalScrollPosition;
+// var deltaY:int = textField.scrollV - 1 - verticalScrollPosition;
+//
+// horizontalScrollPosition = textField.scrollH;
+// verticalScrollPosition = textField.scrollV - 1;
+//
+// var scrollEvent:ScrollEvent;
+// if (deltaX)
+// {
+// scrollEvent = new ScrollEvent(ScrollEvent.SCROLL, false, false,
+// null, horizontalScrollPosition, ScrollEventDirection.HORIZONTAL,
+// deltaX);
+// dispatchEvent(scrollEvent);
+// }
+// if (deltaY)
+// {
+// scrollEvent = new ScrollEvent(ScrollEvent.SCROLL, false, false,
+// null, verticalScrollPosition, ScrollEventDirection.VERTICAL,
+// deltaY);
+// dispatchEvent(scrollEvent);
+// }
+// }
+// }
+
+ /**
+ * @private
+ */
+// private function textField_ioErrorHandler(event:IOErrorEvent):void
+// {
+// }
+
+ /**
+ * @private
+ */
+// private function textField_nativeDragDropHandler(event:Event):void
+// {
+// // just call the "change" handler
+// textField_changeHandler(event);
+// }
+
+ /**
+ * @private
+ */
+// private function textField_textInputHandler(event:TextEvent):void
+// {
+// event.stopImmediatePropagation();
+//
+// // Dispatch a cancelable version of this event.
+// var newEvent:TextEvent =
+// new TextEvent(TextEvent.TEXT_INPUT, false, true);
+// newEvent.text = event.text;
+// dispatchEvent(newEvent);
+//
+// // If any handler has called preventDefault(),
+// // then stop the TextField from accepting the text.
+// if (newEvent.isDefaultPrevented())
+// event.preventDefault();
+// }
+
+ /**
+ * @private
+ */
+// private function textField_textFieldStyleChangeHandler(event:Event):void
+// {
+// textFieldChanged(true, false);
+// }
+
+ /**
+ * @private
+ */
+// private function textField_textFormatChangeHandler(event:Event):void
+// {
+// textFieldChanged(true, false);
+// }
+
+ /**
+ * @private
+ */
+// private function textField_textModifiedHandler(event:Event):void
+// {
+// textFieldChanged(false, true);
+// }
+
+ /**
+ * @private
+ * Changing the width of the text field can cause the text to reflow.
+ * Make sure our local _textWidth and _textHeight are in sync with text field.
+ */
+// private function textField_textFieldWidthChangeHandler(event:Event):void
+// {
+// textFieldChanged(true, false);
+// }
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
new file mode 100644
index 0000000..1f35b0d
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
@@ -0,0 +1,1425 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+/*
+import flash.display.DisplayObject;
+import flash.display.Graphics;
+import flash.display.Shape;
+import flash.events.Event;
+import flash.events.MouseEvent;
+import flash.geom.Point;
+
+import mx.controls.HScrollBar;
+import mx.controls.VScrollBar;
+import mx.controls.scrollClasses.ScrollBar;
+import mx.core.IToolTip;
+*/
+import mx.events.ScrollEvent;
+/*
+import mx.events.ScrollEventDetail;
+import mx.events.ScrollEventDirection;
+import mx.managers.ToolTipManager;
+import mx.styles.ISimpleStyleClient;
+
+use namespace mx_internal;
+*/
+
+/**
+ * Dispatched when the content is scrolled.
+ *
+ * @eventType mx.events.ScrollEvent.SCROLL
+ * @helpid 3269
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="scroll", type="mx.events.ScrollEvent")]
+
+
+/**
+ * The ScrollControlBase class is the base class for controls
+ * with scroll bars.
+ * The user interacts with the scroll bar or the developer accesses
+ * methods and properties that alter the viewable area.
+ * The ScrollControlBase takes a single child object and positions and
+ * masks or sizes that object to display the viewable content.
+ * All items to be scrolled must be children of that content object
+ *
+ * @mxml
+ *
+ * <p>The <code><ScrollControlBase></code> tag inherits all the tag attributes
+ * of its superclass, and adds the following tag attributes:</p>
+ *
+ * <pre>
+ * <mx:<i>tagname</i>
+ * <b>Properties</b>
+ * border="<i>object of border skin style</i>"
+ * horizontalScrollPolicy="off|on|auto"
+ * horizontalScrollPosition="0"
+ * liveScrolling="true|false"
+ * maxHorizontalScrollPosition="NaN"
+ * maxVerticalScrollPosition="NaN"
+ * scrollTipFunction="undefined"
+ * showScrollTips="false|true"
+ * verticalScrollPolicy="auto|off|on"
+ * verticalScrollPosition="0"
+ * <b>Styles</b>
+ * backgroundAlpha="1.0"
+ * backgroundColor="undefined"
+ * backgroundImage="undefined"
+ * backgroundSize="auto"
+ * borderColor="0xAAB3B3"
+ * borderSides="left top right bottom"
+ * borderSkin="ClassReference('mx.skins.halo.HaloBorder')"
+ * borderStyle="inset"
+ * borderThickness="1"
+ * color="0x0B333C"
+ * cornerRadius="0"
+ * disabledColor="0xAAB3B3"
+ * dropShadowColor="0x000000"
+ * dropShadowEnabled="false"
+ * fontFamily="Verdana"
+ * fontSize="10"
+ * fontStyle="normal|italic"
+ * fontWeight="normal|bold"
+ * horizontalScrollBarStyleName=""
+ * leading="2"
+ * shadowDirection="center"
+ * shadowDistance="2"
+ * textAlign="<i>value; see detail.</i>"
+ * textDecoration="none|underline"
+ * textIndent="0"
+ * verticalScrollBarStyleName=""
+ *
+ * <b>Events</b>
+ * scroll="<i>No default</i>"
+ * />
+ * </pre>
+ *
+ * @helpid 3270
+ * @tiptext base class for views/containers that support scrolling
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ScrollControlBase extends UIComponent
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ScrollControlBase()
+ {
+ super();
+
+// _viewMetrics = EdgeMetrics.EMPTY;
+
+ // Listen for "mouseWheel" events on myself or any of my children
+// addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The border object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected var border:IFlexDisplayObject;
+
+ /**
+ * @private
+ * Offsets including borders and scrollbars.
+ */
+// private var _viewMetrics:EdgeMetrics;
+
+ /**
+ * The mask. This property may be undefined if no scroll bars
+ * are currently displayed or in some subclasses which
+ * have a different masking mechanism.
+ * A mask defined the viewable area of a displayable object.
+ * Thus this mask is used to hide the portions of the content
+ * that are not currently viewable.
+ * In general you do not access this property directly.
+ * Manipulation of the <code>horizontalScrollPolicy</code>,
+ * <code>verticalScrollPolicy</code>, <code>horizontalScrollPosition</code>,
+ * and <code>verticalScrollPosition</code> properties
+ * should provide sufficient control over the mask.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected var maskShape:Shape;
+
+ /**
+ * The horizontal scroll bar.
+ * This property is null if no horizontal scroll bar
+ * is currently displayed.
+ * In general you do not access this property directly.
+ * Manipulation of the <code>horizontalScrollPolicy</code>
+ * and <code>horizontalScrollPosition</code>
+ * properties should provide sufficient control over the scroll bar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected var horizontalScrollBar:ScrollBar;
+
+ /**
+ * The vertical scroll bar.
+ * This property is null if no vertical scroll bar
+ * is currently displayed.
+ * In general you do not access this property directly.
+ * Manipulation of the <code>verticalScrollPolicy</code>
+ * and <code>verticalScrollPosition</code>
+ * properties should provide sufficient control over the scroll bar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected var verticalScrollBar:ScrollBar;
+
+ /**
+ * @private
+ */
+// private var numberOfCols:Number = 0;
+
+ /**
+ * @private
+ */
+// private var numberOfRows:Number = 0;
+
+ /**
+ * @private
+ */
+// mx_internal var _maxVerticalScrollPosition:Number;
+// mx_internal var _maxHorizontalScrollPosition:Number;
+
+ /**
+ * @private
+ */
+// private var viewableRows:Number;
+// private var viewableColumns:Number;
+
+ /**
+ * @private
+ */
+// private var propsInited:Boolean;
+
+ /**
+ * A flag that the scrolling area changed due to the appearance or disappearance of
+ * scrollbars. Used by most layout methods to re-adjust the scrolling properties again.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected var scrollAreaChanged:Boolean;
+
+ /**
+ * @private
+ */
+// private var invLayout:Boolean;
+
+ /**
+ * @private
+ * Instance of the scrollTip. (There can be only one.)
+ */
+// private var scrollTip:IToolTip;
+
+ /**
+ * @private
+ * Base position for the scrollTip.
+ */
+// private var scrollThumbMidPoint:Number;
+
+ /**
+ * @private
+ * Keep track of the whether the ToolTipManager was enabled
+ * before dealing with scroll tips.
+ */
+// private var oldTTMEnabled:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * @private
+ * Scrollbars must be enabled/disabled when we are.
+ */
+// override public function set enabled(value:Boolean):void
+// {
+// super.enabled = value;
+//
+// if (horizontalScrollBar)
+// horizontalScrollBar.enabled = value;
+//
+// if (verticalScrollBar)
+// verticalScrollBar.enabled = value;
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // borderMetrics
+ //----------------------------------
+
+ /**
+ * Returns an EdgeMetrics object that has four properties:
+ * <code>left</code>, <code>top</code>, <code>right</code>,
+ * and <code>bottom</code>.
+ * The value of each property is equal to the thickness of one side
+ * of the border, expressed in pixels.
+ *
+ * @return EdgeMetrics object with the left, right, top,
+ * and bottom properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get borderMetrics():EdgeMetrics
+// {
+// return (border && border is IRectangularBorder) ?
+// IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY;
+// }
+
+ //----------------------------------
+ // horizontalScrollPosition
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the horizontalScrollPosition property.
+ */
+// mx_internal var _horizontalScrollPosition:Number = 0;
+//
+// [Bindable("scroll")]
+// [Bindable("viewChanged")]
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * The offset into the content from the left edge. This can
+ * be a pixel offset in some subclasses or some other metric
+ * like the number of columns in a DataGrid or number of items
+ * in a HorizontalList or TileList.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get horizontalScrollPosition():Number
+// {
+// return _horizontalScrollPosition;
+// }
+
+ /**
+ * @private
+ * This only moves the scrollBars -- assumes the call emanated
+ * from the scrollable content.
+ */
+// public function set horizontalScrollPosition(value:Number):void
+// {
+// _horizontalScrollPosition = value;
+//
+// if (horizontalScrollBar)
+// horizontalScrollBar.scrollPosition = value;
+//
+// dispatchEvent(new Event("viewChanged"));
+// }
+
+ //----------------------------------
+ // horizontalScrollPolicy
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the horizontalScrollPolicy property.
+ */
+// mx_internal var _horizontalScrollPolicy:String = ScrollPolicy.OFF;
+
+// [Bindable("horizontalScrollPolicyChanged")]
+// [Inspectable(enumeration="off,on,auto", defaultValue="off")]
+
+ /**
+ * A property that indicates whether the horizontal scroll
+ * bar is always on, always off,
+ * or automatically changes based on the parameters passed to the
+ * <code>setScrollBarProperties()</code> method.
+ * Allowed values are <code>ScrollPolicy.ON</code>,
+ * <code>ScrollPolicy.OFF</code>, and <code>ScrollPolicy.AUTO</code>.
+ * MXML values can be <code>"on"</code>, <code>"off"</code>,
+ * and <code>"auto"</code>.
+ *
+ * <p>Setting this property to <code>ScrollPolicy.OFF</code> for ListBase
+ * subclasses does not affect the <code>horizontalScrollPosition</code>
+ * property; you can still scroll the contents programmatically.</p>
+ *
+ * <p>Note that the policy can affect the measured size of the component
+ * If the policy is <code>ScrollPolicy.AUTO</code> the
+ * scrollbar is not factored in the measured size. This is done to
+ * keep the layout from recalculating when the scrollbar appears. If you
+ * know that you will have enough data for scrollbars you should set
+ * the policy to <code>ScrollPolicy.ON</code>. If you
+ * don't know, you may need to set an explicit width or height on
+ * the component to allow for scrollbars to appear later.</p>
+ *
+ * @default ScrollPolicy.OFF
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get horizontalScrollPolicy():String
+// {
+// return _horizontalScrollPolicy;
+// }
+
+ /**
+ * @private
+ */
+// public function set horizontalScrollPolicy(value:String):void
+// {
+// var newPolicy:String = value.toLowerCase();
+//
+// if (_horizontalScrollPolicy != newPolicy)
+// {
+// _horizontalScrollPolicy = newPolicy;
+// invalidateDisplayList();
+//
+// dispatchEvent(new Event("horizontalScrollPolicyChanged"));
+// }
+// }
+
+ //----------------------------------
+ // liveScrolling
+ //----------------------------------
+
+// [Inspectable(defaultValue="true")]
+
+ /**
+ * A flag that indicates whether scrolling is live as the
+ * scrollbar thumb is moved
+ * or the view is not updated until the thumb is released.
+ * The default value is <code>true</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public var liveScrolling:Boolean = true;
+
+ //----------------------------------
+ // maxHorizontalScrollPosition
+ //----------------------------------
+
+// [Bindable("maxHorizontalScrollPositionChanged")]
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * The maximum value for the <code>horizontalScrollPosition</code> property.
+ * Note that this is not the width of the content because the
+ * <code>maxHorizontalScrollPosition</code> property contains the width
+ * of the content minus the width of the displayable area.
+ *
+ * <p>In most components, the value of the
+ * <code>maxHorizontalScrollPosition</code> property is computed from the
+ * data and size of component, and must not be set by
+ * the application code.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get maxHorizontalScrollPosition():Number
+// {
+// if (!isNaN(_maxHorizontalScrollPosition))
+// return _maxHorizontalScrollPosition;
+//
+// var m:Number = horizontalScrollBar ?
+// horizontalScrollBar.maxScrollPosition :
+// 0;
+// return m;
+// }
+
+ /**
+ * @private
+ */
+// public function set maxHorizontalScrollPosition(value:Number):void
+// {
+// _maxHorizontalScrollPosition = value;
+//
+// dispatchEvent(new Event("maxHorizontalScrollPositionChanged"));
+// }
+
+ //----------------------------------
+ // maxVerticalScrollPosition
+ //----------------------------------
+
+// [Bindable("maxVerticalScrollPositionChanged")]
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * The maximum value for the <code>verticalScrollPosition</code> property.
+ * Note that this is not the height of the content because the
+ * <code>maxVerticalScrollPosition</code> property contains the height
+ * of the content minus the height of the displayable area.
+ *
+ * <p>The value of the
+ * <code>maxVerticalScrollPosition</code> property is computed from the
+ * data and size of component, and must not be set by
+ * the application code.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get maxVerticalScrollPosition():Number
+// {
+// if (!isNaN(_maxVerticalScrollPosition))
+// return _maxVerticalScrollPosition;
+//
+// var m:Number = verticalScrollBar ?
+// verticalScrollBar.maxScrollPosition :
+// 0;
+// return m;
+// }
+
+ /**
+ * @private
+ */
+// public function set maxVerticalScrollPosition(value:Number):void
+// {
+// _maxVerticalScrollPosition = value;
+//
+// dispatchEvent(new Event("maxVerticalScrollPositionChanged"));
+// }
+
+ //----------------------------------
+ // scrollTipFunction
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the scrollTipFunction property.
+ */
+// private var _scrollTipFunction:Function;
+//
+// [Bindable("scrollTipFunctionChanged")]
+// [Inspectable(defaultValue="")]
+
+ /**
+ * A function that computes the string to be displayed as the ScrollTip.
+ * This function is called if the <code>showScrollTips</code> property
+ * is set to <code>true</code> and the scroll thumb is being dragged.
+ * The function should return a String that used as a ScrollTip.
+ * The function is passed two parameters.
+ * The first is the <code>direction</code> of the scroll bar.
+ * The second is its <code>scrollPosition</code>, as the following example shows:
+ *
+ * <pre>
+ * function scrollTipFunction(direction:String, position:Number):String
+ * {
+ * if (direction == "vertical") return myToolTips[position];
+ * else return "";
+ * }</pre>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get scrollTipFunction():Function
+// {
+// return _scrollTipFunction;
+// }
+
+ /**
+ * @private
+ */
+// public function set scrollTipFunction(value:Function):void
+// {
+// _scrollTipFunction = value;
+//
+// dispatchEvent(new Event("scrollTipFunctionChanged"));
+// }
+
+ //----------------------------------
+ // showScrollTips
+ //----------------------------------
+
+// [Inspectable(defaultValue="false")]
+
+ /**
+ * A flag that indicates whether a tooltip should appear
+ * near the scroll thumb when it is being dragged.
+ * The default value is <code>false</code> to disable the tooltip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public var showScrollTips:Boolean = false;
+
+ //----------------------------------
+ // viewMetrics
+ //----------------------------------
+
+ /**
+ * An EdgeMetrics object taking into account the scroll bars,
+ * if visible.
+ *
+ * @return EdgeMetrics object with the thickness, in pixels,
+ * of the left, top, right, and bottom edges.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get viewMetrics():EdgeMetrics
+// {
+// _viewMetrics = borderMetrics.clone();
+//
+// if (!horizontalScrollBar &&
+// (horizontalScrollPolicy == ScrollPolicy.ON))
+// {
+// createHScrollBar(true);
+//
+// horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler);
+// horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler);
+// horizontalScrollBar.scrollPosition = _horizontalScrollPosition;
+//
+// invalidateDisplayList();
+// }
+//
+// if (!verticalScrollBar && verticalScrollPolicy == ScrollPolicy.ON)
+// {
+// createVScrollBar(true);
+//
+// verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler);
+// verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler);
+// verticalScrollBar.scrollPosition = _verticalScrollPosition;
+//
+// invalidateDisplayList();
+// }
+//
+// if (verticalScrollBar && verticalScrollBar.visible)
+// _viewMetrics.right += verticalScrollBar.minWidth;
+//
+// if (horizontalScrollBar && horizontalScrollBar.visible)
+// _viewMetrics.bottom += horizontalScrollBar.minHeight;
+//
+// return _viewMetrics;
+// }
+
+ //----------------------------------
+ // verticalScrollPosition
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the verticalScrollPosition property.
+ */
+// mx_internal var _verticalScrollPosition:Number = 0;
+
+// [Bindable("scroll")]
+// [Bindable("viewChanged")]
+// [Inspectable(defaultValue="0")]
+
+ /**
+ * The offset into the content from the top edge. This can
+ * be a pixel offset in some subclasses or some other metric
+ * like number of lines in a List or number of tiles in
+ * a TileList.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get verticalScrollPosition():Number
+// {
+// return _verticalScrollPosition;
+// }
+
+ /**
+ * @private
+ */
+// public function set verticalScrollPosition(value:Number):void
+// {
+// _verticalScrollPosition = value;
+//
+// if (verticalScrollBar)
+// verticalScrollBar.scrollPosition = value;
+//
+// dispatchEvent(new Event("viewChanged"));
+// }
+
+ //----------------------------------
+ // verticalScrollPolicy
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the verticalScrollPolicy property.
+ */
+// mx_internal var _verticalScrollPolicy:String = ScrollPolicy.AUTO;
+
+// [Bindable("verticalScrollPolicyChanged")]
+// [Inspectable(enumeration="off,on,auto", defaultValue="auto")]
+
+ /**
+ * A property that indicates whether the vertical scroll bar is always on, always off,
+ * or automatically changes based on the parameters passed to the
+ * <code>setScrollBarProperties()</code> method.
+ * Allowed values are <code>ScrollPolicy.ON</code>,
+ * <code>ScrollPolicy.OFF</code>, and <code>ScrollPolicy.AUTO</code>.
+ * MXML values can be <code>"on"</code>, <code>"off"</code>,
+ * and <code>"auto"</code>.
+ *
+ * <p>Setting this property to <code>ScrollPolicy.OFF</code> for ListBase
+ * subclasses does not affect the <code>verticalScrollPosition</code>
+ * property; you can still scroll the contents programmatically.</p>
+ *
+ * <p>Note that the policy can affect the measured size of the component
+ * If the policy is <code>ScrollPolicy.AUTO</code> the
+ * scrollbar is not factored in the measured size. This is done to
+ * keep the layout from recalculating when the scrollbar appears. If you
+ * know that you will have enough data for scrollbars you should set
+ * the policy to <code>ScrollPolicy.ON</code>. If you
+ * don't know, you may need to set an explicit width or height on
+ * the component to allow for scrollbars to appear later.</p>
+ *
+ * @default ScrollPolicy.AUTO
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// public function get verticalScrollPolicy():String
+// {
+// return _verticalScrollPolicy;
+// }
+
+ /**
+ * @private
+ */
+// public function set verticalScrollPolicy(value:String):void
+// {
+// var newPolicy:String = value.toLowerCase();
+//
+// if (_verticalScrollPolicy != newPolicy)
+// {
+// _verticalScrollPolicy = newPolicy;
+// invalidateDisplayList();
+//
+// dispatchEvent(new Event("verticalScrollPolicyChanged"));
+// }
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates objects that are children of this ScrollControlBase,
+ * which in this case are the border and mask.
+ * Flex calls this method when the ScrollControlBase is first created.
+ * If a subclass overrides this method, the subclass should call
+ * the <code>super.createChildren()</code> method so that the logic
+ * in the <code>ScrollControlBase.createChildren()</code> method is executed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override protected function createChildren():void
+// {
+// super.createChildren();
+//
+// createBorder();
+//
+// if (!maskShape)
+// {
+// maskShape = new FlexShape();
+// maskShape.name = "mask";
+//
+// var g:Graphics = maskShape.graphics;
+// g.beginFill(0xFFFFFF);
+// g.drawRect(0, 0, 10, 10);
+// g.endFill();
+//
+// addChild(maskShape);
+// }
+//
+// maskShape.visible = false;
+// }
+
+ /**
+ * @private
+ * Sets the position and size of the scroll bars and content
+ * and adjusts the mask.
+ */
+// override protected function updateDisplayList(unscaledWidth:Number,
+// unscaledHeight:Number):void
+// {
+// super.updateDisplayList(unscaledWidth, unscaledHeight);
+//
+// layoutChrome(unscaledWidth, unscaledHeight);
+//
+// var w:Number = unscaledWidth;
+// var h:Number = unscaledHeight;
+//
+// invLayout = false;
+//
+// var vm:EdgeMetrics = _viewMetrics = viewMetrics;
+//
+// if (horizontalScrollBar && horizontalScrollBar.visible)
+// {
+// horizontalScrollBar.setActualSize(w - vm.left - vm.right,
+// horizontalScrollBar.minHeight);
+// horizontalScrollBar.move(vm.left,
+// h - vm.bottom);
+//
+// horizontalScrollBar.enabled = enabled;
+// }
+//
+// if (verticalScrollBar && verticalScrollBar.visible)
+// {
+// verticalScrollBar.setActualSize(verticalScrollBar.minWidth,
+// h - vm.top - vm.bottom);
+// verticalScrollBar.move(w - vm.right, vm.top);
+//
+// verticalScrollBar.enabled = enabled;
+// }
+//
+// var mask:DisplayObject = maskShape;
+//
+// var wd:Number = w - vm.left - vm.right;
+// var ht:Number = h - vm.top - vm.bottom;
+//
+// mask.width = wd < 0 ? 0 : wd;
+// mask.height = ht < 0 ? 0 : ht;
+//
+// mask.x = vm.left;
+// mask.y = vm.top;
+// }
+
+ /**
+ * @private
+ */
+// override public function styleChanged(styleProp:String):void
+// {
+// var allStyles:Boolean = (styleProp == null || styleProp == "styleName");
+//
+// super.styleChanged(styleProp);
+//
+// if (allStyles || styleProp == "horizontalScrollBarStyleName")
+// {
+// if (horizontalScrollBar)
+// {
+// var horizontalScrollBarStyleName:String =
+// getStyle("horizontalScrollBarStyleName");
+// horizontalScrollBar.styleName = horizontalScrollBarStyleName;
+// }
+// }
+//
+// if (allStyles || styleProp == "verticalScrollBarStyleName")
+// {
+// if (verticalScrollBar)
+// {
+// var verticalScrollBarStyleName:String =
+// getStyle("verticalScrollBarStyleName");
+// verticalScrollBar.styleName = verticalScrollBarStyleName;
+// }
+// }
+//
+// // Replace the borderSkin
+// if (allStyles || styleProp == "borderSkin")
+// {
+// if (border)
+// {
+// removeChild(DisplayObject(border));
+// border = null;
+// createBorder();
+// }
+// }
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Responds to size changes by setting the positions and sizes
+ * of this control's borders.
+ *
+ * <p>The <code>ScrollControlBase.layoutChrome()</code> method sets the
+ * position and size of the ScrollControlBase's border.
+ * In every subclass of ScrollControlBase, the subclass's <code>layoutChrome()</code>
+ * method should call the <code>super.layoutChrome()</code> method,
+ * so that the border is positioned properly.</p>
+ *
+ * @param unscaledWidth Specifies the width of the component, in pixels,
+ * in the component's coordinates, regardless of the value of the
+ * <code>scaleX</code> property of the component.
+ *
+ * @param unscaledHeight Specifies the height of the component, in pixels,
+ * in the component's coordinates, regardless of the value of the
+ * <code>scaleY</code> property of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected function layoutChrome(unscaledWidth:Number,
+// unscaledHeight:Number):void
+// {
+// // Border covers the whole thing.
+// if (border)
+// {
+// border.move(0, 0);
+// border.setActualSize(unscaledWidth, unscaledHeight);
+// }
+// }
+
+ /**
+ * Creates the border for this component.
+ * Normally the border is determined by the
+ * <code>borderStyle</code> and <code>borderSkin</code> styles.
+ * It must set the border property to the instance
+ * of the border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected function createBorder():void
+// {
+// if (!border && isBorderNeeded())
+// {
+// var borderClass:Class = getStyle("borderSkin");
+//
+// if (borderClass != null)
+// {
+// border = new borderClass();
+//
+// if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+// {
+// if (border is IUIComponent)
+// IUIComponent(border).enabled = enabled;
+// }
+// if (border is ISimpleStyleClient)
+// ISimpleStyleClient(border).styleName = this;
+//
+// // Add the border behind all the children.
+// addChildAt(DisplayObject(border), 0);
+//
+// invalidateDisplayList();
+// }
+// }
+// }
+
+ /**
+ * Returns <code>true</code> if a border is needed for this component based
+ * on the borderStyle and whether or not there is a background
+ * for the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// private function isBorderNeeded():Boolean
+// {
+// //trace("isBorderNeeded",this,"ms",getStyle("mouseShield"),"borderStyle",getStyle("borderStyle"));
+//
+// var v:Object = getStyle("borderStyle");
+// if (v)
+// {
+// // If borderStyle is "none", then only create a border if the mouseShield style is true
+// // (meaning that there is a mouse event listener on this view). We don't create a border
+// // if our parent's mouseShieldChildren style is true.
+// if ((v != "none") || (v == "none" && getStyle("mouseShield")))
+// {
+// return true;
+// }
+// }
+//
+// v = getStyle("backgroundColor");
+// if (v !== null && v !== "")
+// return true;
+//
+// v = getStyle("backgroundImage");
+// return v != null && v != "";
+// }
+
+ /**
+ * Causes the ScrollControlBase to show or hide scrollbars based
+ * on the parameters passed in. If a TextArea can only show 100 pixels
+ * across and 5 lines of text, but the actual text to display is 200 pixels wide
+ * and 30 lines of text, then the <code>setScrollBarProperties()</code> method
+ * is called as
+ * <code>setScrollBarProperties(200, 100, 30, 5)</code>.
+ *
+ * @param totalColumns The number of horizontal units that need to be displayed.
+ *
+ * @param visibleColumns The number of horizontal units that can be displayed at one time.
+ *
+ * @param totalRows The number of vertical units that need to be displayed.
+ *
+ * @param visibleRows The number of vertical units that can be displayed at one time
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected function setScrollBarProperties(totalColumns:int, visibleColumns:int,
+// totalRows:int, visibleRows:int):void
+// {
+// var horizontalScrollPolicy:String = this.horizontalScrollPolicy;
+// var verticalScrollPolicy:String = this.verticalScrollPolicy;
+//
+// var shouldBeVisible:Boolean;
+//
+// scrollAreaChanged = false;
+//
+// // scrollbars when the scrollPolicy is ON are calculated in viewMetrics
+// if (horizontalScrollPolicy == ScrollPolicy.ON ||
+// (visibleColumns < totalColumns && totalColumns > 0 &&
+// (horizontalScrollPolicy == ScrollPolicy.AUTO)))
+// {
+// // We need a horizontal scrollBar.
+//
+// // Nope, need to add it.
+// if (!horizontalScrollBar)
+// {
+// createHScrollBar(false);
+//
+// horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler);
+// horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler);
+//
+// horizontalScrollBar.scrollPosition = _horizontalScrollPosition;
+// }
+//
+// shouldBeVisible = roomForScrollBar(horizontalScrollBar, unscaledWidth, unscaledHeight);
+//
+// if (shouldBeVisible != horizontalScrollBar.visible)
+// {
+// horizontalScrollBar.visible = shouldBeVisible;
+// scrollAreaChanged = true;
+// }
+//
+// if (horizontalScrollBar && horizontalScrollBar.visible && (numberOfCols != totalColumns ||
+// viewableColumns != visibleColumns || scrollAreaChanged))
+// {
+// horizontalScrollBar.setScrollProperties(
+// visibleColumns, 0, totalColumns - visibleColumns);
+//
+// if (horizontalScrollBar.scrollPosition != _horizontalScrollPosition)
+// horizontalScrollBar.scrollPosition = _horizontalScrollPosition;
+//
+// viewableColumns = visibleColumns;
+// numberOfCols = totalColumns;
+// }
+// }
+// else if ((horizontalScrollPolicy == ScrollPolicy.AUTO ||
+// horizontalScrollPolicy == ScrollPolicy.OFF) &&
+// horizontalScrollBar && horizontalScrollBar.visible)
+// {
+// // We need to remove this scrollBar.
+// horizontalScrollPosition = 0;
+// horizontalScrollBar.setScrollProperties(
+// visibleColumns, 0, 0);
+// horizontalScrollBar.visible = false;
+// viewableColumns = NaN;
+// scrollAreaChanged = true;
+// }
+//
+// if (verticalScrollPolicy == ScrollPolicy.ON ||
+// (visibleRows < totalRows && totalRows > 0 &&
+// (verticalScrollPolicy == ScrollPolicy.AUTO)))
+// {
+// // We need a vertical scrollBar. Does it exist?
+// if (!verticalScrollBar)
+// {
+// // No it doesn't, and we're allowed to add it.
+// createVScrollBar(false);
+//
+// verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollHandler);
+// verticalScrollBar.addEventListener(ScrollEvent.SCROLL, scrollTipHandler);
+//
+// verticalScrollBar.scrollPosition = _verticalScrollPosition;
+// }
+//
+// shouldBeVisible = roomForScrollBar(verticalScrollBar, unscaledWidth, unscaledHeight);
+//
+// if (shouldBeVisible != verticalScrollBar.visible)
+// {
+// verticalScrollBar.visible = shouldBeVisible;
+// scrollAreaChanged = true;
+// }
+//
+// if (verticalScrollBar && verticalScrollBar.visible && (numberOfRows != totalRows ||
+// (viewableRows != visibleRows) || scrollAreaChanged))
+// {
+// verticalScrollBar.setScrollProperties(
+// visibleRows, 0, totalRows - visibleRows);
+//
+// if (verticalScrollBar.scrollPosition != _verticalScrollPosition)
+// verticalScrollBar.scrollPosition = _verticalScrollPosition;
+//
+// viewableRows = visibleRows;
+// numberOfRows = totalRows;
+// }
+// }
+// else if ((verticalScrollPolicy == ScrollPolicy.AUTO ||
+// verticalScrollPolicy == ScrollPolicy.OFF) &&
+// verticalScrollBar && verticalScrollBar.visible)
+// {
+// verticalScrollPosition = 0;
+// verticalScrollBar.setScrollProperties(
+// visibleRows, 0, 0);
+// verticalScrollBar.visible = false;
+// viewableRows = NaN;
+// scrollAreaChanged = true;
+// }
+//
+// // Now, if any scrollBar came into or left existence,
+// // it's possible that the content is occluded or revealed enough
+// // that the other scrollBar needs to appear or go away.
+// if (scrollAreaChanged)
+// {
+// // This is for content that conforms to the (discrete)
+// // scrollable interface. It just falls through on analog content.
+// // (I hope.)
+// updateDisplayList(unscaledWidth, unscaledHeight);
+// }
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Private methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Create the HScrollBar
+ */
+// private function createHScrollBar(visible:Boolean):ScrollBar
+// {
+// horizontalScrollBar = new HScrollBar();
+// horizontalScrollBar.visible = visible;
+// horizontalScrollBar.enabled = enabled;
+//
+// var horizontalScrollBarStyleName:String =
+// getStyle("horizontalScrollBarStyleName");
+// horizontalScrollBar.styleName = horizontalScrollBarStyleName;
+//
+// // Place the new scrollbar in front of other children
+// // in the ScrollControlBase
+// addChild(horizontalScrollBar);
+//
+// horizontalScrollBar.validateNow();
+//
+// return horizontalScrollBar;
+// }
+
+ /**
+ * @private
+ * Create the VScrollBar
+ */
+// private function createVScrollBar(visible:Boolean):ScrollBar
+// {
+// verticalScrollBar = new VScrollBar();
+// verticalScrollBar.visible = visible;
+// verticalScrollBar.enabled = enabled;
+//
+// var verticalScrollBarStyleName:String =
+// getStyle("verticalScrollBarStyleName");
+// verticalScrollBar.styleName = verticalScrollBarStyleName;
+//
+// // Place the new scrollbar in front of other children
+// // in the ScrollControlBase
+// addChild(verticalScrollBar);
+//
+// //need verticalScrollBar.validateNow()?
+// UIComponentGlobals.layoutManager.validateClient(verticalScrollBar, true);
+//
+// return verticalScrollBar;
+// }
+
+ /**
+ * Determines if there is enough space in this component to display
+ * a given scrollbar.
+ *
+ * @param bar The scrollbar
+ *
+ * @param unscaledWidth Specifies the width of the component, in pixels,
+ * in the component's coordinates, regardless of the value of the
+ * <code>scaleX</code> property of the component.
+ *
+ * @param unscaledHeight Specifies the height of the component, in pixels,
+ * in the component's coordinates, regardless of the value of the
+ * <code>scaleY</code> property of the component.
+ *
+ * @return Returns true if there is enough space for a scrollbar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+
+// protected function roomForScrollBar(bar:ScrollBar,
+// unscaledWidth:Number, unscaledHeight:Number):Boolean
+// {
+// var bm:EdgeMetrics = borderMetrics;
+// return (unscaledWidth >= bar.minWidth + bm.left + bm.right) &&
+// (unscaledHeight >= bar.minHeight + bm.top + bm.bottom)
+// }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Default event handler for the <code>scroll</code> event.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected function scrollHandler(event:Event):void
+// {
+// // TextField.scroll bubbles so you might see it here
+// if (event is ScrollEvent)
+// {
+// var scrollBar:ScrollBar = ScrollBar(event.target);
+//
+// var pos:Number = scrollBar.scrollPosition;
+//
+// var prop:QName;
+// if (scrollBar == verticalScrollBar)
+// prop = new QName(mx_internal, "_verticalScrollPosition");
+// else if (scrollBar == horizontalScrollBar)
+// prop = new QName(mx_internal, "_horizontalScrollPosition");
+//
+// dispatchEvent(event);
+//
+// if (prop)
+// this[prop] = pos;
+// }
+// }
+
+ /**
+ * @private
+ */
+// private function scrollTipHandler(event:Event):void
+// {
+// // TextField.scroll bubbles so you might see it here
+// if (event is ScrollEvent)
+// {
+// if (!showScrollTips)
+// return;
+//
+// if (ScrollEvent(event).detail == ScrollEventDetail.THUMB_POSITION)
+// {
+// if (scrollTip)
+// {
+// ToolTipManager.destroyToolTip(scrollTip);
+// scrollTip = null;
+// ToolTipManager.enabled = oldTTMEnabled;
+// }
+// }
+// else if (ScrollEvent(event).detail == ScrollEventDetail.THUMB_TRACK)
+// {
+// var scrollBar:ScrollBar = ScrollBar(event.target);
+// var isVertical:Boolean = scrollBar == verticalScrollBar;
+// var dir:String = isVertical ? "vertical" : "horizontal";
+// var pos:Number = scrollBar.scrollPosition;
+//
+// if (!scrollTip)
+// {
+// scrollTip = ToolTipManager.createToolTip("", 0, 0, null, this);
+// scrollThumbMidPoint = scrollBar.scrollThumb.height / 2;
+// oldTTMEnabled = ToolTipManager.enabled;
+// ToolTipManager.enabled = false;
+// }
+//
+// var tip:String = pos.toString();
+//
+// if (_scrollTipFunction != null)
+// tip = _scrollTipFunction(dir, pos);
+//
+// if (tip == "")
+// {
+// scrollTip.visible = false;
+// }
+// else
+// {
+// scrollTip.text = tip;
+//
+// ToolTipManager.sizeTip(scrollTip);
+//
+// var pt:Point = new Point();
+// if (isVertical)
+// {
+// pt.x = -3 - scrollTip.width;
+// pt.y = scrollBar.scrollThumb.y + scrollThumbMidPoint -
+// scrollTip.height / 2;
+// }
+// else
+// {
+// // The scrollbar is rotated so we kind of reverse things
+// // around with width and height.
+// pt.x = -3 - scrollTip.height;
+// pt.y = scrollBar.scrollThumb.y + scrollThumbMidPoint -
+// scrollTip.width / 2;
+// }
+// pt = scrollBar.localToGlobal(pt);
+// scrollTip.move(pt.x, pt.y);
+//
+// scrollTip.visible = true;
+// }
+// }
+// }
+// }
+
+ /**
+ * Event handler for the mouse wheel scroll event.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// protected function mouseWheelHandler(event:MouseEvent):void
+// {
+// // If this Container has a vertical scrollbar,
+// // then handle the event and prevent further bubbling.
+// if (verticalScrollBar && verticalScrollBar.visible && !event.isDefaultPrevented())
+// {
+// var scrollDirection:int = event.delta <= 0 ? 1 : -1;
+//
+// // Make sure we scroll by at least one line
+// var scrollAmount:Number = Math.max(Math.abs(event.delta),
+// verticalScrollBar.lineScrollSize);
+//
+// // Multiply by 3 to make scrolling a little faster
+// var oldPosition:Number = verticalScrollPosition;
+// verticalScrollPosition += 3 * scrollAmount * scrollDirection;
+//
+// var scrollEvent:ScrollEvent = new ScrollEvent(ScrollEvent.SCROLL);
+// scrollEvent.direction = ScrollEventDirection.VERTICAL;
+// scrollEvent.position = verticalScrollPosition;
+// scrollEvent.delta = verticalScrollPosition - oldPosition;
+// dispatchEvent(scrollEvent);
+//
+// event.preventDefault();
+// }
+// }
+
+ /**
+ * @private
+ */
+// mx_internal function get scroll_verticalScrollBar():ScrollBar
+// {
+// return verticalScrollBar;
+// }
+
+ /**
+ * @private
+ */
+// mx_internal function get scroll_horizontalScrollBar():ScrollBar
+// {
+// return horizontalScrollBar;
+// }
+}
+}
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 dec5367..606fe31 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -442,7 +442,7 @@ public class UIComponent extends UIBase
/**
* @private
*/
- private var _enabled:Boolean = false;
+ private var _enabled:Boolean = true;
[Inspectable(category="General", enumeration="true,false", defaultValue="true")]
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/events/ScrollEvent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/events/ScrollEvent.as
new file mode 100644
index 0000000..4a6a8dc
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/ScrollEvent.as
@@ -0,0 +1,217 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flash.events.Event;
+import org.apache.royale.events.Event;
+
+/**
+ * Represents events that are dispatched by the ScrollBar class.
+ *
+ * @see mx.core.UIComponent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ScrollEvent extends Event
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>ScrollEvent.SCROLL</code> constant defines the value of the
+ * <code>type</code> property of the event object for a scroll 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>delta</code></td><td>Contains the change
+ * in scroll position, expressed in pixels. A positive value indicates the
+ * scroll was down or to the right. A negative value indicates the scroll
+ * was up or to the left.</td></tr>
+ * <tr><td><code>direction</code></td><td>Contains the
+ * scroll direction, either <code>ScrollEventDirection.HORIZONTAL</code> or
+ * <code>ScrollEventDirection.VERTICAL</code>.</td></tr>
+ * <tr><td><code>position</code></td><td>Contains the
+ * new scroll position.</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 scroll
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const SCROLL:String = "scroll";
+
+ //--------------------------------------------------------------------------
+ //
+ // 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 detail Provides the specifics of the type of scroll activity.
+ * Constants for the possible values are provided
+ * in the ScrollEventDetail class.
+ *
+ * @param position The new scroll position.
+ *
+ * @param direction The scroll direction,
+ * either <code>ScrollEventDirection.HORIZONTAL</code> or
+ * <code>ScrollEventDirection.VERTICAL</code>.
+ *
+ * @param delta The change in scroll position, expressed in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ScrollEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ detail:String = null, position:Number = NaN,
+ direction:String = null, delta:Number = NaN)
+ {
+ super(type, bubbles, cancelable);
+
+ this.detail = detail;
+ this.position = position;
+ this.direction = direction;
+ this.delta = delta;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // delta
+ //----------------------------------
+
+ /**
+ * The change in the scroll position value that resulted from
+ * the scroll. The value is expressed in pixels. A positive value indicates the
+ * scroll was down or to the right. A negative value indicates the scroll
+ * was up or to the left.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var delta:Number;
+
+ //----------------------------------
+ // detail
+ //----------------------------------
+
+ /**
+ * Provides the details of the scroll activity.
+ * Constants for the possible values are provided
+ * in the ScrollEventDetail class.
+ *
+ * @see mx.events.ScrollEventDetail
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var detail:String;
+
+ //----------------------------------
+ // direction
+ //----------------------------------
+
+ /**
+ * The direction of motion.
+ * The possible values are <code>ScrollEventDirection.VERTICAL</code>
+ * or <code>ScrollEventDirection.HORIZONTAL</code>.
+ *
+ * @see mx.events.ScrollEventDirection
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var direction:String;
+
+ //----------------------------------
+ // position
+ //----------------------------------
+
+ /**
+ * The new scroll position.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var position:Number;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function clone():Event
+ {
+ return new ScrollEvent(type, bubbles, cancelable,
+ detail, position, direction, delta);
+ }
+}
+
+}
--
To stop receiving notification emails like this one, please contact
pent@apache.org.