From 1cdf45be974c74f52a76981eea115d2704fa675f Mon Sep 17 00:00:00 2001
From: "rods%netscape.com" <rods%netscape.com>
Date: Wed, 17 Feb 1999 16:11:13 +0000
Subject: [PATCH] Added nsIMenuListener as the base class for nsIXULCommand

---
 xpfe/appshell/public/nsIXULCommand.h | 2 +-
 xpfe/appshell/src/nsXULCommand.cpp   | 7 +++++++
 xpfe/appshell/src/nsXULCommand.h     | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/xpfe/appshell/public/nsIXULCommand.h b/xpfe/appshell/public/nsIXULCommand.h
index 63633777fdd4f..9f3d86f4ef845 100644
--- a/xpfe/appshell/public/nsIXULCommand.h
+++ b/xpfe/appshell/public/nsIXULCommand.h
@@ -38,7 +38,7 @@ class nsIFactory;
 //----------------------------------------------------------------------
 
 
-class nsIXULCommand : public nsISupports {
+class nsIXULCommand : public nsIMenuListener {
 public:
 
   static const nsIID& IID() { static nsIID iid = NS_IXULCOMMAND_IID; return iid; }
diff --git a/xpfe/appshell/src/nsXULCommand.cpp b/xpfe/appshell/src/nsXULCommand.cpp
index ece940db0e742..3151db332df3d 100644
--- a/xpfe/appshell/src/nsXULCommand.cpp
+++ b/xpfe/appshell/src/nsXULCommand.cpp
@@ -345,6 +345,13 @@ nsresult nsXULCommand::KeyPress(nsIDOMEvent* aKeyEvent)
 {
   return NS_OK;
 }
+  
+
+nsEventStatus nsXULCommand::MenuSelected(const nsMenuEvent & aMenuEvent)
+{
+  DoCommand();
+  return nsEventStatus_eIgnore;//nsEventStatus_eConsumeNoDefault;
+}
 
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
diff --git a/xpfe/appshell/src/nsXULCommand.h b/xpfe/appshell/src/nsXULCommand.h
index 91e0e0f7d7a41..d685df606a322 100644
--- a/xpfe/appshell/src/nsXULCommand.h
+++ b/xpfe/appshell/src/nsXULCommand.h
@@ -88,6 +88,8 @@ public:
   virtual nsresult KeyUp(nsIDOMEvent* aKeyEvent);
   virtual nsresult KeyPress(nsIDOMEvent* aKeyEvent);
 
+  // nsIMenuListener 
+  virtual nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent);
 
 protected:
   NS_IMETHOD ExecuteJavaScriptString(nsIWebShell* aWebShell, nsString& aJavaScript);
-- 
GitLab