Add 'src/jexer/' from commit 'cf01c92f5809a0732409e280fb0f32f27393618d'
[fanfix.git] / src / jexer / menu / TSubMenu.java
index b61ca83cecbd0ff0af48b6d4cd05e60d4a3293f8..e285c5ab6d78c485f67ed6e2597c4c17e31af189 100644 (file)
@@ -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.
      */