Adding support for xpmenus not rolling up when a click is inside a parent.

git-svn-id: svn://10.0.0.236/trunk@65853 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pinkerton%netscape.com
2000-04-13 20:14:23 +00:00
parent 57c4d1e558
commit ae52c7cbda
4 changed files with 86 additions and 10 deletions

View File

@@ -265,24 +265,25 @@ nsMenuFrame::HandleEvent(nsIPresContext* aPresContext,
OpenMenu(PR_TRUE);
}
}
else if (aEvent->message == NS_MOUSE_LEFT_BUTTON_DOWN && !IsDisabled()) {
else if (aEvent->message == NS_MOUSE_LEFT_BUTTON_DOWN && !IsDisabled() && IsMenu() ) {
PRBool isMenuBar = PR_FALSE;
if (mMenuParent)
mMenuParent->IsMenuBar(isMenuBar);
// The menu item was selected. Bring up the menu.
// We have children.
if (mIsMenu)
if ( isMenuBar || !mMenuParent ) {
ToggleMenuState();
if (isMenuBar && mIsMenu) {
if (!IsOpen()) {
if (!IsOpen() && mMenuParent) {
// We closed up. The menu bar should always be
// deactivated when this happens.
mMenuParent->SetActive(PR_FALSE);
}
}
else
if ( !IsOpen() )
OpenMenu(PR_TRUE);
}
else if ( aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP && mMenuParent && !IsDisabled()) {
// if this menu is a context menu it accepts right-clicks...fire away!