git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes for TJIDE
[fanfix.git]
/
src
/
jexer
/
TWindow.java
diff --git
a/src/jexer/TWindow.java
b/src/jexer/TWindow.java
index cde0113a009b01a26c397b4badf814cb7281532f..19c96fd141d2550209a9ca8fb14ae53bcbfbc378 100644
(file)
--- a/
src/jexer/TWindow.java
+++ b/
src/jexer/TWindow.java
@@
-73,6
+73,11
@@
public class TWindow extends TWidget {
*/
public static final int NOCLOSEBOX = 0x08;
*/
public static final int NOCLOSEBOX = 0x08;
+ /**
+ * Window has no maximize box (default no).
+ */
+ public static final int NOZOOMBOX = 0x10;
+
// ------------------------------------------------------------------------
// Common window attributes -----------------------------------------------
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Common window attributes -----------------------------------------------
// ------------------------------------------------------------------------
@@
-592,12
+597,24
@@
public class TWindow extends TWidget {
return false;
}
return false;
}
+ /**
+ * Returns true if this window has a maximize/zoom box.
+ *
+ * @return true if this window has a maximize/zoom box
+ */
+ public final boolean hasZoomBox() {
+ if ((flags & NOZOOMBOX) != 0) {
+ return true;
+ }
+ return false;
+ }
+
/**
* Retrieve the background color.
*
* @return the background color
*/
/**
* Retrieve the background color.
*
* @return the background color
*/
- public
final
CellAttributes getBackground() {
+ public CellAttributes getBackground() {
if (!isModal()
&& (inWindowMove || inWindowResize || inKeyboardResize)
) {
if (!isModal()
&& (inWindowMove || inWindowResize || inKeyboardResize)
) {
@@
-715,7
+732,7
@@
public class TWindow extends TWidget {
}
// Draw the maximize button
}
// Draw the maximize button
- if (!isModal()) {
+ if (!isModal()
&& ((flags & NOZOOMBOX) == 0)
) {
putCharXY(getWidth() - 5, 0, '[', border);
putCharXY(getWidth() - 3, 0, ']', border);
putCharXY(getWidth() - 5, 0, '[', border);
putCharXY(getWidth() - 3, 0, ']', border);
@@
-773,6
+790,9
@@
public class TWindow extends TWidget {
* @return true if the mouse is currently on the maximize/restore button
*/
protected boolean mouseOnMaximize() {
* @return true if the mouse is currently on the maximize/restore button
*/
protected boolean mouseOnMaximize() {
+ if ((flags & NOZOOMBOX) != 0) {
+ return false;
+ }
if ((mouse != null)
&& !isModal()
&& (mouse.getAbsoluteY() == getY())
if ((mouse != null)
&& !isModal()
&& (mouse.getAbsoluteY() == getY())
@@
-1145,7
+1165,7
@@
public class TWindow extends TWidget {
}
// F5 - zoom
}
// F5 - zoom
- if (keypress.equals(kbF5)) {
+ if (keypress.equals(kbF5)
&& ((flags & NOZOOMBOX) == 0)
) {
if (maximized) {
restore();
} else {
if (maximized) {
restore();
} else {
@@
-1200,7
+1220,7
@@
public class TWindow extends TWidget {
return;
}
return;
}
- if (command.equals(cmWindowZoom)) {
+ if (command.equals(cmWindowZoom)
&& ((flags & NOZOOMBOX) == 0)
) {
if (maximized) {
restore();
} else {
if (maximized) {
restore();
} else {
@@
-1246,7
+1266,9
@@
public class TWindow extends TWidget {
return;
}
return;
}
- if (menu.getId() == TMenu.MID_WINDOW_ZOOM) {
+ if ((menu.getId() == TMenu.MID_WINDOW_ZOOM)
+ && ((flags & NOZOOMBOX) == 0)
+ ) {
if (maximized) {
restore();
} else {
if (maximized) {
restore();
} else {