- statusBar = newStatusBar("Demo Main Window");
- statusBar.addShortcutKeypress(kbF1, cmHelp, "Help");
- statusBar.addShortcutKeypress(kbF2, cmShell, "Shell");
- statusBar.addShortcutKeypress(kbF3, cmOpen, "Open");
- statusBar.addShortcutKeypress(kbF10, cmExit, "Exit");
+ row += 2;
+ progressBar2 = addProgressBar(48, row, 12, 0);
+ progressBar2.setLeftBorderChar('\u255e');
+ progressBar2.setRightBorderChar('\u2561');
+ progressBar2.setCompletedChar('\u2592');
+ progressBar2.setRemainingChar('\u2550');
+ row++;
+ timer2 = getApplication().addTimer(125, true,
+ new TAction() {
+
+ public void DO() {
+ if (timer2I < 100) {
+ timer2I++;
+ } else {
+ timer2.setRecurring(false);
+ }
+ progressBar2.setValue(timer2I);
+ }
+ }
+ );
+
+ /*
+ addButton("Exception", 35, row + 3,
+ new TAction() {
+ public void DO() {
+ try {
+ throw new RuntimeException("FUBAR'd!");
+ } catch (Exception e) {
+ new jexer.TExceptionDialog(getApplication(), e);
+ }
+ }
+ }
+ );
+ */
+
+ activate(first);
+
+ statusBar = newStatusBar(i18n.getString("statusBar"));
+ statusBar.addShortcutKeypress(kbF1, cmHelp,
+ i18n.getString("statusBarHelp"));
+ statusBar.addShortcutKeypress(kbF2, cmShell,
+ i18n.getString("statusBarShell"));
+ statusBar.addShortcutKeypress(kbF3, cmOpen,
+ i18n.getString("statusBarOpen"));
+ statusBar.addShortcutKeypress(kbF10, cmExit,
+ i18n.getString("statusBarExit"));
+ }
+
+ // ------------------------------------------------------------------------
+ // TWindow ----------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * We need to override onClose so that the timer will no longer be called
+ * after we close the window. TTimers currently are completely unaware
+ * of the rest of the UI classes.
+ */
+ @Override
+ public void onClose() {
+ getApplication().removeTimer(timer1);
+ getApplication().removeTimer(timer2);