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 0e3a030e87 Emulation - only popups should be draggable
0e3a030e87 is described below
commit 0e3a030e8718c1ef88ec533237d75a56adecb97b
Author: Yishay Weiss <[email protected]>
AuthorDate: Mon Aug 29 10:43:19 2022 +0300
Emulation - only popups should be draggable
---
.../src/main/royale/mx/containers/TitleWindow.as | 2 +-
.../src/main/royale/mx/controls/beads/DragBead.as | 42 ++++++++++++++++++++++
.../src/main/royale/mx/managers/PopUpManager.as | 7 ++--
3 files changed, 48 insertions(+), 3 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 af7572fa05..c31929f528 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
@@ -21,7 +21,7 @@ package mx.containers
{
import org.apache.royale.events.CloseEvent;
- import org.apache.royale.html.beads.DragBead;
+ import mx.controls.beads.DragBead;
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.core.IPanelModel;
import mx.core.UIComponent;
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DragBead.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DragBead.as
new file mode 100644
index 0000000000..427c516a10
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/DragBead.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package mx.controls.beads
+{
+ import org.apache.royale.events.MouseEvent;
+ import org.apache.royale.html.beads.DragBead;
+ import mx.core.IUIComponent;
+
+ /**
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.10
+ */
+ public class DragBead extends org.apache.royale.html.beads.DragBead
+ {
+ // Flex behavior is to only drage pop ups
+ override protected function
mouseDownHandler(event:MouseEvent):void
+ {
+ if (_host is IUIComponent && (_host as
IUIComponent).isPopUp)
+ {
+ super.mouseDownHandler(event);
+ }
+ }
+ }
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManager.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManager.as
index 5f3f0da45a..46463ffaf1 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManager.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/PopUpManager.as
@@ -204,8 +204,11 @@ public class PopUpManager
PopUpManagerModal.show(popUpHost as IUIBase, window);
modalWindows.push(window);
}
- if (popUpHost is UIComponent)
- (window as UIComponent).systemManager = (popUpHost as
UIComponent).systemManager;
+ if (popUpHost is IUIComponent)
+ {
+ (window as IUIComponent).systemManager = (popUpHost as
UIComponent).systemManager;
+ (window as IUIComponent).isPopUp = true;
+ }
if (window is IFocusManagerContainer)
{
if (!IFocusManagerContainer(window).focusManager)