X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=2a92d09d25c429a6afe916f80f055a54156e5a2e;hb=87a17f3ca4b2602c396afdbb13cccb4c1e7cbd38;hp=7d3e41baf806d4c9cabb19d9d925b64aded541de;hpb=30bd4abd2a85c162bdf0a1cc687b366345182bc1;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 7d3e41b..2a92d09 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -1190,4 +1190,58 @@ public abstract class TWidget implements Comparable { return getApplication().inputBox(title, caption, text); } + /** + * Convenience function to add a password text field to this + * container/window. + * + * @param x column relative to parent + * @param y row relative to parent + * @param width visible text width + * @param fixed if true, the text cannot exceed the display width + * @return the new text field + */ + public final TPasswordField addPasswordField(final int x, final int y, + final int width, final boolean fixed) { + + return new TPasswordField(this, x, y, width, fixed); + } + + /** + * Convenience function to add a password text field to this + * container/window. + * + * @param x column relative to parent + * @param y row relative to parent + * @param width visible text width + * @param fixed if true, the text cannot exceed the display width + * @param text initial text, default is empty string + * @return the new text field + */ + public final TPasswordField addPasswordField(final int x, final int y, + final int width, final boolean fixed, final String text) { + + return new TPasswordField(this, x, y, width, fixed, text); + } + + /** + * Convenience function to add a password text field to this + * container/window. + * + * @param x column relative to parent + * @param y row relative to parent + * @param width visible text width + * @param fixed if true, the text cannot exceed the display width + * @param text initial text, default is empty string + * @param enterAction function to call when enter key is pressed + * @param updateAction function to call when the text is updated + * @return the new text field + */ + public final TPasswordField addPasswordField(final int x, final int y, + final int width, final boolean fixed, final String text, + final TAction enterAction, final TAction updateAction) { + + return new TPasswordField(this, x, y, width, fixed, text, enterAction, + updateAction); + } + }