*/
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.
*/
public static final int MID_HELP_ACTIVE_FILE = 45;
public static final int MID_ABOUT = 46;
+ // Other
+ public static final int MID_REPAINT = 50;
+
/**
* Public constructor.
*
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.
*
case MID_OPEN_FILE:
label = i18n.getString("menuOpen");
- key = kbAltO;
+ key = kbF3;
break;
case MID_CUT:
label = i18n.getString("menuHelpAbout");
break;
+ case MID_REPAINT:
+ label = i18n.getString("menuRepaintDesktop");
+ break;
+
default:
throw new IllegalArgumentException("Invalid menu ID: " + id);
}