You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2021/07/29 20:11:25 UTC
[royale-asjs] branch develop updated: Make mx title windows
draggable, not any panel
This is an automated email from the ASF dual-hosted git repository.
yishayw 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 504d5b4 Make mx title windows draggable, not any panel
504d5b4 is described below
commit 504d5b4e621dcd173379ff07d6c418e47fef97ce
Author: Yishay Weiss <yi...@hotmail.com>
AuthorDate: Thu Jul 29 23:11:13 2021 +0300
Make mx title windows draggable, not any panel
---
.../MXRoyale/src/main/royale/mx/containers/TitleWindow.as | 14 ++++++++++++++
.../src/main/royale/mx/containers/beads/PanelView.as | 5 -----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
index 9539da8..79e13b3 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
@@ -21,6 +21,10 @@ package mx.containers
{
import org.apache.royale.events.CloseEvent;
+ import org.apache.royale.html.beads.DragBead;
+ import org.apache.royale.events.IEventDispatcher;
+ import mx.core.UIComponent;
+ import mx.containers.beads.PanelView;
/*
import mx.core.mx_internal;
@@ -286,6 +290,16 @@ public class TitleWindow extends Panel
_showCloseButton = value;
}
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+ var dragBead:DragBead = new DragBead();
+ var titleBar:IEventDispatcher = (view as PanelView).titleBar as IEventDispatcher;
+ dragBead.hitArea = titleBar;
+ dragBead.moveArea = (titleBar as UIComponent).screen;
+ addBead(dragBead);
+ }
+
}
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
index f34da21..7e74067 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
@@ -30,7 +30,6 @@ import mx.core.Container;
import mx.core.ContainerLayout;
import mx.core.UIComponent;
-import org.apache.royale.html.beads.DragBead;
import org.apache.royale.core.IBead;
import org.apache.royale.core.ILayoutChild;
import org.apache.royale.core.IStrand;
@@ -71,10 +70,6 @@ public class PanelView extends org.apache.royale.html.beads.PanelView
override public function set strand(value:IStrand):void
{
titleBar = new PanelTitleBar();
- var dragBead:DragBead = new DragBead();
- dragBead.hitArea = titleBar;
- dragBead.moveArea = (titleBar as UIComponent).screen;
- value.addBead(dragBead);
var panel:IEventDispatcher = value as IEventDispatcher;
panel.addEventListener("widthChanged", handleSizeChanged);
panel.addEventListener("heightChanged", handleSizeChanged);