diff --git a/CodenameOne/src/com/codename1/components/InteractionDialog.java b/CodenameOne/src/com/codename1/components/InteractionDialog.java index 890f64c5ba..bb376c990b 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 ActionListener 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.actionPerformed(new ActionEvent(true)); } } }; @@ -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(ActionListener r){ + this.rOutOfBoundListener = r; + } +} \ No newline at end of file