stubs for TFileOpenBox, cleanup putStringXY
[fanfix.git] / src / jexer / TApplication.java
index a37cf03d7382fe564562a2faa06059c5be900c2c..d0c34bf0303adbe99e917f6afbcd278032915af6 100644 (file)
@@ -31,6 +31,7 @@
 package jexer;
 
 import java.io.InputStream;
+import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.Collections;
@@ -646,7 +647,7 @@ public class TApplication implements Runnable {
             // Draw the menu title
             getScreen().hLineXY(x, 0, menu.getTitle().length() + 2, ' ',
                 menuColor);
-            getScreen().putStrXY(x + 1, 0, menu.getTitle(), menuColor);
+            getScreen().putStringXY(x + 1, 0, menu.getTitle(), menuColor);
             // Draw the highlight character
             getScreen().putCharXY(x + 1 + menu.getMnemonic().getShortcutIdx(),
                 0, menu.getMnemonic().getShortcut(), menuMnemonicColor);
@@ -1820,4 +1821,30 @@ public class TApplication implements Runnable {
         return new TTerminalWindow(this, x, y, flags);
     }
 
+    /**
+     * Convenience function to spawn an file open box.
+     *
+     * @param path path of selected file
+     * @return the result of the new file open box
+     */
+    public final String fileOpenBox(final String path) throws IOException {
+
+        TFileOpenBox box = new TFileOpenBox(this, path, TFileOpenBox.Type.OPEN);
+        return box.getFilename();
+    }
+
+    /**
+     * Convenience function to spawn an file open box.
+     *
+     * @param path path of selected file
+     * @param type one of the Type constants
+     * @return the result of the new file open box
+     */
+    public final String fileOpenBox(final String path,
+        final TFileOpenBox.Type type) throws IOException {
+
+        TFileOpenBox box = new TFileOpenBox(this, path, type);
+        return box.getFilename();
+    }
+
 }