From f9fffd691b6658dc34fa40b1bb43d579fdd7c438 Mon Sep 17 00:00:00 2001 From: Durank Date: Thu, 25 Jul 2019 10:22:40 -0400 Subject: [PATCH 1/2] Durank ------------------ fixed the conflict to add Possibility to listen out of bounds in Interaction Dialog to take some action --- .../com/codename1/components/InteractionDialog.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CodenameOne/src/com/codename1/components/InteractionDialog.java b/CodenameOne/src/com/codename1/components/InteractionDialog.java index 890f64c5ba..9cf513c1dd 100644 --- a/CodenameOne/src/com/codename1/components/InteractionDialog.java +++ b/CodenameOne/src/com/codename1/components/InteractionDialog.java @@ -23,7 +23,6 @@ package com.codename1.components; -import com.codename1.ui.Command; import com.codename1.ui.Component; import static com.codename1.ui.Component.BOTTOM; import static com.codename1.ui.Component.LEFT; @@ -65,6 +64,7 @@ public class InteractionDialog extends Container { private boolean repositionAnimation = true; private boolean disposed; private boolean disposeWhenPointerOutOfBounds; + private Runnable rOutOfBoundListener = null; /** * Whether the interaction dialog uses the form layered pane of the regular layered pane @@ -603,6 +603,8 @@ public void actionPerformed(ActionEvent evt) { f.removePointerPressedListener(pressedListener); f.removePointerReleasedListener(releasedListener); dispose(); + if (rOutOfBoundListener!=null) + rOutOfBoundListener.run(); } } }; @@ -854,4 +856,11 @@ public boolean isFormMode() { public void setFormMode(boolean formMode) { this.formMode = formMode; } + /** + * Set out of bounds listener + * @param onFinish + */ + public void setDisposeWhenPointerOutOfBoundsListener(Runnable r){ + this.rOutOfBoundListener = r; + } } From e4167d6adf1d0d0e4581b68dfaece4df3d673781 Mon Sep 17 00:00:00 2001 From: Durank Date: Mon, 29 Jul 2019 12:43:07 -0400 Subject: [PATCH 2/2] Fixed Possibility to listen out of bounds in Interaction Dialog to take some action --- .../src/com/codename1/components/InteractionDialog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodenameOne/src/com/codename1/components/InteractionDialog.java b/CodenameOne/src/com/codename1/components/InteractionDialog.java index 9cf513c1dd..bb376c990b 100644 --- a/CodenameOne/src/com/codename1/components/InteractionDialog.java +++ b/CodenameOne/src/com/codename1/components/InteractionDialog.java @@ -64,7 +64,7 @@ public class InteractionDialog extends Container { private boolean repositionAnimation = true; private boolean disposed; private boolean disposeWhenPointerOutOfBounds; - private Runnable rOutOfBoundListener = null; + private ActionListener rOutOfBoundListener = null; /** * Whether the interaction dialog uses the form layered pane of the regular layered pane @@ -604,7 +604,7 @@ public void actionPerformed(ActionEvent evt) { f.removePointerReleasedListener(releasedListener); dispose(); if (rOutOfBoundListener!=null) - rOutOfBoundListener.run(); + rOutOfBoundListener.actionPerformed(new ActionEvent(true)); } } }; @@ -860,7 +860,7 @@ public void setFormMode(boolean formMode) { * Set out of bounds listener * @param onFinish */ - public void setDisposeWhenPointerOutOfBoundsListener(Runnable r){ + public void setDisposeWhenPointerOutOfBoundsListener(ActionListener r){ this.rOutOfBoundListener = r; } -} +} \ No newline at end of file