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

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 21f6b5c9fd52c7901330338b5274151c07cfeef2
Author: Alex Harui <aha...@apache.org>
AuthorDate: Thu Apr 12 15:56:34 2018 -0700

    add abstraction to IPopUpHost so popups can go in container chrome
---
 .../src/main/royale/org/apache/royale/core/Application.as  | 13 +++++++++++++
 .../src/main/royale/org/apache/royale/core/ViewBase.as     | 13 +++++++++++++
 .../org/apache/royale/html/accessories/ToolTipBead.as      |  6 +++---
 .../royale/org/apache/royale/html/beads/ComboBoxView.as    |  2 +-
 .../royale/org/apache/royale/html/beads/DateFieldView.as   |  2 +-
 .../org/apache/royale/html/beads/DropDownListView.as       |  4 ++--
 .../src/main/royale/org/apache/royale/core/IPopUpHost.as   |  3 ++-
 .../src/main/royale/org/apache/royale/utils/UIUtils.as     |  2 +-
 .../main/royale/org/apache/royale/createjs/core/View.as    | 14 ++++++++++++++
 .../royale/html/beads/controllers/DragMouseController.as   |  4 ++--
 .../org/apache/royale/flat/beads/DropDownListView.as       |  4 ++--
 11 files changed, 54 insertions(+), 13 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
