* @param key global keyboard accelerator
* @return the new menu item
*/
- public TMenuItem addItem(final int id, final String label,
+ public final TMenuItem addItem(final int id, final String label,
final TKeypress key) {
assert (id >= 1024);
for (TWidget widget: getChildren()) {
widget.setWidth(getWidth() - 2);
}
- getApplication().addAccelerator(menuItem, toLower(key));
+ getApplication().addAccelerator(menuItem, key.toLowerCase());
getApplication().recomputeMenuX();
activate(0);
return menuItem;
* @param label menu item label
* @return the new menu item
*/
- public TMenuItem addItem(final int id, final String label) {
+ public final TMenuItem addItem(final int id, final String label) {
assert (id >= 1024);
return addItemInternal(id, label);
}
* (inclusive).
* @return the new menu item
*/
- public TMenuItem addDefaultItem(final int id) {
+ public final TMenuItem addDefaultItem(final int id) {
assert (id >= 0);
assert (id < 1024);
break;
case MID_CLEAR:
label = "C&lear";
- key = kbDel;
+ hasKey = false;
+ // key = kbDel;
break;
case MID_TILE:
/**
* Convenience function to add a menu separator.
*/
- public void addSeparator() {
+ public final void addSeparator() {
int newY = getChildren().size() + 1;
assert (newY < getHeight());
* denoted by prefixing a letter with "&", e.g. "&File"
* @return the new sub-menu
*/
- public TSubMenu addSubMenu(final String title) {
+ public final TSubMenu addSubMenu(final String title) {
int newY = getChildren().size() + 1;
assert (newY < getHeight());