Still screwing around with menus.

This commit is contained in:
hyatt%netscape.com 1999-07-20 08:19:47 +00:00
Родитель 6ffca71859
Коммит 5233e40e03
2 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -16,7 +16,7 @@
* Reserved.
*/
#include "nsXULAtoms.h"
#include "nsMenuFrame.h"
#include "nsAreaFrame.h"
#include "nsIContent.h"
@ -81,6 +81,26 @@ nsMenuFrame::SetInitialChildList(nsIPresContext& aPresContext,
if (nsLayoutAtoms::popupList == aListName) {
mPopupFrames.SetFrames(aChildList);
} else {
nsFrameList frames(aChildList);
// We may have an xpmenuchildren in here. Get it out, and move it into
// the popup frame list.
nsIFrame* frame = frames.FirstChild();
while (frame) {
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
nsCOMPtr<nsIAtom> tag;
content->GetTag(*getter_AddRefs(tag));
if (tag.get() == nsXULAtoms::xpmenuchildren) {
// Remove this frame from the list and place it in the other list.
frames.RemoveFrame(frame);
mPopupFrames.AppendFrame(this, frame);
rv = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
return rv;
}
frame->GetNextSibling(&frame);
}
rv = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
}
return rv;
@ -120,4 +140,4 @@ nsMenuFrame::GetFrameForPoint(const nsPoint& aPoint,
{
*aFrame = this; // Capture all events so that we can perform selection
return NS_OK;
}
}

Просмотреть файл

@ -69,7 +69,7 @@ nsMenuPopupFrame::Init(nsIPresContext& aPresContext,
aContext,
PR_FALSE,
getter_AddRefs(menuStyle));
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, menuStyle, aPrevInFlow);
rv = nsBoxFrame::Init(aPresContext, aContent, aParent, menuStyle, aPrevInFlow);
CreateViewForFrame(aPresContext, this, menuStyle, PR_TRUE);
return rv;
}