Added box layout system.

This commit is contained in:
evaughan@netscape.com
1999-03-26 18:51:08 +00:00
parent 6de3ba0383
commit 14d0e6458a
16 changed files with 999 additions and 53 deletions

View File

@@ -27,12 +27,17 @@ nsButtonFrameRenderer::SetNameSpace(PRInt32 aNameSpace)
}
void
nsButtonFrameRenderer::SetFrame(nsIFrame* aFrame, nsIPresContext& aPresContext)
nsButtonFrameRenderer::SetFrame(nsFrame* aFrame, nsIPresContext& aPresContext)
{
mFrame = aFrame;
ReResolveStyles(aPresContext);
}
void
nsButtonFrameRenderer::Redraw()
{
mFrame->Invalidate(mOutlineRect, PR_TRUE);
}
nsString
nsButtonFrameRenderer::GetPseudoClassAttribute()
@@ -334,8 +339,14 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
nsRect rect;
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer)
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer)
{
// because we have and outline rect we need to
// store our bounds for redraw. We will change
// these bounds when outline appears
mOutlineRect = rect;
mOutlineRect.width = 0;
mOutlineRect.height= 0;
if (mOuterFocusStyle) {
// ---------- paint the outer focus border -------------
@@ -360,11 +371,11 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
}
}
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
{
if /*(mOutlineStyle) */ (PR_FALSE) {
if (mOutlineStyle) {
GetButtonOutlineRect(aRect, rect);
GetButtonOutlineRect(aRect, mOutlineRect);
const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOutlineStyle ->GetStyleData(eStyleStruct_Spacing);
@@ -374,7 +385,7 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
aRenderingContext.SetClipRect(rect, nsClipCombine_kReplace, clipEmpty);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
aDirtyRect, rect, *spacing, mOutlineStyle, 0);
aDirtyRect, mOutlineRect, *spacing, mOutlineStyle, 0);
aRenderingContext.PopState(clipEmpty);
}
@@ -529,10 +540,18 @@ nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding()
return borderAndPadding;
}
// gets the full size of our border with all the focus borders
nsMargin
nsButtonFrameRenderer::GetFullButtonBorderAndPadding()
{
return GetButtonOuterFocusBorderAndPadding() + GetButtonBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
return GetAddedButtonBorderAndPadding() + GetButtonBorderAndPadding();
}
// gets all the focus borders and padding that will be added to the regular border
nsMargin
nsButtonFrameRenderer::GetAddedButtonBorderAndPadding()
{
return GetButtonOuterFocusBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
}
void