index 4738832..44f20be 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
@@ -322,6 +322,19 @@ package org.apache.royale.core
         }
 
         /**
+         *  Application can host popups but they will be in the layout, if any
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function get popUpParent():IParent
+        {
+            return this;
+        }
+        
+        /**
          *  An array of data that describes the MXML attributes
          *  and tags in an MXML document.  This data is usually
          *  decoded by an MXMLDataInterpreter
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
index a3acb76..33d9bcd 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
@@ -93,5 +93,18 @@ package org.apache.royale.core
             dispatchEvent(new Event("modelChanged"));
         }
 
+        /**
+         *  ViewBase can host popups but they will be in the layout, if any
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function get popUpParent():IParent
+        {
+            return this;
+        }
+        
     }
 }
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
index b884d3f..fa3d601 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/ToolTipBead.as
@@ -142,14 +142,14 @@ package org.apache.royale.html.accessories
 
             var comp:IUIBase = _strand as IUIBase
             host = UIUtils.findPopUpHost(comp);
-                       if (tt) host.removeElement(tt);
+                       if (tt) host.popUpParent.removeElement(tt);
 
             tt = new ToolTip();
             tt.text = toolTip;
             var pt:Point = determinePosition(event, event.target);
             tt.x = pt.x;
             tt.y = pt.y;
-            host.addElement(tt, false); // don't trigger a layout
+            host.popUpParent.addElement(tt, false); // don't trigger a layout
                }
 
                /**
@@ -200,7 +200,7 @@ package org.apache.royale.html.accessories
                        
                        var comp:IUIBase = _strand as IUIBase;
             if (tt) {
-                host.removeElement(tt);
+                host.popUpParent.removeElement(tt);
                                tt = null;
                        }
         }
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
index 305b77b..1813606 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
@@ -174,7 +174,7 @@ package org.apache.royale.html.beads
                                }
                                
                                var popupHost:IPopUpHost = 
UIUtils.findPopUpHost(_strand as IUIBase);
-                               popupHost.addElement(list);
+                               popupHost.popUpParent.addElement(list);
                        }
                        else if (list.visible) {
                                UIUtils.removePopUp(list);
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DateFieldView.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DateFieldView.as
index 91690c0..7148dbf 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DateFieldView.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DateFieldView.as
@@ -213,7 +213,7 @@ package org.apache.royale.html.beads
                                                _popUp.element.style.position = 
"absolute";
                                        }
 
-                                       host.addElement(_popUp);
+                                       host.popUpParent.addElement(_popUp);
                                }
                                else
                                {
diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
index 285ddd5..2bd0b16 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
@@ -290,12 +290,12 @@ package org.apache.royale.html.beads
                 if (value)
                 {
                                        host = UIUtils.findPopUpHost(_strand as 
IUIBase);
-                    IPopUpHost(host).addElement(popUp as IChild);
+                    IPopUpHost(host).popUpParent.addElement(popUp as IChild);
                 }
                 else
                 {
                     host = UIUtils.findPopUpHost(_strand as IUIBase);
-                    IPopUpHost(host).removeElement(popUp as IChild);
+                    IPopUpHost(host).popUpParent.removeElement(popUp as 
IChild);
                 }
             }
         }
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
index eaebb3f..6b62b10 100755
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
@@ -27,7 +27,8 @@ package org.apache.royale.core
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-    public interface IPopUpHost extends IParent
+    public interface IPopUpHost
        {
+        function get popUpParent():IParent;
        }
 }
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
index 8c2da88..c5ea044 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
@@ -114,7 +114,7 @@ package org.apache.royale.utils
                        while(!(start is IPopUpHost)) {
                                start = IChild(start).parent;
                        }
-                       (start as IPopUpHost).removeElement(popUp);
+                       (start as IPopUpHost).popUpParent.removeElement(popUp);
                }
        }
 }
diff --git 
a/frameworks/projects/CreateJS/src/main/royale/org/apache/royale/createjs/core/View.as
 
b/frameworks/projects/CreateJS/src/main/royale/org/apache/royale/createjs/core/View.as
index e751227..09fce87 100644
--- 
a/frameworks/projects/CreateJS/src/main/royale/org/apache/royale/createjs/core/View.as
+++ 
b/frameworks/projects/CreateJS/src/main/royale/org/apache/royale/createjs/core/View.as
@@ -327,5 +327,19 @@ package org.apache.royale.createjs.core
                {
                        _transitions = value;   
                }
+        
+        /**
+         *  ViewBase can host popups but they will be in the layout, if any
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function get popUpParent():IParent
+        {
+            return this;
+        }
+        
        }
 }
diff --git 
a/frameworks/projects/DragDrop/src/main/royale/org/apache/royale/html/beads/controllers/DragMouseController.as
 
b/frameworks/projects/DragDrop/src/main/royale/org/apache/royale/html/beads/controllers/DragMouseController.as
index a4a594a..ba0c8a1 100644
--- 
a/frameworks/projects/DragDrop/src/main/royale/org/apache/royale/html/beads/controllers/DragMouseController.as
+++ 
b/frameworks/projects/DragDrop/src/main/royale/org/apache/royale/html/beads/controllers/DragMouseController.as
@@ -266,7 +266,7 @@ package org.apache.royale.html.beads.controllers
                         dragging = true;
                         host = UIUtils.findPopUpHost(_strand as IUIBase);
                         if (host == null) return;
-                        host.addElement(dragImage);
+                        host.popUpParent.addElement(dragImage);
                         pt = PointUtils.globalToLocal(new Point(event.clientX, 
event.clientY), host);
                         dragImage.x = pt.x + dragImageOffsetX;
                         dragImage.y = pt.y + dragImageOffsetY;
@@ -312,7 +312,7 @@ package org.apache.royale.html.beads.controllers
 
             host = UIUtils.findPopUpHost(_strand as IUIBase);
             if (dragImage && host) {
-               host.removeElement(dragImage);
+               host.popUpParent.removeElement(dragImage);
             }
 
             if (dragging && event.target)
diff --git 
a/frameworks/projects/Flat/src/main/royale/org/apache/royale/flat/beads/DropDownListView.as
 
b/frameworks/projects/Flat/src/main/royale/org/apache/royale/flat/beads/DropDownListView.as
index b91797f..d970d28 100644
--- 
a/frameworks/projects/Flat/src/main/royale/org/apache/royale/flat/beads/DropDownListView.as
+++ 
b/frameworks/projects/Flat/src/main/royale/org/apache/royale/flat/beads/DropDownListView.as
@@ -298,12 +298,12 @@ package org.apache.royale.flat.beads
                 if (value)
                 {
                     host = UIUtils.findPopUpHost(_strand as IUIBase);
-                    IPopUpHost(host).addElement(popUp as IChild);
+                    IPopUpHost(host).popUpParent.addElement(popUp as IChild);
                 }
                 else
                 {
                     host = UIUtils.findPopUpHost(_strand as IUIBase);
-                    IPopUpHost(host).removeElement(popUp as IChild);
+                    IPopUpHost(host).popUpParent.removeElement(popUp as 
IChild);
                 }
             }
         }

-- 
To stop receiving notification emails like this one, please contact
aha...@apache.org.

Reply via email to