access keys no longer execute the command when item is disabled (bug 47006)

This commit is contained in:
pinkerton%netscape.com 2000-08-25 01:59:53 +00:00
Родитель 2645f23fcf
Коммит 0152a7779a
1 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -1131,15 +1131,25 @@ nsMenuFrame::Escape(PRBool& aHandledFlag)
return NS_OK;
}
//
// Enter
//
// Called when the user hits the <Enter>/<Return> keys or presses the
// shortcut key. If this is a leaf item, the item's action will be executed.
// If it is a submenu parent, open the submenu and select the first time.
// In either case, do nothing if the item is disabled.
//
NS_IMETHODIMP
nsMenuFrame::Enter()
{
if ( IsDisabled() )
return NS_OK;
if (!mMenuOpen) {
// The enter key press applies to us.
if (!IsMenu() && mMenuParent) {
// Execute our event handler
Execute();
}
if (!IsMenu() && mMenuParent)
Execute(); // Execute our event handler
else {
OpenMenu(PR_TRUE);
SelectFirstItem();