Another method added to the menu frame.

This commit is contained in:
hyatt%netscape.com 1999-07-18 06:48:03 +00:00
Родитель 18083a388f
Коммит 97b3b296fb
2 изменённых файлов: 25 добавлений и 1 удалений

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

@ -18,7 +18,7 @@
#include "nsMenuFrame.h"
#include "nsAreaFrame.h"
#include "nsIContent.h"
#include "prtypes.h"
#include "nsIAtom.h"
@ -28,6 +28,8 @@
#include "nsINameSpaceManager.h"
#include "nsLayoutAtoms.h"
#define NS_MENU_POPUP_LIST_INDEX (NS_AREA_FRAME_ABSOLUTE_LIST_INDEX + 1)
//
// NS_NewMenuFrame
//
@ -83,3 +85,22 @@ nsMenuFrame::SetInitialChildList(nsIPresContext& aPresContext,
}
return rv;
}
NS_IMETHODIMP
nsMenuFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const
{
// Maintain a separate child list for the menu contents.
// This is necessary because we don't want the menu contents to be included in the layout
// of the menu's single item because it would take up space, when it is supposed to
// be floating above the display.
NS_PRECONDITION(nsnull != aListName, "null OUT parameter pointer");
*aListName = nsnull;
if (NS_MENU_POPUP_LIST_INDEX == aIndex) {
*aListName = nsLayoutAtoms::popupList;
NS_ADDREF(*aListName);
return NS_OK;
}
return nsBoxFrame::GetAdditionalChildListName(aIndex, aListName);
}

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

@ -45,6 +45,9 @@ public:
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const;
protected:
nsFrameList mPopupFrames;
}; // class nsMenuFrame