X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=c9e0dedc2b652e60a308b5f7a7104d739fd7242c;hb=656c0dddc7c0faddd62d373f22916107d322429e;hp=c89e70ec65de92a7240ec9c69e90bcbf7736da4a;hpb=382bc294dd88b71639fdd6c73216d2519635a080;p=nikiroo-utils.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index c89e70e..c9e0ded 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -1911,6 +1911,22 @@ public abstract class TWidget implements Comparable { return getApplication().inputBox(title, caption, text); } + /** + * Convenience function to spawn an input box. + * + * @param title window title, will be centered along the top border + * @param caption message to display. Use embedded newlines to get a + * multi-line box. + * @param text initial text to seed the field with + * @param type one of the Type constants. Default is Type.OK. + * @return the new input box + */ + public final TInputBox inputBox(final String title, final String caption, + final String text, final TInputBox.Type type) { + + return getApplication().inputBox(title, caption, text, type); + } + /** * Convenience function to add a password text field to this * container/window. @@ -2256,4 +2272,22 @@ public abstract class TWidget implements Comparable { return new TTableWidget(this, x, y, width, height); } + /** + * Convenience function to add an editable 2D data table to this + * container/window. + * + * @param x column relative to parent + * @param y row relative to parent + * @param width width of widget + * @param height height of widget + * @param gridColumns number of columns in grid + * @param gridRows number of rows in grid + */ + public TTableWidget addTable(final int x, final int y, final int width, + final int height, final int gridColumns, final int gridRows) { + + return new TTableWidget(this, x, y, width, height, gridColumns, + gridRows); + } + }