This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new a01768b a few tweaks to allow LineNumberTextDisplay in #598
a01768b is described below
commit a01768b59caa0dc87125820b09ed465486f2f2fd
Author: Alex Harui <[email protected]>
AuthorDate: Wed Jan 22 18:24:43 2020 -0800
a few tweaks to allow LineNumberTextDisplay in #598
---
.../src/main/royale/mx/controls/TextArea.as | 78 ++++++++++++----------
.../MXRoyale/src/main/royale/mx/core/Container.as | 5 +-
.../src/main/royale/mx/core/ScrollControlBase.as | 3 +-
3 files changed, 48 insertions(+), 38 deletions(-)
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
index 6495bc8..895e8d6 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
@@ -1542,23 +1542,28 @@ public class TextArea extends ScrollControlBase
* @playerversion AIR 1.1
* @productversion Flex 3
*/
-// public function get selectionBeginIndex():int
-// {
-// return textField ?
-// textField.selectionBeginIndex :
-// _selectionBeginIndex;
-// }
+ public function get selectionBeginIndex():int
+ {
+ COMPILE::JS
+ {
+ return (element as HTMLTextAreaElement).selectionStart;
+ }
+ COMPILE::SWF
+ {
+ return 0;
+ }
+ }
/**
* @private
*/
-// public function set selectionBeginIndex(value:int):void
-// {
-// _selectionBeginIndex = value;
-// selectionChanged = true;
-//
-// invalidateProperties();
-// }
+ public function set selectionBeginIndex(value:int):void
+ {
+ COMPILE::JS
+ {
+ (element as HTMLTextAreaElement).selectionStart = value;
+ }
+ }
//----------------------------------
// selectionEndIndex
@@ -1592,23 +1597,28 @@ public class TextArea extends ScrollControlBase
* @playerversion AIR 1.1
* @productversion Flex 3
*/
-// public function get selectionEndIndex():int
-// {
-// return textField ?
-// textField.selectionEndIndex :
-// _selectionEndIndex;
-// }
+ public function get selectionEndIndex():int
+ {
+ COMPILE::JS
+ {
+ return (element as HTMLTextAreaElement).selectionEnd;
+ }
+ COMPILE::SWF
+ {
+ return 0;
+ }
+ }
/**
* @private
*/
-// public function set selectionEndIndex(value:int):void
-// {
-// _selectionEndIndex = value;
-// selectionChanged = true;
-//
-// invalidateProperties();
-// }
+ public function set selectionEndIndex(value:int):void
+ {
+ COMPILE::JS
+ {
+ (element as HTMLTextAreaElement).selectionEnd = value;
+ }
+ }
//----------------------------------
// styleSheet
@@ -2308,14 +2318,14 @@ public class TextArea extends ScrollControlBase
* @playerversion AIR 1.1
* @productversion Flex 3
*/
-// public function setSelection(beginIndex:int, endIndex:int):void
-// {
-// _selectionBeginIndex = beginIndex;
-// _selectionEndIndex = endIndex;
-// selectionChanged = true;
-//
-// invalidateProperties();
-// }
+ public function setSelection(beginIndex:int, endIndex:int):void
+ {
+ COMPILE::JS
+ {
+ selectionBeginIndex = beginIndex;
+ selectionEndIndex = endIndex;
+ }
+ }
/**
* @private
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
index bd43f9e..58d78b7 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -638,12 +638,11 @@ public class Container extends UIComponent
public function get horizontalGap():Object
{
- trace("horizontalGap not implemented");
- return 0;
+ return getStyle("horizontalGap");
}
public function set horizontalGap(value:Object):void
{
- trace("horizontalGap not implemented");
+ setStyle("horizontalGap", value);
}
public function get verticalAlign():Object
{
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
index cf56df3..4e24ed4 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
@@ -1482,7 +1482,8 @@ public class ScrollControlBase extends UIComponent
super.addedToParent();
if (_horizontalScrollPolicy == ScrollPolicy.OFF)
element.style["overflow-x"] = "hidden";
-
+ if (_verticalScrollPolicy == ScrollPolicy.OFF)
+ element.style["overflow-y"] = "hidden";
}
}
}