Fixed bug to allow boxes to have elements inserted and removed from them dynamically.

This commit is contained in:
evaughan%netscape.com 1999-04-12 21:48:21 +00:00
Родитель 191461861a
Коммит fcb0e2034b
2 изменённых файлов: 69 добавлений и 5 удалений

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

@ -104,6 +104,55 @@ nsBoxFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
/*
void
nsBoxFrame::Reflow(nsIPresShell& aPresShell)
{
// generate a reflow command for "this"
nsIReflowCommand* reflowCmd = nsnull;
rv = NS_NewHTMLReflowCommand(&reflowCmd, target,
nsIReflowCommand::ReflowDirty);
if (NS_SUCCEEDED(rv)) {
aPresShell.AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
}
}
*/
NS_IMETHODIMP
nsBoxFrame::RemoveFrame(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aOldFrame)
{
// remove the child frame
nsresult rv = nsHTMLContainerFrame::RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame);
mFrames.DeleteFrame(aPresContext, aOldFrame);
return rv;
}
NS_IMETHODIMP
nsBoxFrame::InsertFrames(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList)
{
mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
return nsHTMLContainerFrame::InsertFrames(aPresContext, aPresShell, aListName, aPrevFrame, aFrameList);
}
NS_IMETHODIMP
nsBoxFrame::AppendFrames(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aFrameList)
{
mFrames.AppendFrames(nsnull, aFrameList);
return nsHTMLContainerFrame::AppendFrames(aPresContext, aPresShell, aListName, aFrameList);
}
NS_IMETHODIMP
nsBoxFrame::FlowChildAt(nsIFrame* childFrame,
nsIPresContext& aPresContext,

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

@ -94,13 +94,13 @@ public:
PRInt32 aHint);
// nsIHTMLReflow overrides
// nsIHTMLReflow overrides
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
@ -110,10 +110,26 @@ public:
nsEventStatus& aEventStatus);
PRBool IsHorizontal() const { return mHorizontal; }
NS_IMETHOD AppendFrames(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aFrameList);
NS_IMETHOD InsertFrames(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
NS_IMETHOD RemoveFrame(nsIPresContext& aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,
nsIFrame* aOldFrame);
PRBool IsHorizontal() const { return mHorizontal; }
protected:
nsBoxFrame();
nsBoxFrame();
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
@ -121,7 +137,6 @@ protected:
virtual PRIntn GetSkipSides() const { return 0; }
virtual void GetInset(nsMargin& margin);
virtual void Stretch(nsBoxDataSpring* springs, PRInt32 nSprings, nscoord& size);