Fix #98404#: Border and shadow for pages

This commit is contained in:
Andreas Martens 2002-04-08 13:33:17 +00:00
parent 61f22b170c
commit f6dae4a609
3 changed files with 79 additions and 29 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: paintfrm.cxx,v $
*
* $Revision: 1.25 $
* $Revision: 1.26 $
*
* last change: $Author: ama $ $Date: 2002-02-08 14:49:20 $
* last change: $Author: ama $ $Date: 2002-04-08 14:32:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -1360,6 +1360,32 @@ inline FASTBOOL IsShortCut( const SwRect &rRect, const SwRect &rFrmRect )
}
void lcl_PaintShadow( const SwRect& aFrm, ViewShell* pSh )
{
const Color& rColor = pSh->GetWin()->GetSettings().
GetStyleSettings().GetFieldTextColor();
Color aFill( pSh->GetOut()->GetFillColor() );
Color aLine( pSh->GetOut()->GetLineColor() );
pSh->GetOut()->SetFillColor( Color( COL_TRANSPARENT ) );
pSh->GetOut()->SetLineColor( rColor );
Rectangle aPageRect( aFrm.SVRect() );
pSh->GetOut()->DrawRect( aPageRect );
aPageRect = pSh->GetOut()->LogicToPixel( aPageRect );
Rectangle aShadow( aPageRect.Left()+2, aPageRect.Bottom()+1,
aPageRect.Right()+2, aPageRect.Bottom()+2 );
pSh->GetOut()->SetFillColor( rColor );
aShadow = pSh->GetOut()->PixelToLogic( aShadow );
pSh->GetOut()->DrawRect( aShadow );
aShadow.Left() = aPageRect.Right() + 1;
aShadow.Right() = aShadow.Left() + 1;
aShadow.Top() = aPageRect.Top() + 2;
aShadow.Bottom() = aPageRect.Bottom();
aShadow = pSh->GetOut()->PixelToLogic( aShadow );
pSh->GetOut()->DrawRect( aShadow );
pSh->GetOut()->SetFillColor( aFill );
pSh->GetOut()->SetLineColor( aLine );
}
//---------------- Ausgabe fuer das BrushItem ----------------
void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
@ -1672,6 +1698,8 @@ void SwRootFrm::Paint( const SwRect& rRect ) const
}
pPage->Paint( aPaintRect );
if( pSh->GetWin() )
lcl_PaintShadow( pPage->Frm(), pSh );
pLines->PaintLines( pSh->GetOut() );
BOOL bControlExtra = FALSE;

View file

