You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kotcrab edited this page Jan 28, 2025
·
8 revisions
This article applies to VisUI 1.0.0
ButtonBar (source) is a convenient class for creating button panels with buttons such as "Ok", "Cancel", "Yes" etc. Buttons are arranged in
platform dependent order which increases UX. Built-in orders support Windows, Mac, and Linux. Linux order is used as default.
How ButtonBar looks on different operating systems:
Simple example ButtonBar:
ButtonBarbuttonBar = newButtonBar(); //no order specified so platform default will be usedChangeListenerdummyListener = newChangeListener() {
@Overridepublicvoidchanged (ChangeEventevent, Actoractor) {
}
};
buttonBar.setButton(ButtonType.NO, dummyListener);
buttonBar.setButton(ButtonType.YES, dummyListener);
buttonBar.setButton(ButtonType.CANCEL, dummyListener);
table.add(buttonBar.createTable());
Each ButtonBar can only create one table however it can be reused after previously created table is removed from it's parent.
You can also pass existing instance of buttons:
VisTextButton btn = new VisTextButton("Custom OK Button Text");
buttonBar.setButton(ButtonType.OK, btn);
Buttons order
Buttons order is specified by string of button ids in which order they should be arranged, for example: L H BEF YNOCA R. Each letter represents single button (see ButtonType for buttons ids) and space char is blank space between buttons.
You can set ButtonBar to ignore spacings specified in buttons order: