From 8b79ce996eeae764b425231a45e88094cf2b9a0c Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sun, 18 Jul 1999 03:16:58 +0000 Subject: [PATCH] Turning on XP menus. --- content/shared/public/nsXULAtomList.h | 7 +++++-- layout/base/nsCSSFrameConstructor.cpp | 20 +++++++++---------- .../html/style/src/nsCSSFrameConstructor.cpp | 20 +++++++++---------- layout/xul/content/src/nsXULAtomList.h | 7 +++++-- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/content/shared/public/nsXULAtomList.h b/content/shared/public/nsXULAtomList.h index 7674d116b11b..c8e62784a202 100644 --- a/content/shared/public/nsXULAtomList.h +++ b/content/shared/public/nsXULAtomList.h @@ -66,8 +66,11 @@ XUL_ATOM(treepusher, "treepusher") // A column pusher (left or right) for the tr XUL_ATOM(menuitem, "menuitem") // The menu element XUL_ATOM(menubar, "menubar") // The menubar element XUL_ATOM(menu, "menu") // A single menu item -XUL_ATOM(menubutton, "menubutton") // A button inside an XP menu. -XUL_ATOM(menuchildren, "menuchildren") // The menu's children. + +XUL_ATOM(xpmenubar, "xpmenubar") // An XP menu bar. +XUL_ATOM(xpmenu, "xpmenu") // Represents an XP menu +XUL_ATOM(xpmenubutton, "xpmenubutton") // A titled button (with improved behavior) inside an XP menu. +XUL_ATOM(xpmenuchildren, "xpmenuchildren") // The XP menu's children. XUL_ATOM(progressmeter, "progressmeter") XUL_ATOM(titledbutton, "titledbutton") diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 1a1d00a0541f..ac6b0509d9e3 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1816,10 +1816,9 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext, (nsXULAtoms::treecolgroup == tag.get()) || (nsXULAtoms::treefoot == tag.get()) || (nsXULAtoms::treepusher == tag.get()) || - (nsXULAtoms::menu == tag.get()) || - (nsXULAtoms::menuitem == tag.get()) || - (nsXULAtoms::menubar == tag.get()) || - (nsXULAtoms::menubutton == tag.get()) || + (nsXULAtoms::xpmenu == tag.get()) || + (nsXULAtoms::xpmenubar == tag.get()) || + (nsXULAtoms::xpmenubutton == tag.get()) || (nsXULAtoms::toolbox == tag.get()) || (nsXULAtoms::toolbar == tag.get()) || (nsXULAtoms::toolbaritem == tag.get()) || @@ -2765,7 +2764,8 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresContext* aPresConte aTag != nsHTMLAtoms::combobox && aTag != nsXULAtoms::slider && aTag != nsXULAtoms::splitter && - aTag != nsXULAtoms::scrollbar + aTag != nsXULAtoms::scrollbar && + aTag != nsXULAtoms::xpmenu ) { return NS_OK; @@ -3017,28 +3017,26 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, } // End of PROGRESS METER CONSTRUCTION logic -#ifdef XP_MENUS // Menu Construction - else if (aTag == nsXULAtoms::menu || aTag == nsXULAtoms::menuitem) { + else if (aTag == nsXULAtoms::xpmenu) { // XXX Will eventually make a derived class box frame - // that has custom reflow to prevent menuchildren + // that has custom reflow to prevent menu children // from becoming part of the flow. processChildren = PR_TRUE; // Will need this to be custom. isReplaced = PR_TRUE; rv = NS_NewBoxFrame(&newFrame); } - else if (aTag == nsXULAtoms::menubar) { + else if (aTag == nsXULAtoms::xpmenubar) { // XXX Will be a derived class toolbar frame. processChildren = PR_TRUE; rv = NS_NewToolbarFrame(&newFrame); } - else if (aTag == nsXULAtoms::menubutton) { + else if (aTag == nsXULAtoms::xpmenubutton) { // XXX Will be a derived class titledbutton frame processChildren = PR_TRUE; isReplaced = PR_TRUE; rv = NS_NewTitledButtonFrame(&newFrame); } -#endif // XP_MENUS // BOX CONSTRUCTION else if (aTag == nsXULAtoms::box || aTag == nsXULAtoms::tabbox || diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 1a1d00a0541f..ac6b0509d9e3 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -1816,10 +1816,9 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext, (nsXULAtoms::treecolgroup == tag.get()) || (nsXULAtoms::treefoot == tag.get()) || (nsXULAtoms::treepusher == tag.get()) || - (nsXULAtoms::menu == tag.get()) || - (nsXULAtoms::menuitem == tag.get()) || - (nsXULAtoms::menubar == tag.get()) || - (nsXULAtoms::menubutton == tag.get()) || + (nsXULAtoms::xpmenu == tag.get()) || + (nsXULAtoms::xpmenubar == tag.get()) || + (nsXULAtoms::xpmenubutton == tag.get()) || (nsXULAtoms::toolbox == tag.get()) || (nsXULAtoms::toolbar == tag.get()) || (nsXULAtoms::toolbaritem == tag.get()) || @@ -2765,7 +2764,8 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresContext* aPresConte aTag != nsHTMLAtoms::combobox && aTag != nsXULAtoms::slider && aTag != nsXULAtoms::splitter && - aTag != nsXULAtoms::scrollbar + aTag != nsXULAtoms::scrollbar && + aTag != nsXULAtoms::xpmenu ) { return NS_OK; @@ -3017,28 +3017,26 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, } // End of PROGRESS METER CONSTRUCTION logic -#ifdef XP_MENUS // Menu Construction - else if (aTag == nsXULAtoms::menu || aTag == nsXULAtoms::menuitem) { + else if (aTag == nsXULAtoms::xpmenu) { // XXX Will eventually make a derived class box frame - // that has custom reflow to prevent menuchildren + // that has custom reflow to prevent menu children // from becoming part of the flow. processChildren = PR_TRUE; // Will need this to be custom. isReplaced = PR_TRUE; rv = NS_NewBoxFrame(&newFrame); } - else if (aTag == nsXULAtoms::menubar) { + else if (aTag == nsXULAtoms::xpmenubar) { // XXX Will be a derived class toolbar frame. processChildren = PR_TRUE; rv = NS_NewToolbarFrame(&newFrame); } - else if (aTag == nsXULAtoms::menubutton) { + else if (aTag == nsXULAtoms::xpmenubutton) { // XXX Will be a derived class titledbutton frame processChildren = PR_TRUE; isReplaced = PR_TRUE; rv = NS_NewTitledButtonFrame(&newFrame); } -#endif // XP_MENUS // BOX CONSTRUCTION else if (aTag == nsXULAtoms::box || aTag == nsXULAtoms::tabbox || diff --git a/layout/xul/content/src/nsXULAtomList.h b/layout/xul/content/src/nsXULAtomList.h index 7674d116b11b..c8e62784a202 100644 --- a/layout/xul/content/src/nsXULAtomList.h +++ b/layout/xul/content/src/nsXULAtomList.h @@ -66,8 +66,11 @@ XUL_ATOM(treepusher, "treepusher") // A column pusher (left or right) for the tr XUL_ATOM(menuitem, "menuitem") // The menu element XUL_ATOM(menubar, "menubar") // The menubar element XUL_ATOM(menu, "menu") // A single menu item -XUL_ATOM(menubutton, "menubutton") // A button inside an XP menu. -XUL_ATOM(menuchildren, "menuchildren") // The menu's children. + +XUL_ATOM(xpmenubar, "xpmenubar") // An XP menu bar. +XUL_ATOM(xpmenu, "xpmenu") // Represents an XP menu +XUL_ATOM(xpmenubutton, "xpmenubutton") // A titled button (with improved behavior) inside an XP menu. +XUL_ATOM(xpmenuchildren, "xpmenuchildren") // The XP menu's children. XUL_ATOM(progressmeter, "progressmeter") XUL_ATOM(titledbutton, "titledbutton")