X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=96dad6cc0b0cece1541d43dccab333b813f233d0;hb=615a0d99fd0aa4437116dd083147f9150d5e6527;hp=34f1559007090b31eef65a4d79be9288ed54dec7;hpb=5255f69c14d2c19f0e2f1f4ae8d9a106c92d3b8c;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 34f1559..96dad6c 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -1205,7 +1205,8 @@ public class TApplication implements Runnable { keepTimers.add(timer); } } - timers = keepTimers; + timers.clear(); + timers.addAll(keepTimers); } // Call onIdle's @@ -2062,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)) { @@ -2071,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())); + } } } } @@ -2860,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. *