X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fjexer%2FTWindow.java;h=4d14d0eee2debcf23b03e2df314ea41721c38c8c;hp=58195c915f1ae885485891f159539f53ece7b474;hb=c4cefaa04ec122fc02efb6542451a31fdf722c32;hpb=c6815053bca27b1c2374548e06779a97651fe07d diff --git a/src/jexer/TWindow.java b/src/jexer/TWindow.java index 58195c9..4d14d0e 100644 --- a/src/jexer/TWindow.java +++ b/src/jexer/TWindow.java @@ -199,6 +199,11 @@ public class TWindow extends TWidget { */ private boolean hideMouse = false; + /** + * The help topic for this window. + */ + protected String helpTopic = "Help"; + // ------------------------------------------------------------------------ // Constructors ----------------------------------------------------------- // ------------------------------------------------------------------------ @@ -541,12 +546,6 @@ public class TWindow extends TWidget { } if (inWindowResize) { - // Do not permit resizing below the status line - if (mouse.getAbsoluteY() == application.getDesktopBottom()) { - inWindowResize = false; - return; - } - // Move window over setWidth(resizeWindowWidth + (mouse.getAbsoluteX() - moveWindowMouseX)); @@ -566,23 +565,22 @@ public class TWindow extends TWidget { // Keep within min/max bounds if (getWidth() < minimumWindowWidth) { setWidth(minimumWindowWidth); - inWindowResize = false; } if (getHeight() < minimumWindowHeight) { setHeight(minimumWindowHeight); - inWindowResize = false; } if ((maximumWindowWidth > 0) && (getWidth() > maximumWindowWidth) ) { setWidth(maximumWindowWidth); - inWindowResize = false; } if ((maximumWindowHeight > 0) && (getHeight() > maximumWindowHeight) ) { setHeight(maximumWindowHeight); - inWindowResize = false; + } + if (getHeight() + getY() >= getApplication().getDesktopBottom()) { + setHeight(getApplication().getDesktopBottom() - getY()); } // Pass a resize event to my children @@ -1440,6 +1438,15 @@ public class TWindow extends TWidget { this.hideMouse = hideMouse; } + /** + * Get this window's help topic to load. + * + * @return the topic name + */ + public String getHelpTopic() { + return helpTopic; + } + /** * Generate a human-readable string for this window. * @@ -1447,8 +1454,9 @@ public class TWindow extends TWidget { */ @Override public String toString() { - return String.format("%s(%8x) \'%s\' position (%d, %d) geometry %dx%d" + - " hidden %s modal %s", getClass().getName(), hashCode(), title, + return String.format("%s(%8x) \'%s\' Z %d position (%d, %d) " + + "geometry %dx%d hidden %s modal %s", + getClass().getName(), hashCode(), title, getZ(), getX(), getY(), getWidth(), getHeight(), hidden, isModal()); }