/** * Adds a text button to the button table. * @param object The object that will be passed to {@link #result(Object)} if this button is clicked. May be null. */ public VisDialog button (String text, Object object, VisTextButtonStyle buttonStyle) { return button(new VisTextButton(text, buttonStyle), object); }
public void setButton (ButtonType type, String text, ChangeListener listener) { setButton(type, new VisTextButton(text), listener); }
public FileChooserField(int width) { super(); this.width = width; textField = new VisTextField(); fcBtn = new VisTextButton("Select"); setupUI(); setupListeners(); }
private VisTable createButtons () { ButtonBar buttonBar = new ButtonBar(); buttonBar.setIgnoreSpacing(true); buttonBar.setButton(ButtonType.LEFT, restoreButton = new VisTextButton(RESTORE.get())); buttonBar.setButton(ButtonType.OK, okButton = new VisTextButton(OK.get())); buttonBar.setButton(ButtonType.CANCEL, cancelButton = new VisTextButton(CANCEL.get())); return buttonBar.createTable(); }
public ImageChooserField(int width) { super(); this.width = width; fcBtn = new VisTextButton("Select"); img = new Image(PLACEHOLDER_IMG); setupUI(); setupListeners(); }
public Menu (String title, MenuStyle style) { super(style); this.title = title; openButton = new VisTextButton(title, new VisTextButtonStyle(style.openButtonStyle)); buttonDefault = openButton.getStyle().up; openButton.addListener(new InputListener() { @Override public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { if (menuBar.getCurrentMenu() == Menu.this) { menuBar.closeMenu(); return true; } switchMenu(); event.stop(); return true; } @Override public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { if (menuBar.getCurrentMenu() != null && menuBar.getCurrentMenu() != Menu.this) switchMenu(); } }); }
private void createBottomButtons () { VisTextButton cancelButton = new VisTextButton(CANCEL.get()); confirmButton = new VisTextButton(mode == Mode.OPEN ? OPEN.get() : SAVE.get()); VisTable buttonTable = new VisTable(true); buttonTable.defaults().minWidth(70).right(); add(buttonTable).padTop(3).padBottom(3).padRight(2).fillX().expandX(); ButtonBar buttonBar = new ButtonBar(); buttonBar.setIgnoreSpacing(true); buttonBar.setButton(ButtonType.CANCEL, cancelButton); buttonBar.setButton(ButtonType.OK, confirmButton); buttonTable.add(buttonBar.createTable()).expand().right(); cancelButton.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { fadeOut(); listener.canceled(); } }); confirmButton.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { selectionFinished(); } }); }
table.add(standardButton = new VisTextButton("standard")); table.add(centeredButton = new VisTextButton("centered")); table.add(oneColumnButton = new VisTextButton("one column")); table.add(oneRowButton = new VisTextButton("one row")); table.add(gridButton = new VisTextButton("grid"));
columnDefaults(0).left(); VisTextButton showOKMsg = new VisTextButton("show ok popup"); VisTextButton showErrorMsg = new VisTextButton("show error popup"); VisTextButton showErrorDetailsMsg = new VisTextButton("show error with details popup"); VisTextButton showInputDialog = new VisTextButton("show input dialog"); VisTextButton showInputDialogIntOnly = new VisTextButton("show input dialog (int only)"); VisTextButton showOptionDialog = new VisTextButton("show option dialog"); VisTextButton showConfirmDialog = new VisTextButton("show dialog with custom buttons"); VisTextButton showDetailsDialog = new VisTextButton("show details dialog"); VisTextButton showDetailsExpandedDialog = new VisTextButton("show expanded details dialog");
@Override public void changed (ChangeEvent event, Actor actor) { VisTable content = new VisTable(true); content.add("Toast content can be very complex").row(); content.add("This toast has a text field"); content.add(new VisTextField()).row(); content.add("And a button "); content.add(new VisTextButton("press me")); toastManager.show(new Toast("dark", content)); } });
buttonBar.setButton(ButtonType.CANCEL, cancelButton = new VisTextButton(ButtonType.CANCEL.getText())); buttonBar.setButton(ButtonType.OK, okButton = new VisTextButton(ButtonType.OK.getText()));
VisTextButton textToastButton = new VisTextButton("text only"); textToastButton.addListener(new ChangeListener() { @Override VisTextButton messageToastButton = new VisTextButton("message toast"); messageToastButton.addListener(new ChangeListener() { @Override VisTextButton customToastButton = new VisTextButton("custom toast"); customToastButton.addListener(new ChangeListener() { @Override content.add(new VisTextField()).row(); content.add("And a button "); content.add(new VisTextButton("press me")); toastManager.show(new Toast("dark", content)); VisTextButton clearButton = new VisTextButton("clear"); clearButton.addListener(new ChangeListener() { @Override
public TestColorPicker () { super("color picker"); final Image image = new Image(white); picker = new ColorPicker("color picker", new ColorPickerAdapter() { @Override public void finished (Color newColor) { image.setColor(newColor); } }); VisTextButton showPickerButton = new VisTextButton("show color picker"); showPickerButton.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { getStage().addActor(picker.fadeIn()); } }); Color c = new Color(27 / 255.0f, 161 / 255.0f, 226 / 255.0f, 1); picker.setColor(c); image.setColor(c); TableUtils.setSpacingDefaults(this); add(showPickerButton); add(image).size(32).pad(3); pack(); setPosition(948, 148); }
public DetailsDialog (String text, String title, String details) { super(title); text(text); if (details != null) { copyButton = new VisTextButton(Text.COPY.get()); detailsLabel = new VisLabel(details); Sizes sizes = VisUI.getSizes(); copyButton.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { Gdx.app.getClipboard().setContents((detailsLabel.getText().toString())); copyButton.setText(Text.COPIED.get()); } }); detailsTable.add(new VisLabel(Text.DETAILS_COLON.get())).left().expand().padTop(6); detailsTable.add(copyButton); detailsTable.row(); VisTable detailsTable = new VisTable(); detailsTable.add(detailsLabel).top().expand().fillX(); this.detailsTable.add(createScrollPane(detailsTable)).colspan(2).minWidth(600 * sizes.scaleFactor).height(300 * sizes.scaleFactor); getContentTable().row(); detailsCell = getContentTable().add(this.detailsTable); detailsCell.setActor(null); button(Text.DETAILS.get(), BUTTON_DETAILS); } button(ButtonType.OK.getText(), BUTTON_OK).padBottom(3); pack(); centerWindow(); }
typeFilter.addRule("Audio files (*.mp3, *.wav, *.ogg)", "mp3", "wav", "ogg"); VisTextButton open = new VisTextButton("mode open"); VisTextButton save = new VisTextButton("mode save"); final VisCheckBox useTypeFilter = new VisCheckBox("use type filter"); final VisCheckBox multiSelect = new VisCheckBox("multi-selection");
columnDefaults(0).left(); VisTextButton cancelButton = new VisTextButton("cancel"); VisTextButton acceptButton = new VisTextButton("accept");
VisTextButton addButton = new VisTextButton("Add");
VisTextButton normalButton = new VisTextButton("button"); VisTextButton normalBlueButton = new VisTextButton("button blue", "blue"); VisTextButton disabledButton = new VisTextButton("disabled"); VisTextButton toggleButton = new VisTextButton("toggle", "toggle"); disabledButton.setDisabled(true);
VisTextButton dummyButton = new VisTextButton("button");
builder.append(rowLayout, CellWidget.builder().fillX(), CellWidget.of(new VisTextField()).expandX().fillX().wrap(), CellWidget.of(new VisTextButton("choose")).padding(new Padding(0, 0)).wrap()); builder.row();