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

Harbs 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 7e8e8b816e Don't base these on Button because we don't need type and 
friends
7e8e8b816e is described below

commit 7e8e8b816e11f4890ff8ba7357a9528f739581db
Author: Harbs <[email protected]>
AuthorDate: Mon May 18 12:45:51 2026 +0300

    Don't base these on Button because we don't need type and friends
---
 .../royale/org/apache/royale/style/IconButton.as   | 46 ++++++++++++++++++---
 .../royale/org/apache/royale/style/TextButton.as   | 47 +++++++++++++++++++++-
 2 files changed, 85 insertions(+), 8 deletions(-)

diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IconButton.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IconButton.as
index 44151a27ae..c278f0f91e 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IconButton.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/IconButton.as
@@ -18,13 +18,13 @@
 
/////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.style
 {
-       import org.apache.royale.style.elements.Button;
+       import org.apache.royale.style.support.NodeElementBase;
 
        /**
         *  A styled Button component that contains only an icon.
         *  Does not support text.
         */
-       public class IconButton extends org.apache.royale.style.elements.Button
+       public class IconButton extends NodeElementBase
        {
                public function IconButton()
                {
@@ -42,13 +42,41 @@ package org.apache.royale.style
                                this.addElementAt(icon, 0);
                        }
                }
-               override public function set disabled(value:Boolean):void
+               COMPILE::SWF
+               private var _disabled:Boolean;
+               COMPILE::JS
+               private function get button():HTMLButtonElement
                {
-                       super.disabled = value;
-                       if (icon)
-                               icon.toggleAttribute("data-disabled", value);
+                       return element as HTMLButtonElement;
+               }
+
+               public function get disabled():Boolean
+               {
+                       COMPILE::SWF
+                       {
+                               return _disabled;
+                       }
 
+                       COMPILE::JS
+                       {
+                               return button.disabled;
+                       }
                }
+               public function set disabled(value:Boolean):void
+               {
+                       COMPILE::SWF
+                       {
+                               _disabled = value;
+                       }
+                       COMPILE::JS
+                       {
+                               button.disabled = value;
+                               if (icon)
+                                       icon.toggleAttribute("data-disabled", 
value);
+                       }
+               }
+
+
                private var _icon:IIcon;
                public function get icon():IIcon
                {
@@ -58,6 +86,12 @@ package org.apache.royale.style
                public function set icon(value:IIcon):void
                {
                        _icon = value;
+                       if(disabled)
+                               _icon.toggleAttribute("data-disabled", true);
+               }
+               override protected function getTag():String
+               {
+                       return "button";
                }
        }
 }
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/TextButton.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/TextButton.as
index 9b24290eb3..5c09bc7090 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/TextButton.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/TextButton.as
@@ -22,13 +22,13 @@ package org.apache.royale.style
        {
                import org.apache.royale.core.WrappedHTMLElement;
        }
-       import org.apache.royale.style.elements.Button;
+       import org.apache.royale.style.support.NodeElementBase;
 
        /**
         *  A styled Button component that contains only text.
         *  Does not support icons.
         */
-       public class TextButton extends org.apache.royale.style.elements.Button
+       public class TextButton extends NodeElementBase
        {
                public function TextButton()
                {
@@ -46,6 +46,45 @@ package org.apache.royale.style
                        return elem;
                }
 
+               COMPILE::JS
+               private function get button():HTMLButtonElement
+               {
+                       return element as HTMLButtonElement;
+               }
+
+               COMPILE::SWF
+               private var _disabled:Boolean;
+
+               /**
+                *  Whether the button is disabled
+                *
+                *  @langversion 3.0
+                *  @productversion Royale 1.0.0
+                */
+               public function get disabled():Boolean
+               {
+                       COMPILE::SWF
+                       {
+                               return _disabled;
+                       }
+
+                       COMPILE::JS
+                       {
+                               return button.disabled;
+                       }
+               }
+               public function set disabled(value:Boolean):void
+               {
+                       COMPILE::SWF
+                       {
+                               _disabled = value;
+                       }
+                       COMPILE::JS
+                       {
+                               button.disabled = value;
+                       }
+               }
+
                private var _text:String = "";
                public function get text():String
                {
@@ -62,5 +101,9 @@ package org.apache.royale.style
                        }
                        _text = value;
                }
+               override protected function getTag():String
+               {
+                       return "button";
+               }
        }
 }

Reply via email to