You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/09/21 18:09:28 UTC

[royale-asjs] branch develop updated (af0233e -> 4029f81)

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from af0233e  Added onClose event to MDL Dialog
     new 4ef95ab  get verticalScrollPosition working for TextArea
     new 4029f81  I guess the Royale header is one line shorter

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 examples/mxroyale/tourdeflexmodules/src/SourceTab.mxml   |  2 +-
 .../MXRoyale/src/main/royale/mx/controls/TextArea.as     |  4 ++++
 .../src/main/royale/mx/core/ScrollControlBase.as         | 16 ++++++++++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)


[royale-asjs] 01/02: get verticalScrollPosition working for TextArea

Posted by ah...@apache.org.
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

commit 4ef95ab253271e672efa510fc251eca6f04c5448
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Sep 21 11:08:52 2018 -0700

    get verticalScrollPosition working for TextArea
---
 .../MXRoyale/src/main/royale/mx/controls/TextArea.as     |  4 ++++
 .../src/main/royale/mx/core/ScrollControlBase.as         | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

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 8a8296b..6495bc8 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/TextArea.as
@@ -23,6 +23,7 @@ COMPILE::JS {
 	import goog.events;
 	import org.apache.royale.core.WrappedHTMLElement;
 	import org.apache.royale.html.util.addElementToWrapper;
+    import org.apache.royale.utils.CSSUtils;
 }
 COMPILE::SWF
 {
@@ -1750,6 +1751,9 @@ public class TextArea extends ScrollControlBase
 		COMPILE::JS
 		{
 			(element as HTMLTextAreaElement).value = value;
+            verticalScrollSize = CSSUtils.toNumber(getComputedStyle(element).lineHeight.toString(), width);
+            if (verticalScrollPosition)
+                element.scrollTop = verticalScrollPosition * verticalScrollSize;
 			dispatchEvent(new Event('textChange'));
 		}
 //        textSet = true;
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 4c5901a..3c795ae 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
@@ -387,6 +387,10 @@ public class ScrollControlBase extends UIComponent
 //        if (horizontalScrollBar)
 //            horizontalScrollBar.scrollPosition = value;
 
+        COMPILE::JS
+        {
+            element.scrollLeft = value;
+        }
         dispatchEvent(new Event("viewChanged"));
     }
 
@@ -690,6 +694,14 @@ public class ScrollControlBase extends UIComponent
      */
     mx_internal var _verticalScrollPosition:Number = 0;
 
+    /**
+     *  @private
+     *  Storage for the verticalScrollSize property.
+     *  Flex scrolls by step sizes other than pixels.  TextArea
+     *  scrolls by lines of text, Lists scroll by itemRendererIndex
+     */
+    protected var verticalScrollSize:Number = 1;
+    
     [Bindable("scroll")]
     [Bindable("viewChanged")]
     [Inspectable(defaultValue="0")]
@@ -722,6 +734,10 @@ public class ScrollControlBase extends UIComponent
 //        if (verticalScrollBar)
 //            verticalScrollBar.scrollPosition = value;
 
+        COMPILE::JS
+        {
+            element.scrollTop = value * verticalScrollSize;
+        }
         dispatchEvent(new Event("viewChanged"));
     }
 


[royale-asjs] 02/02: I guess the Royale header is one line shorter

Posted by ah...@apache.org.
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

commit 4029f81789cbded63456a94e63aa1b0084246c34
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Sep 21 11:09:09 2018 -0700

    I guess the Royale header is one line shorter
---
 examples/mxroyale/tourdeflexmodules/src/SourceTab.mxml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/mxroyale/tourdeflexmodules/src/SourceTab.mxml b/examples/mxroyale/tourdeflexmodules/src/SourceTab.mxml
index bb75b9f..51c4b6c 100755
--- a/examples/mxroyale/tourdeflexmodules/src/SourceTab.mxml
+++ b/examples/mxroyale/tourdeflexmodules/src/SourceTab.mxml
@@ -43,7 +43,7 @@
         {
             srv.url = src;
             srv.send();
-			ta.verticalScrollPosition = 19; // at end of header
+			ta.verticalScrollPosition = 18; // at end of header
         }
 
         private function resultHandler(event:ResultEvent):void