import jexer.*;
import jexer.event.*;
+import jexer.menu.*;
/**
* This window demonstates the TText, THScroller, and TVScroller widgets.
super(parent, title, 0, 0, 44, 20, RESIZABLE);
textField = addText(text, 1, 1, 40, 16);
}
-
+
/**
* Public constructor.
*
this(parent, "Text Area",
"This is an example of a reflowable text field. Some example text follows.\n" +
"\n" +
+"Notice that some menu items should be disabled when this window has focus.\n" +
+"\n" +
"This library implements a text-based windowing system loosely\n" +
"reminiscient of Borland's [Turbo\n" +
"Vision](http://en.wikipedia.org/wiki/Turbo_Vision) library. For those\n" +
"Sigala's updated version](http://tvision.sourceforge.net/) that runs\n" +
"on many more platforms.\n" +
"\n" +
-"Currently the only console platform supported is Posix (tested on\n" +
-"Linux). Input/output is handled through terminal escape sequences\n" +
-"generated by the library itself: ncurses is not required or linked to. \n" +
-"xterm mouse tracking using UTF8 coordinates is supported.\n" +
-"\n" +
"This library is licensed LGPL (\"GNU Lesser General Public License\")\n" +
"version 3 or greater. See the file COPYING for the full license text,\n" +
"which includes both the GPL v3 and the LGPL supplemental terms.\n" +
widget.onResize(event);
}
}
-}
+ /**
+ * Play with menu items.
+ */
+ public void onFocus() {
+ getApplication().enableMenuItem(2001);
+ getApplication().disableMenuItem(TMenu.MID_SHELL);
+ getApplication().disableMenuItem(TMenu.MID_EXIT);
+ }
+
+ /**
+ * Called by application.switchWindow() when another window gets the
+ * focus.
+ */
+ public void onUnfocus() {
+ getApplication().disableMenuItem(2001);
+ getApplication().enableMenuItem(TMenu.MID_SHELL);
+ getApplication().enableMenuItem(TMenu.MID_EXIT);
+ }
+
+}