X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fdemos%2FDemoMainWindow.java;h=72ee43f49a813414d63c60ab4b3fa7decef52e57;hb=3649b9210ea425f398ba8c24f9509669cf72aa96;hp=cff9bbdbbee180ff2f8706ac194035cb38731971;hpb=e3dfbd233442a877d5efa1bc177c3d357771e5cb;p=nikiroo-utils.git diff --git a/src/jexer/demos/DemoMainWindow.java b/src/jexer/demos/DemoMainWindow.java index cff9bbd..72ee43f 100644 --- a/src/jexer/demos/DemoMainWindow.java +++ b/src/jexer/demos/DemoMainWindow.java @@ -31,14 +31,12 @@ package jexer.demos; import jexer.*; -import jexer.event.*; -import jexer.menu.*; /** * This is the main "demo" application window. It makes use of the TTimer, * TProgressBox, TLabel, TButton, and TField widgets. */ -class DemoMainWindow extends TWindow { +public class DemoMainWindow extends TWindow { // Timer that increments a number. private TTimer timer; @@ -79,7 +77,7 @@ class DemoMainWindow extends TWindow { private DemoMainWindow(final TApplication parent, final int flags) { // Construct a demo window. X and Y don't matter because it will be // centered on screen. - super(parent, "Demo Window", 0, 0, 60, 23, flags); + super(parent, "Demo Window", 0, 0, 60, 24, flags); int row = 1; @@ -115,7 +113,7 @@ class DemoMainWindow extends TWindow { addPasswordField(35, row++, 15, false); addLabel("Fixed-width password:", 1, row); addPasswordField(35, row++, 15, true, "hunter2"); - row += 2; + row += 1; if (!isModal()) { addLabel("Radio buttons and checkboxes", 1, row); @@ -153,17 +151,21 @@ class DemoMainWindow extends TWindow { } row += 2; - /* if (!isModal()) { addLabel("Tree views", 1, row); addButton("Tree&View", 35, row, - { - new DemoTreeViewWindow(application); + new TAction() { + public void DO() { + try { + new DemoTreeViewWindow(getApplication()); + } catch (Exception e) { + e.printStackTrace(); + } + } } ); } row += 2; - */ if (!isModal()) { addLabel("Terminal", 1, row); @@ -177,6 +179,18 @@ class DemoMainWindow extends TWindow { } row += 2; + if (!isModal()) { + addLabel("Color editor", 1, row); + addButton("Co&lors", 35, row, + new TAction() { + public void DO() { + new TEditColorThemeWindow(getApplication()); + } + } + ); + } + row += 2; + progressBar = addProgressBar(1, row, 22, 0); row++; timerLabel = addLabel("Timer", 1, row);