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/29 04:56:22 UTC

[royale-asjs] 02/02: get VRule working

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 16b6feae609a4b00ea8b87b5c2d5081ecdc6563b
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Sep 28 21:56:04 2018 -0700

    get VRule working
---
 .../MXRoyale/src/main/royale/mx/controls/VRule.as  | 43 +++++++++++++++++-----
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/VRule.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/VRule.as
index 6a497a8..bf31013 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/VRule.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/VRule.as
@@ -23,6 +23,8 @@ package mx.controls
 /* import flash.display.Graphics;*/
 import mx.core.UIComponent;
 
+import org.apache.royale.core.SimpleCSSStyles;
+
 //--------------------------------------
 //  Styles
 //--------------------------------------
@@ -85,7 +87,7 @@ import mx.core.UIComponent;
  *  @playerversion AIR 1.1
  *  @productversion Flex 3
  */
-[Style(name="strokeWidth", type="Number", format="Length", inherit="yes")]
+//[Style(name="strokeWidth", type="Number", format="Length", inherit="yes")]
     // Note: stroke-width is inheriting in SVG,
     // although border-width is not inheriting in CSS
 
@@ -177,23 +179,44 @@ public class VRule extends UIComponent
         super();
     }
 
+    private var _strokeWidth:int = 1;
+    public function get strokeWidth():int
+    {
+        return _strokeWidth;
+    }
+    public function set strokeWidth(value:int):void
+    {
+        _strokeWidth = value;
+    }
+    
+    override public function addedToParent():void
+    {
+        var values:Object = {
+            styleList : { "borderLeftStyle" : 1,
+                          "borderLeftWidth" : 1,
+                          "borderLeftColor" : 1 },
+            "borderLeftWidth" : strokeWidth.toString() + "px",
+            "borderLeftStyle" : "solid",
+            "borderLeftColor" : "#000"
+        }
+        style = values;
+        super.addedToParent();
+    }
     //--------------------------------------------------------------------------
     //
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
 
-    /**
-     *  @private
-     */
-    override protected function measure():void
+    override public function get measuredWidth():Number
     {
-        super.measure();
-
-        measuredWidth = getStyle("strokeWidth");
-        measuredHeight = DEFAULT_PREFERRED_HEIGHT;
+        return strokeWidth;
     }
-
+    override public function get measuredHeight():Number
+    {
+        return DEFAULT_PREFERRED_HEIGHT;
+    }
+    
     /**
      *  @private
      *  The appearance of our vertical rule is inspired by