You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/06/10 22:01:33 UTC
[royale-asjs] branch develop updated: Support 'internal' use of
label to render the down arrows in PopUpMenuButton. Does not appear
externally when checking the 'label' getter/setter.
This is an automated email from the ASF dual-hosted git repository.
gregdove 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 20e8d05 Support 'internal' use of label to render the down arrows in PopUpMenuButton. Does not appear externally when checking the 'label' getter/setter.
20e8d05 is described below
commit 20e8d058f2108ca83d95347de35abd8c0996f2a4
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu Jun 11 09:52:26 2020 +1200
Support 'internal' use of label to render the down arrows in PopUpMenuButton. Does not appear externally when checking the 'label' getter/setter.
---
frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as | 6 +++++-
.../MXRoyale/src/main/royale/mx/controls/PopUpMenuButton.as | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as
index 840dd4f..2917baa 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Button.as
@@ -361,6 +361,8 @@ public class Button extends UIComponent implements IDataRenderer, IListItemRende
if (parent)
(parent as IEventDispatcher).dispatchEvent(new Event("layoutNeeded"));
}
+
+
//----------------------------------
// toolTip
@@ -694,9 +696,11 @@ public class Button extends UIComponent implements IDataRenderer, IListItemRende
COMPILE::JS
protected function setInnerHTML():void
{
+ var label:String = ITextModel(model).text;
if (label != null) {
element.innerHTML = label;
}
+ var icon:String = ImageAndTextModel(model).image;
if (icon != null) {
element.style.background = "url('"+icon+"') no-repeat 2px center";
@@ -710,7 +714,7 @@ public class Button extends UIComponent implements IDataRenderer, IListItemRende
measuredWidth = Number.NaN;
measuredHeight = Number.NaN;
- };
+ }
/**
*
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/PopUpMenuButton.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/PopUpMenuButton.as
index 59639a4..6c4ef87 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/PopUpMenuButton.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/PopUpMenuButton.as
@@ -229,7 +229,11 @@ public class PopUpMenuButton extends PopUpButton
// labelSet is different from labelChanged as it is never unset.
labelSet = true;
_label = value;
- setLabel();
+ if (parent)
+ {
+ setLabel();
+ (parent as IEventDispatcher).dispatchEvent(new Event("layoutNeeded"));
+ }
}
override public function get label():String{