X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=96dad6cc0b0cece1541d43dccab333b813f233d0;hb=615a0d99fd0aa4437116dd083147f9150d5e6527;hp=9fa64d0703ae5d973453db0abb998661eb76fe20;hpb=e394cb85acdf062fb3f0d87819230acfbffa1ce0;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 9fa64d0..96dad6c 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -2063,6 +2063,9 @@ public class TApplication implements Runnable { } TWindow w = sorted.get(i); + int oldWidth = w.getWidth(); + int oldHeight = w.getHeight(); + w.setX(logicalX * newWidth); w.setWidth(newWidth); if (i >= ((a - 1) * b)) { @@ -2072,6 +2075,12 @@ public class TApplication implements Runnable { w.setY((logicalY * newHeight1) + 1); w.setHeight(newHeight1); } + if ((w.getWidth() != oldWidth) + || (w.getHeight() != oldHeight) + ) { + w.onResize(new TResizeEvent(TResizeEvent.Type.WIDGET, + w.getWidth(), w.getHeight())); + } } } } @@ -2861,6 +2870,22 @@ public class TApplication implements Runnable { return new TInputBox(this, 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 new TInputBox(this, title, caption, text, type); + } + /** * Convenience function to open a terminal window. *