remove menu listener usage from cocoa widget nsIWidgets. b=396820 r=cbarrett sr=roc a=roc

This commit is contained in:
joshmoz@gmail.com 2007-09-20 01:56:42 -07:00
parent d8eb6e9eed
commit 89d68c33ee
4 changed files with 2 additions and 22 deletions

View File

@ -1335,13 +1335,10 @@ NS_IMETHODIMP nsChildView::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStat
}
}
}
if (mMenuListener && event->eventStructType == NS_MENU_EVENT)
aStatus = mMenuListener->MenuSelected(static_cast<nsMenuEvent&>(*event));
if (mEventCallback)
aStatus = (*mEventCallback)(event);
// dispatch to event listener if event was not consumed
if (mEventListener && aStatus != nsEventStatus_eConsumeNoDefault)
aStatus = mEventListener->ProcessEvent(*event);

View File

@ -149,7 +149,6 @@ public:
NS_IMETHOD Show(PRBool aState);
NS_IMETHOD AddMouseListener(nsIMouseListener * aListener);
NS_IMETHOD AddEventListener(nsIEventListener * aListener);
NS_IMETHOD AddMenuListener(nsIMenuListener * aListener);
NS_IMETHOD Enable(PRBool aState);
NS_IMETHOD IsEnabled(PRBool *aState);
NS_IMETHOD SetModal(PRBool aState);

View File

@ -652,17 +652,6 @@ NS_METHOD nsCocoaWindow::AddEventListener(nsIEventListener * aListener)
}
NS_METHOD nsCocoaWindow::AddMenuListener(nsIMenuListener * aListener)
{
nsBaseWidget::AddMenuListener(aListener);
if (mPopupContentView)
mPopupContentView->AddMenuListener(aListener);
return NS_OK;
}
NS_IMETHODIMP nsCocoaWindow::Enable(PRBool aState)
{
return NS_OK;
@ -941,9 +930,6 @@ nsCocoaWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus)
nsIWidget* aWidget = event->widget;
NS_IF_ADDREF(aWidget);
if (mMenuListener && event->eventStructType == NS_MENU_EVENT)
aStatus = mMenuListener->MenuSelected(static_cast<nsMenuEvent&>(*event));
if (mEventCallback)
aStatus = (*mEventCallback)(event);

View File

@ -358,8 +358,6 @@ nsMenuBarX::MenuConstruct(const nsMenuEvent & aMenuEvent, nsIWidget* aParentWind
doc->AddMutationObserver(this);
mDocument = doc;
aParentWindow->AddMenuListener((nsIMenuListener *)this);
PRUint32 count = mMenuBarContent->GetChildCount();
for (PRUint32 i = 0; i < count; i++) {
nsIContent *menu = mMenuBarContent->GetChildAt(i);