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 2020/04/10 17:05:35 UTC
[royale-asjs] branch develop updated: StyledUIBase: get minWidth,
minHeight, maxWidth and maxHeight properties
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 c93ebcf StyledUIBase: get minWidth, minHeight, maxWidth and maxHeight properties
c93ebcf is described below
commit c93ebcf82b3b355e5f88686b96a90d87d36d7ab1
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Apr 10 19:05:31 2020 +0200
StyledUIBase: get minWidth, minHeight, maxWidth and maxHeight properties
---
.../royale/org/apache/royale/core/StyledUIBase.as | 108 +++++++++++++++++++--
1 file changed, 102 insertions(+), 6 deletions(-)
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
index cc6bc01..24cf32b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
@@ -23,9 +23,7 @@ package org.apache.royale.core
import org.apache.royale.core.WrappedHTMLElement;
import org.apache.royale.html.util.addElementToWrapper;
}
- import org.apache.royale.events.Event;
import org.apache.royale.utils.ClassSelectorList;
- import org.apache.royale.utils.IClassSelectorListSupport;
import org.apache.royale.utils.sendEvent;
/**
@@ -356,8 +354,7 @@ package org.apache.royale.core
}
COMPILE::JS
{
- //positioner.style.position = 'absolute';
- if(!isNaN(value))
+ if(!isNaN(value))
{
if (positioner.parentNode != positioner.offsetParent)
value += (positioner.parentNode as HTMLElement).offsetLeft;
@@ -389,8 +386,7 @@ package org.apache.royale.core
}
COMPILE::JS
{
- //positioner.style.position = 'absolute';
- if(!isNaN(value))
+ if(!isNaN(value))
{
if (positioner.parentNode != positioner.offsetParent)
value += (positioner.parentNode as HTMLElement).offsetTop;
@@ -401,5 +397,105 @@ package org.apache.royale.core
}
}
}
+
+ protected var _minWidth:Number;
+ /**
+ * the minimun width for this component
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.7
+ */
+ public function get minWidth():Number
+ {
+ return _minWidth;
+ }
+ public function set minWidth(value:Number):void
+ {
+ if (_minWidth !== value)
+ {
+ _minWidth = value;
+ COMPILE::JS
+ {
+ this.positioner.style.minWidth = _minWidth.toString() + 'px';
+ }
+ }
+ }
+
+ protected var _minHeight:Number;
+ /**
+ * the minimun height for this component
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.7
+ */
+ public function get minHeight():Number
+ {
+ return _minHeight;
+ }
+ public function set minHeight(value:Number):void
+ {
+ if (_minHeight !== value)
+ {
+ _minHeight = value;
+ COMPILE::JS
+ {
+ this.positioner.style.minHeight = _minHeight.toString() + 'px';
+ }
+ }
+ }
+
+ protected var _maxWidth:Number;
+ /**
+ * the maximun width for this component
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.7
+ */
+ public function get maxWidth():Number
+ {
+ return _maxWidth;
+ }
+ public function set maxWidth(value:Number):void
+ {
+ if (_maxWidth !== value)
+ {
+ _maxWidth = value;
+ COMPILE::JS
+ {
+ this.positioner.style.maxWidth = _maxWidth.toString() + 'px';
+ }
+ }
+ }
+
+ protected var _maxHeight:Number;
+ /**
+ * the maximun height for this component
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.7
+ */
+ public function get maxHeight():Number
+ {
+ return _maxHeight;
+ }
+ public function set maxHeight(value:Number):void
+ {
+ if (_maxHeight !== value)
+ {
+ _maxHeight = value;
+ COMPILE::JS
+ {
+ this.positioner.style.maxHeight = _maxHeight.toString() + 'px';
+ }
+ }
+ }
}
}
\ No newline at end of file