*/
boolean isSubMenu = false;
+ /**
+ * The X position of the menu's title.
+ */
+ private int titleX;
+
+ /**
+ * Set the menu title X position.
+ *
+ * @param titleX the position
+ */
+ public void setTitleX(final int titleX) {
+ this.titleX = titleX;
+ }
+
+ /**
+ * Get the menu title X position.
+ *
+ * @return the position
+ */
+ public int getTitleX() {
+ return titleX;
+ }
+
/**
* The shortcut and title.
*/
return addItemInternal(id, label, key);
}
+ /**
+ * Convenience function to add a custom menu item.
+ *
+ * @param id menu item ID. Must be greater than 1024.
+ * @param label menu item label
+ * @param key global keyboard accelerator
+ * @param enabled default state for enabled
+ * @return the new menu item
+ */
+ public TMenuItem addItem(final int id, final String label,
+ final TKeypress key, final boolean enabled) {
+
+ TMenuItem item = addItem(id, label, key);
+ item.setEnabled(enabled);
+ return item;
+ }
+
/**
* Convenience function to add a custom menu item.
*