X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTDesktop.java;h=20e6fd04c405e9edc918cdca4821264976929a4d;hb=ba71ae78a66c9f88237d2681aa5ff991e3bd60ef;hp=68e394e88a7d5f4035d9c61c794879e6a40984c4;hpb=0ee88b6d705993df0d9e32cdc08c619605c7d75c;p=fanfix.git diff --git a/src/jexer/TDesktop.java b/src/jexer/TDesktop.java index 68e394e..20e6fd0 100644 --- a/src/jexer/TDesktop.java +++ b/src/jexer/TDesktop.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,14 +33,28 @@ import jexer.bits.GraphicsChars; import jexer.event.TKeypressEvent; import jexer.event.TMenuEvent; import jexer.event.TMouseEvent; -import jexer.event.TResizeEvent; /** * TDesktop is a special-class window that is drawn underneath everything - * else. + * else. Like a TWindow, it can contain widgets and perform "background" + * processing via onIdle(). But unlike a TWindow, it cannot be hidden, + * moved, or resized. + * + *

+ * Events are passed to TDesktop as follows: + *

*/ public class TDesktop extends TWindow { + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * Public constructor. * @@ -54,6 +68,10 @@ public class TDesktop extends TWindow { setActive(false); } + // ------------------------------------------------------------------------ + // TWindow ---------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * The default TDesktop draws a hatch character across everything. */ @@ -63,6 +81,62 @@ public class TDesktop extends TWindow { putAll(GraphicsChars.HATCH, background); } + /** + * Hide window. This is a NOP for TDesktop. + */ + @Override + public final void hide() {} + + /** + * Show window. This is a NOP for TDesktop. + */ + @Override + public final void show() {} + + /** + * Called by hide(). This is a NOP for TDesktop. + */ + @Override + public final void onHide() {} + + /** + * Called by show(). This is a NOP for TDesktop. + */ + @Override + public final void onShow() {} + + /** + * Returns true if the mouse is currently on the close button. + * + * @return true if mouse is currently on the close button + */ + @Override + protected final boolean mouseOnClose() { + return false; + } + + /** + * Returns true if the mouse is currently on the maximize/restore button. + * + * @return true if the mouse is currently on the maximize/restore button + */ + @Override + protected final boolean mouseOnMaximize() { + return false; + } + + /** + * Returns true if the mouse is currently on the resizable lower right + * corner. + * + * @return true if the mouse is currently on the resizable lower right + * corner + */ + @Override + protected final boolean mouseOnResize() { + return false; + } + /** * Handle mouse button presses. *