X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fmenu%2FTSubMenu.java;h=e285c5ab6d78c485f67ed6e2597c4c17e31af189;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=b61ca83cecbd0ff0af48b6d4cd05e60d4a3293f8;hpb=051e29138b18fb4b731a72f8727475b10e4c74e4;p=fanfix.git diff --git a/src/jexer/menu/TSubMenu.java b/src/jexer/menu/TSubMenu.java index b61ca83..e285c5a 100644 --- a/src/jexer/menu/TSubMenu.java +++ b/src/jexer/menu/TSubMenu.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -163,8 +163,7 @@ public class TSubMenu extends TMenuItem { } // Add the arrow - getScreen().putCharXY(getWidth() - 2, 0, GraphicsChars.CP437[0x10], - menuColor); + putCharXY(getWidth() - 2, 0, GraphicsChars.CP437[0x10], menuColor); } /** @@ -235,6 +234,18 @@ public class TSubMenu extends TMenuItem { return menu.addDefaultItem(id); } + /** + * Convenience function to add one of the default menu items. + * + * @param id menu item ID. Must be between 0 (inclusive) and 1023 + * (inclusive). + * @param enabled default state for enabled + * @return the new menu item + */ + public TMenuItem addDefaultItem(final int id, final boolean enabled) { + return menu.addDefaultItem(id, enabled); + } + /** * Convenience function to add a menu separator. */