@ -2,9 +2,9 @@
*
* $RCSfile: viewpg.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: os $ $Date: 2002-03-15 07:33:34 $
* last change: $Author: ama $ $Date: 2002-04-08 14:32:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -404,6 +404,7 @@ void ViewShell::PreViewPage(
const StyleSettings& rSettings = GetWin()->GetSettings().GetStyleSettings();
if(rSettings.GetHighContrastMode())
aLineColor = rSettings.GetHighlightTextColor();
const Color& rColor = rSettings.GetFieldTextColor();
for( nCntRow = 0; pPage && nCntRow < nRow; ++nCntRow )
{
aCalcPt.X() = aFreePt.X();
@ -418,6 +419,8 @@ void ViewShell::PreViewPage(
continue;
}
Rectangle aPageRect;
if( pPage->IsEmptyPage() )
{
Rectangle aRect( aCalcPt, rPageSize );
@ -430,15 +433,7 @@ void ViewShell::PreViewPage(
if( GetOut()->GetFillColor() != aRetouche )
GetOut()->SetFillColor( aRetouche );
if(!nSelectedPage)
{
Color aLine(GetOut()->GetLineColor());
GetOut()->SetLineColor(aLineColor);
GetOut()->DrawRect( aRect );
GetOut()->SetLineColor(aLine);
}
else
GetOut()->DrawRect( aRect );
GetOut()->DrawRect( aRect );
if( !pEmptyPgFont )
{
@ -459,6 +454,7 @@ void ViewShell::PreViewPage(
TEXT_DRAW_CENTER |
TEXT_DRAW_CLIP );
GetOut()->SetFont( aOldFont );
aPageRect = GetOut()->LogicToPixel( aRect );
aCalcPt.X() += rPageSize.Width()+1 + aFreePt.X();
}
@ -473,7 +469,7 @@ void ViewShell::PreViewPage(
GetOut()->SetMapMode( aMapMode );
Rectangle aSVRect( GetOut()->LogicToPixel( aVisArea.SVRect() ) );
Rectangle aMarkRect(aSVRect);
aPageRect = aSVRect;
if( aPixRect.IsOver( aSVRect ) )
{
aSVRect.Intersection( aPixRect );
@ -482,18 +478,39 @@ void ViewShell::PreViewPage(
Paint( aSVRect );
}
aCalcPt.X() += pPage->Frm().Width()+1 + aFreePt.X();
if(!nSelectedPage)
{
aMarkRect = GetOut()->PixelToLogic( aMarkRect );
Color aFill(GetOut()->GetFillColor());
Color aLine(GetOut()->GetLineColor());
GetOut()->SetFillColor(Color(COL_TRANSPARENT));
GetOut()->SetLineColor(aLineColor);
GetOut()->DrawRect(aMarkRect);
GetOut()->SetFillColor(aFill);
GetOut()->SetLineColor(aLine);
}
}
Rectangle aShadow( aPageRect.Left()+2, aPageRect.Bottom()+1,
aPageRect.Right()+2, aPageRect.Bottom()+2 );
Color aFill( GetOut()->GetFillColor() );
Color aLine( GetOut()->GetLineColor() );
GetOut()->SetFillColor( rColor );
GetOut()->SetLineColor( rColor );
aShadow = GetOut()->PixelToLogic( aShadow );
GetOut()->DrawRect( aShadow );
aShadow.Left() = aPageRect.Right() + 1;
aShadow.Right() = aShadow.Left() + 1;
aShadow.Top() = aPageRect.Top() + 2;
aShadow.Bottom() = aPageRect.Bottom();
aShadow = GetOut()->PixelToLogic( aShadow );
GetOut()->DrawRect( aShadow );
aShadow = GetOut()->PixelToLogic( aPageRect );
GetOut()->SetFillColor( Color( COL_TRANSPARENT ) );
GetOut()->DrawRect( aShadow );
if( !nSelectedPage )
{
aShadow.Left() = aPageRect.Right() - 1;
aShadow.Right() = aPageRect.Left() + 1;
aShadow.Top() = aPageRect.Top() + 1;
aShadow.Bottom() = aPageRect.Bottom() - 1;
aShadow = GetOut()->PixelToLogic( aShadow );
GetOut()->SetFillColor( Color( COL_TRANSPARENT ) );
GetOut()->SetLineColor( aLineColor );
GetOut()->DrawRect( aShadow );
}
GetOut()->SetFillColor( aFill );
GetOut()->SetLineColor( aLine );
pPage = (SwPageFrm*)pPage->GetNext();
nSelectedPage--;
}
@ -1300,6 +1317,9 @@ Size ViewShell::GetPagePreViewPrtMaxSize() const
/*************************************************************************
$Log: not supported by cvs2svn $
Revision 1.4 2002/03/15 07:33:34 os
#97978# page preview accessiblity implemented
Revision 1.3 2001/05/10 08:45:09 os
store print options at the document

View file

@ -2,9 +2,9 @@
*
* $RCSfile: viewsh.cxx,v $
*
* $Revision: 1.18 $
* $Revision: 1.19 $
*
* last change: $Author: mib $ $Date: 2002-03-21 12:53:04 $
* last change: $Author: ama $ $Date: 2002-04-08 14:33:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -1045,6 +1045,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
const SwTwips nRight = aBoth.Right();
SwTwips nMinLeft = LONG_MAX;
SwTwips nMaxRight= 0;
const nShadow = GetOut()->PixelToLogic( Size( 2, 0 ) ).Width();
while ( pPage &&
!((pPage->Frm().Top() > nBottom) ||
(pPage->Frm().Left() > nRight)))
@ -1053,8 +1054,9 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
{
if( pPage->Frm().Left() < nMinLeft )
nMinLeft = pPage->Frm().Left();
if( pPage->Frm().Right() > nMaxRight )
nMaxRight = pPage->Frm().Right();
long nPageRight = pPage->Frm().Right() + nShadow;
if( nPageRight > nMaxRight )
nMaxRight = nPageRight;
//Zus. auf die Zeichenobjekte abgleichen.
//Einen Ofst beruecksichtigen, weil die Objekte u.U.
//selektiert sind und die Henkel dann hinausstehen.