/** Removes the touch, keyboard, and scroll focused actors. */ public void unfocusAll () { setScrollFocus(null); setKeyboardFocus(null); cancelTouchFocus(); }
/** Removes the touch, keyboard, and scroll focused actors. */ public void unfocusAll () { setScrollFocus(null); setKeyboardFocus(null); cancelTouchFocus(); }
/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
public void collapse () { if (collapsed) return; expandHeight = getHeight(); setHeight(collapseHeight); setY(getY() + expandHeight - collapseHeight); collapsed = true; if (getStage() != null) getStage().setScrollFocus(null); }
public void hide () { if (!list.isTouchable() || !hasParent()) return; list.setTouchable(Touchable.disabled); Stage stage = getStage(); if (stage != null) { stage.removeCaptureListener(hideListener); stage.removeListener(list.getKeyListener()); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; Actor actor = stage.getScrollFocus(); if (actor == null || isAscendantOf(actor)) stage.setScrollFocus(previousScrollFocus); } clearActions(); selectBox.onHide(this); }
public void hide () { if (!list.isTouchable() || !hasParent()) return; list.setTouchable(Touchable.disabled); Stage stage = getStage(); if (stage != null) { stage.removeCaptureListener(hideListener); stage.removeListener(list.getKeyListener()); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; Actor actor = stage.getScrollFocus(); if (actor == null || isAscendantOf(actor)) stage.setScrollFocus(previousScrollFocus); } clearActions(); selectBox.onHide(this); }
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }
/** Removes the dialog from the stage, restoring the previous keyboard and scroll focus, and adds the specified action to the * dialog. * @param action If null, the dialog is removed immediately. Otherwise, the dialog is removed when the action completes. The * dialog will not respond to touch down events during the action. */ public void hide (Action action) { Stage stage = getStage(); if (stage != null) { removeListener(focusListener); if (previousKeyboardFocus != null && previousKeyboardFocus.getStage() == null) previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setKeyboardFocus(previousKeyboardFocus); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setScrollFocus(previousScrollFocus); } if (action != null) { addCaptureListener(ignoreTouchDown); addAction(sequence(action, Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); } else remove(); }
/** Removes the dialog from the stage, restoring the previous keyboard and scroll focus, and adds the specified action to the * dialog. * @param action If null, the dialog is removed immediately. Otherwise, the dialog is removed when the action completes. The * dialog will not respond to touch down events during the action. */ public void hide (Action action) { Stage stage = getStage(); if (stage != null) { removeListener(focusListener); if (previousKeyboardFocus != null && previousKeyboardFocus.getStage() == null) previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setKeyboardFocus(previousKeyboardFocus); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setScrollFocus(previousScrollFocus); } if (action != null) { addCaptureListener(ignoreTouchDown); addAction(sequence(action, Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); } else remove(); }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (draggingPointer != -1) return false; if (pointer == 0 && button != 0) return false; getStage().setScrollFocus(ScrollPane.this);
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (draggingPointer != -1) return false; if (pointer == 0 && button != 0) return false; getStage().setScrollFocus(ScrollPane.this);
Actor actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; stage.setScrollFocus(this);
Actor actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; stage.setScrollFocus(this);
@Override public void enter(InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor fromActor) { // EditorLogger.debug("ENTER - X: " + x + " Y: " + y); getStage().setScrollFocus(centerPanel); } });
/** Removes the touch, keyboard, and scroll focused actors. */ public void unfocusAll () { setScrollFocus(null); setKeyboardFocus(null); cancelTouchFocus(); }
@Override public void enter(InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor fromActor) { super.enter(event, x, y, pointer, fromActor); // EditorLogger.debug("ENTER - X: " + x + " Y: " + y); scnWidget.getStage().setScrollFocus(scnWidget); }
@Override public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { getStage().setScrollFocus(getTextField()); return true; }
@Override public void changed (ChangeEvent event, Actor actor) { event.stop(); getStage().setScrollFocus(getTextField()); decrement(true); } });