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/12/10 08:10:41 UTC
[royale-asjs] branch develop updated: ViewStack
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
The following commit(s) were added to refs/heads/develop by this push:
new 1caaddc ViewStack
1caaddc is described below
commit 1caaddc590e0c9ed4c86b972bf0d43a8581bc5b3
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Dec 10 00:10:25 2018 -0800
ViewStack
---
.../src/main/royale/mx/containers/ViewStack.as | 53 +++++++++++++++++-----
1 file changed, 41 insertions(+), 12 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
index 934184b..dbe29ea 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
@@ -50,6 +50,8 @@ import mx.events.PropertyChangeEvent;
//import mx.managers.HistoryManager;
//import mx.managers.IHistoryManagerClient;
+import org.apache.royale.core.IChild;
+
use namespace mx_internal;
//--------------------------------------
@@ -724,6 +726,12 @@ public class ViewStack extends Container // implements IHistoryManagerClient, IS
// child, if no value has yet been proposed.
proposedSelectedIndex = value;
invalidateProperties();
+ if (parent)
+ {
+ commitProperties();
+ measure();
+ updateDisplayList(width, height);
+ }
// Set a flag which will cause the HistoryManager to save state
// the next time measure() is called.
@@ -1426,30 +1434,39 @@ public class ViewStack extends Container // implements IHistoryManagerClient, IS
}
}
-
/**
* @private
*/
- override public function addChildAt(item:IUIComponent, index:int):IUIComponent
+ override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
{
addingChildren = true;
- var obj:IUIComponent = super.addChildAt(item, index);
- internalDispatchEvent(CollectionEventKind.ADD, obj, index);
- childAddHandler(item);
+ super.addElement(c, dispatchEvent);
+ internalDispatchEvent(CollectionEventKind.ADD, c, numElements);
+ childAddHandler(c as IUIComponent);
+ addingChildren = false;
+ }
+
+ /**
+ * @private
+ */
+ override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+ {
+ addingChildren = true;
+ super.addElementAt(c, index, dispatchEvent);
+ internalDispatchEvent(CollectionEventKind.ADD, c, index);
+ childAddHandler(c as IUIComponent);
addingChildren = false;
- return obj;
}
/**
* @private
*/
- override public function removeChild(item:IUIComponent):IUIComponent
+ override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
{
- var index:int = getChildIndex(item);
- var obj:IUIComponent = super.removeChild(item);
- internalDispatchEvent(CollectionEventKind.REMOVE, obj, index);
- childRemoveHandler(item, index);
- return obj;
+ var index:int = getElementIndex(c);
+ super.removeElement(c, dispatchEvent);
+ internalDispatchEvent(CollectionEventKind.REMOVE, c, index);
+ childRemoveHandler(c as IUIComponent, index);
}
/**
@@ -1644,7 +1661,19 @@ public class ViewStack extends Container // implements IHistoryManagerClient, IS
return result;
}
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+ commitProperties();
+ measure();
+ }
+ override public function setActualSize(w:Number, h:Number):void
+ {
+ super.setActualSize(w, h);
+ updateDisplayList(w, h);
+ }
+
}
}