Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CodenameOne/src/com/codename1/components/InteractionDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -603,6 +603,8 @@ public void actionPerformed(ActionEvent evt) {
f.removePointerPressedListener(pressedListener);
f.removePointerReleasedListener(releasedListener);
dispose();
if (rOutOfBoundListener!=null)
rOutOfBoundListener.actionPerformed(new ActionEvent(true));
}
}
};
Expand Down Expand Up @@ -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;
}
}