X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=91d2e98d7c039da4aeb9d01c84bb33385f762772;hb=55d2b2c2b29ce51f4f910448a115073371deeae8;hp=971f6f8fa572ff243645975966243dc9ff25f598;hpb=f5a270d54562ae1205f31a9ea49d5aa17257851c;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 971f6f8..91d2e98 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -370,6 +370,15 @@ public class TApplication implements Runnable { */ private Backend backend; + /** + * Get the Backend. + * + * @return the Backend + */ + public final Backend getBackend() { + return backend; + } + /** * Get the Screen. * @@ -1514,6 +1523,15 @@ public class TApplication implements Runnable { return false; } + /** + * Display the about dialog. + */ + protected void showAboutDialog() { + messageBox("About", "Jexer Version " + + this.getClass().getPackage().getImplementationVersion(), + TMessageBox.Type.OK); + } + /** * Method that TApplication subclasses can override to handle menu * events. @@ -1549,6 +1567,10 @@ public class TApplication implements Runnable { closeAllWindows(); return true; } + if (menu.getId() == TMenu.MID_ABOUT) { + showAboutDialog(); + return true; + } return false; } @@ -1752,6 +1774,24 @@ public class TApplication implements Runnable { return windowMenu; } + /** + * Convenience function to add a default "Help" menu. + * + * @return the new menu + */ + public final TMenu addHelpMenu() { + TMenu helpMenu = addMenu("&Help"); + helpMenu.addDefaultItem(TMenu.MID_HELP_CONTENTS); + helpMenu.addDefaultItem(TMenu.MID_HELP_INDEX); + helpMenu.addDefaultItem(TMenu.MID_HELP_SEARCH); + helpMenu.addDefaultItem(TMenu.MID_HELP_PREVIOUS); + helpMenu.addDefaultItem(TMenu.MID_HELP_HELP); + helpMenu.addDefaultItem(TMenu.MID_HELP_ACTIVE_FILE); + helpMenu.addSeparator(); + helpMenu.addDefaultItem(TMenu.MID_ABOUT); + return helpMenu; + } + /** * Close all open windows. */