public void clicked (InputEvent event, float x, float y) { selectBox.selection.choose(list.getSelected()); hide(); }
public void clicked (InputEvent event, float x, float y) { selectBox.selection.choose(list.getSelected()); hide(); }
public boolean keyDown (InputEvent event, int keycode) { switch (keycode) { case Keys.ENTER: selectBox.selection.choose(list.getSelected()); // Fall thru. case Keys.ESCAPE: hide(); event.stop(); return true; } return false; } };
public boolean keyDown (InputEvent event, int keycode) { switch (keycode) { case Keys.ENTER: selectBox.selection.choose(list.getSelected()); // Fall thru. case Keys.ESCAPE: hide(); event.stop(); return true; } return false; } };
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (pointer != 0 || button != 0) return true; if (selection.isDisabled()) return true; getStage().setKeyboardFocus(List.this); if (items.size == 0) return true; int index = getItemIndexAt(y); if (index == -1) return true; selection.choose(items.get(index)); touchDown = index; return true; }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (pointer != 0 || button != 0) return true; if (selection.isDisabled()) return true; getStage().setKeyboardFocus(List.this); if (items.size == 0) return true; int index = getItemIndexAt(y); if (index == -1) return true; selection.choose(items.get(index)); touchDown = index; return true; }
public void clicked (InputEvent event, float x, float y) { selectBox.selection.choose(list.getSelected()); hide(); }
void touchDown(float y) { if (items.size == 0) return; float height = getHeight(); if (style.background != null) { height -= style.background.getTopHeight() + style.background.getBottomHeight(); y -= style.background.getBottomHeight(); } int index = (int) ((height - y) / cellRenderer.getItemHeight()); index = Math.max(0, index); index = Math.min(items.size - 1, index); selection.choose(items.get(index)); }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (pointer != 0 || button != 0) return true; if (selection.isDisabled()) return true; getStage().setKeyboardFocus(List.this); if (items.size == 0) return true; int index = getItemIndexAt(y); if (index == -1) return true; selection.choose(items.get(index)); touchDown = index; return true; }
@SuppressWarnings("unchecked") @Override public void changed(ChangeEvent event, Actor actor) { int pos = list.getSelectedIndex() + 1; Action e = ((EditModelDialog<Verb, Action>) actor).getElement(); list.getItems().insert(pos, e); parent.getActions().add(pos, e); list.getSelection().choose(list.getItems().get(pos)); if (isControlAction(e)) { insertEndAction(pos + 1, getOrCreateControlActionId((AbstractControlAction) e)); if (e instanceof AbstractIfAction) insertEndAction(pos + 2, getOrCreateControlActionId((AbstractControlAction) e)); } list.invalidateHierarchy(); } });
public void addElements(PARENT parent, List<T> elements) { this.parent = parent; list.getItems().clear(); list.getSelection().clear(); if (elements != null) { for (T e : elements) { addItem(e); } } toolbar.disableEdit(list.getSelectedIndex() < 0); if (sorted) { list.sortByTitle(); } if (getItems().size > 0) list.getSelection().choose(list.getItems().get(0)); toolbar.disableCreate(parent == null); // container.prefHeight(list.getItemHeight() * (list.getItems().size > // 3?list.getItems().size:3)); list.invalidateHierarchy(); }