diff --git a/mozilla/widget/src/windows/nsMenu.cpp b/mozilla/widget/src/windows/nsMenu.cpp index f24ef8aee95..cdb86e0b63b 100644 --- a/mozilla/widget/src/windows/nsMenu.cpp +++ b/mozilla/widget/src/windows/nsMenu.cpp @@ -480,6 +480,7 @@ nsEventStatus nsMenu::MenuSelected(const nsMenuEvent & aMenuEvent) printf("Menu Selected %s\n", menuLabel); delete[] menuLabel; if (nsnull != mListener) { + NS_ASSERTION(false, "get debugger"); mListener->MenuSelected(aMenuEvent); } return nsEventStatus_eIgnore; @@ -497,3 +498,27 @@ nsEventStatus nsMenu::MenuDeselected(const nsMenuEvent & aMenuEvent) return nsEventStatus_eIgnore; } +//------------------------------------------------------------------------- +nsEventStatus nsMenu::MenuConstruct(const nsMenuEvent & aMenuEvent) +{ + char* menuLabel = GetACPString(mLabel); + printf("Menu Selected %s\n", menuLabel); + delete[] menuLabel; + if (nsnull != mListener) { + NS_ASSERTION(false, "get debugger"); + mListener->MenuSelected(aMenuEvent); + } + return nsEventStatus_eIgnore; +} + +//------------------------------------------------------------------------- +nsEventStatus nsMenu::MenuDestruct(const nsMenuEvent & aMenuEvent) +{ + char* menuLabel = GetACPString(mLabel); + printf("Menu Deselected %s\n", menuLabel); + delete[] menuLabel; + if (nsnull != mListener) { + mListener->MenuDeselected(aMenuEvent); + } + return nsEventStatus_eIgnore; +} \ No newline at end of file diff --git a/mozilla/widget/src/windows/nsMenu.h b/mozilla/widget/src/windows/nsMenu.h index 671e59ec114..77dd8a695b0 100644 --- a/mozilla/widget/src/windows/nsMenu.h +++ b/mozilla/widget/src/windows/nsMenu.h @@ -44,11 +44,11 @@ public: //nsIMenuListener interface nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent); nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent); - - NS_IMETHOD Create(nsISupports * aParent, const nsString &aLabel); - + nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent); + nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent); // nsIMenu Methods + NS_IMETHOD Create(nsISupports * aParent, const nsString &aLabel); NS_IMETHOD GetParent(nsISupports *&aParent); NS_IMETHOD GetLabel(nsString &aText); NS_IMETHOD SetLabel(const nsString &aText); diff --git a/mozilla/widget/src/windows/nsMenuBar.cpp b/mozilla/widget/src/windows/nsMenuBar.cpp index 87f552a4acc..ddb9cab26aa 100644 --- a/mozilla/widget/src/windows/nsMenuBar.cpp +++ b/mozilla/widget/src/windows/nsMenuBar.cpp @@ -79,6 +79,16 @@ nsEventStatus nsMenuBar::MenuDeselected(const nsMenuEvent & aMenuEvent) return nsEventStatus_eIgnore; } +nsEventStatus nsMenuBar::MenuConstruct(const nsMenuEvent & aMenuEvent) +{ + return nsEventStatus_eIgnore; +} + +nsEventStatus nsMenuBar::MenuDestruct(const nsMenuEvent & aMenuEvent) +{ + return nsEventStatus_eIgnore; +} + //------------------------------------------------------------------------- // // nsMenuBar constructor @@ -240,3 +250,10 @@ NS_METHOD nsMenuBar::Paint() mParent->Invalidate(PR_TRUE); return NS_OK; } + +NS_METHOD nsMenuBar::ConstructMenuBar(nsIDOMElement * menubarElement) +{ + // Build the menubar + //mDOMElement = menubarElement; + return NS_OK; +} diff --git a/mozilla/widget/src/windows/nsMenuBar.h b/mozilla/widget/src/windows/nsMenuBar.h index 0e979b7c29c..e519d4993f2 100644 --- a/mozilla/widget/src/windows/nsMenuBar.h +++ b/mozilla/widget/src/windows/nsMenuBar.h @@ -23,6 +23,10 @@ #include "nsWindow.h" #include "nsSwitchToUIThread.h" +#include "nsCOMPtr.h" +#include "nsIDOMElement.h" +#include "nsIWebShell.h" + #include "nsIMenuBar.h" #include "nsIMenuListener.h" #include "nsVoidArray.h" @@ -43,6 +47,8 @@ public: // nsIMenuListener interface nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent); nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent); + nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent); + nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent); NS_DECL_ISUPPORTS @@ -62,6 +68,8 @@ public: NS_IMETHOD Paint(); NS_IMETHOD SetNativeData(void* aData); + NS_IMETHOD ConstructMenuBar(nsIDOMElement * menubarElement); + protected: PRUint32 mNumMenus; HMENU mMenu; @@ -71,6 +79,8 @@ protected: nsVoidArray * mItems; + nsCOMPtr mWebShell; + nsCOMPtr mDOMElement; }; #endif // nsMenuBar_h__ diff --git a/mozilla/widget/src/windows/nsMenuItem.cpp b/mozilla/widget/src/windows/nsMenuItem.cpp index 57a340c1b45..ba797ad026b 100644 --- a/mozilla/widget/src/windows/nsMenuItem.cpp +++ b/mozilla/widget/src/windows/nsMenuItem.cpp @@ -314,3 +314,20 @@ nsEventStatus nsMenuItem::MenuDeselected(const nsMenuEvent & aMenuEvent) return nsEventStatus_eIgnore; } +//------------------------------------------------------------------------- +nsEventStatus nsMenuItem::MenuConstruct(const nsMenuEvent & aMenuEvent) +{ + if (mListener) { + mListener->MenuSelected(aMenuEvent); + } + return nsEventStatus_eIgnore; +} + +//------------------------------------------------------------------------- +nsEventStatus nsMenuItem::MenuDestruct(const nsMenuEvent & aMenuEvent) +{ + if (mListener) { + mListener->MenuDeselected(aMenuEvent); + } + return nsEventStatus_eIgnore; +} diff --git a/mozilla/widget/src/windows/nsMenuItem.h b/mozilla/widget/src/windows/nsMenuItem.h index 3391e173853..18c2ed73ecd 100644 --- a/mozilla/widget/src/windows/nsMenuItem.h +++ b/mozilla/widget/src/windows/nsMenuItem.h @@ -67,6 +67,8 @@ public: // nsIMenuListener interface nsEventStatus MenuSelected(const nsMenuEvent & aMenuEvent); nsEventStatus MenuDeselected(const nsMenuEvent & aMenuEvent); + nsEventStatus MenuConstruct(const nsMenuEvent & aMenuEvent); + nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent); // Need for Native Impl void SetCmdId(PRInt32 aId);