MacOSX predefines, and so does Xojo, EditMenuItems. The plugin enables/disables these menuItems, Undo, Cut, Copy, Paste (and even Redo when added to the EditMenu items) at the Cocoa level, but when it comes to Delete it is not responsive to getting it enabled. Even forcefully returning YES does not enable “Delete”. The code is
- (BOOL) validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>) anItem
{
// return YES;
SEL action = [anItem action];
if (action==@selector(undo:)) {
return [self canUndo];
}
else if (action==@selector(redo:)) {
return [self canRedo];
}
else if (action==@selector(cut:) || action==@selector(copy:) || action==@selector(clear:)) {
return mOwner.backend->HasSelection();
}
else if (action==@selector(paste:)) {
return mOwner.backend->CanPaste();
}
return YES;
}
Seems like the Delete item is very special and the question is:
is there anything that can be done at this level, other than resorting to the EnableMenuItems callback of the REALcontrol, and accessing this MenuItem through dynamic access?