You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/03/03 10:45:19 UTC

[royale-asjs] branch develop updated: jewel togglebutton: add selectedText property

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

carlosrovira 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 edc384c  jewel togglebutton: add selectedText property
edc384c is described below

commit edc384c63b50bd38b35d77d5a4eac93c851de12a
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Mar 3 11:45:07 2019 +0100

    jewel togglebutton: add selectedText property
---
 .../royale/org/apache/royale/jewel/ToggleButton.as | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
index 2198ea8..53fa703 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
@@ -133,6 +133,25 @@ package org.apache.royale.jewel
             }
         }
 
+        private var _selectedText:String = "";
+        /**
+         *  The selectedText of the icon
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.3
+         */
+		public function get selectedText():String
+		{
+            return _selectedText;            
+		}
+        public function set selectedText(value:String):void
+		{
+            _selectedText = value;
+            internalSelected();
+		}
+
         COMPILE::JS
         override protected function createElement():WrappedHTMLElement
         {
@@ -185,6 +204,11 @@ package org.apache.royale.jewel
                var selectableIcon:ISelectable = icon as ISelectable;
                selectableIcon.selected = _selected;
             }
+
+            COMPILE::JS
+			{
+                textNode.nodeValue = _selected ? selectedText : text;	
+			}
         }
 
         override public function set icon(value:IIcon):void