#53 progress bar style
[fanfix.git] / src / jexer / demos / Demo8.java
index d7b75013e08fad7516683a988611879385b6cc72..3b253d0c5aea2210a6b8013a17bf9de6d12e06ab 100644 (file)
@@ -33,6 +33,7 @@ import java.util.ResourceBundle;
 import jexer.TApplication;
 import jexer.TPanel;
 import jexer.TSplitPane;
+import jexer.TTerminalWidget;
 import jexer.TText;
 import jexer.TWindow;
 import jexer.layout.BoxLayoutManager;
@@ -67,6 +68,16 @@ public class Demo8 {
 "This library is licensed MIT.  See the file LICENSE for the full license " +
 "for the details.\n";
 
+    /**
+     * Menu item: split vertically.
+     */
+    private static final int MENU_SPLIT_VERTICAL = 2000;
+
+    /**
+     * Menu item: split horizontally.
+     */
+    private static final int MENU_SPLIT_HORIZONTAL = 2001;
+
     // ------------------------------------------------------------------------
     // Demo8 ------------------------------------------------------------------
     // ------------------------------------------------------------------------
@@ -106,14 +117,21 @@ public class Demo8 {
             60, 22);
 
         TMenu paneMenu = app.addMenu(i18n.getString("paneMenu"));
-        paneMenu.addDefaultItem(TMenu.MID_SPLIT_VERTICAL, true);
-        paneMenu.addDefaultItem(TMenu.MID_SPLIT_HORIZONTAL, true);
+        paneMenu.addItem(MENU_SPLIT_VERTICAL,
+            i18n.getString("paneSplitVertical"));
+        paneMenu.addItem(MENU_SPLIT_HORIZONTAL,
+            i18n.getString("paneSplitHorizontal"));
 
         TSplitPane pane = window.addSplitPane(0, 0, window.getWidth() - 2,
             window.getHeight() - 2, true);
 
-        pane.setLeft(new TText(null, TEXT, 0, 0, 10, 10));
-        pane.setRight(new TText(null, TEXT, 0, 0, 10, 10));
+        // pane.setLeft(new TText(null, TEXT, 0, 0, 10, 10));
+        // pane.setRight(new TText(null, TEXT, 0, 0, 10, 10));
+
+        // For this demo, let's require ptypipe
+        System.setProperty("jexer.TTerminal.ptypipe", "true");
+        pane.setLeft(new TTerminalWidget(null, 0, 0));
+        pane.setRight(new TTerminalWidget(null, 0, 0));
 
         app.run();
     }