diff options
author | Oliver Specht <os@openoffice.org> | 2002-02-27 12:45:00 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2002-02-27 12:45:00 +0000 |
commit | e08c3172aae4fec8ce9bb562f47f9bc403201274 (patch) | |
tree | b1896e36fc4dbae6c63ae0fbdd3b10fc5965f866 /sw/source/ui | |
parent | 88ced61b1e59705c69cac83cdbb83efb9b6bcfa1 (diff) |
#97576# columns preview high contrast aware
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/frmdlg/colex.cxx | 126 |
1 files changed, 75 insertions, 51 deletions
diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx index 1ddedc2ee7ea..f30bd966fe18 100644 --- a/sw/source/ui/frmdlg/colex.cxx +++ b/sw/source/ui/frmdlg/colex.cxx @@ -2,9 +2,9 @@ * * $RCSfile: colex.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: os $ $Date: 2002-02-13 10:19:16 $ + * last change: $Author: os $ $Date: 2002-02-27 13:45:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -279,59 +279,69 @@ void SwColExample::DrawPage( const Point& rOrg, nR = GetLeft(); } - SetFillColor( Color( COL_LIGHTGRAY ) ); - Rectangle aRect; - aRect.Right() = rOrg.X() + GetSize().Width() - nR; - aRect.Left() = rOrg.X() + nL; - aRect.Top() = rOrg.Y() + GetTop() - + GetHdHeight() + GetHdDist(); - aRect.Bottom()= rOrg.Y() + GetSize().Height() - GetBottom() - - GetFtHeight() - GetFtDist(); - DrawRect(aRect); - - SetFillColor( GetColor() ); USHORT nColumnCount = pColMgr->GetCount(); - for(USHORT i = 0; i < nColumnCount; i++) + if(nColumnCount) { - aRect.Right() = aRect.Left() + pColMgr->GetColWidth( i ); + SetFillColor( Color( COL_LIGHTGRAY ) ); + Rectangle aRect; + aRect.Right() = rOrg.X() + GetSize().Width() - nR; + aRect.Left() = rOrg.X() + nL; + aRect.Top() = rOrg.Y() + GetTop() + + GetHdHeight() + GetHdDist(); + aRect.Bottom()= rOrg.Y() + GetSize().Height() - GetBottom() + - GetFtHeight() - GetFtDist(); DrawRect(aRect); - if(i < nColumnCount - 1) - aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i); - } - if(pColMgr->HasLine()) - { -// SetPen( Pen ( PEN_SOLID ) ); - Point aUp( rOrg.X() + nL, rOrg.Y() + GetTop() ); - Point aDown( rOrg.X() + nL, rOrg.Y() + GetSize().Height() - - GetBottom() - GetFtHeight() - GetFtDist() ); - if( pColMgr->GetLineHeightPercent() != 100 ) + if(GetColor() == Color(COL_TRANSPARENT)) { - long nLength = aDown.Y() - aUp.Y(); - nLength -= nLength * pColMgr->GetLineHeightPercent() / 100; - switch(pColMgr->GetAdjust()) + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + const Color& rFieldColor = rStyleSettings.GetFieldColor(); + SetFillColor( rFieldColor ); + } + else + SetFillColor( GetColor() ); + for(USHORT i = 0; i < nColumnCount; i++) + { + aRect.Right() = aRect.Left() + pColMgr->GetColWidth( i ); + DrawRect(aRect); + if(i < nColumnCount - 1) + aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i); + } + if(pColMgr->HasLine()) + { + // SetPen( Pen ( PEN_SOLID ) ); + Point aUp( rOrg.X() + nL, rOrg.Y() + GetTop() ); + Point aDown( rOrg.X() + nL, rOrg.Y() + GetSize().Height() + - GetBottom() - GetFtHeight() - GetFtDist() ); + + if( pColMgr->GetLineHeightPercent() != 100 ) { - case COLADJ_BOTTOM: aUp.Y() += nLength; break; - case COLADJ_TOP: aDown.Y() -= nLength; break; - case COLADJ_CENTER: - aUp.Y() += nLength / 2; - aDown.Y() -= nLength / 2; - break; + long nLength = aDown.Y() - aUp.Y(); + nLength -= nLength * pColMgr->GetLineHeightPercent() / 100; + switch(pColMgr->GetAdjust()) + { + case COLADJ_BOTTOM: aUp.Y() += nLength; break; + case COLADJ_TOP: aDown.Y() -= nLength; break; + case COLADJ_CENTER: + aUp.Y() += nLength / 2; + aDown.Y() -= nLength / 2; + break; + } } - } - int nDist; - for( i = 0; i < nColumnCount - 1; i++) - { - int nGutter = pColMgr->GetGutterWidth(i); - nDist = pColMgr->GetColWidth( i ) + nGutter; - nDist -= (i == 0) ? - nGutter/2 : - 0; - aUp.X() += nDist; - aDown.X() += nDist; - DrawLine( aUp, aDown ); + int nDist; + for( i = 0; i < nColumnCount - 1; i++) + { + int nGutter = pColMgr->GetGutterWidth(i); + nDist = pColMgr->GetColWidth( i ) + nGutter; + nDist -= (i == 0) ? + nGutter/2 : + 0; + aUp.X() += nDist; + aDown.X() += nDist; + DrawLine( aUp, aDown ); + } } } } @@ -374,21 +384,35 @@ SwColumnOnlyExample::SwColumnOnlyExample( Window* pParent, const ResId& rResId) void SwColumnOnlyExample::Paint( const Rectangle& rRect ) { + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + const Color& rFieldColor = rStyleSettings.GetFieldColor(); + const Color& rDlgColor = rStyleSettings.GetDialogColor(); + const Color& rFieldTextColor = rStyleSettings.GetFieldTextColor(); + Color aGrayColor(COL_LIGHTGRAY); + if(rFieldColor == aGrayColor) + aGrayColor.Invert(); + Size aLogSize(PixelToLogic(GetOutputSizePixel())); + Rectangle aCompleteRect(Point(0,0), aLogSize); + SetLineColor(rDlgColor); + SetFillColor(rDlgColor); + DrawRect(aCompleteRect); + + SetLineColor( rFieldTextColor ); Point aTL( (aLogSize.Width() - aFrmSize.Width()) / 2, (aLogSize.Height() - aFrmSize.Height()) / 2); Rectangle aRect(aTL, aFrmSize); - //draw a shado rectangle - SetFillColor( Color( COL_GRAY ) ); + //draw a shadow rectangle + SetFillColor( Color(COL_GRAY) ); Rectangle aShadowRect(aRect); aShadowRect.Move(aTL.Y(), aTL.Y()); DrawRect(aShadowRect); - SetFillColor( Color( COL_WHITE ) ); + SetFillColor( rFieldColor ); DrawRect(aRect); - SetFillColor(Color( COL_LIGHTGRAY ) ); + SetFillColor( aGrayColor ); //Spaltentrenner? long nLength = aLogSize.Height() - 2 * aTL.Y(); @@ -420,7 +444,7 @@ void SwColumnOnlyExample::Paint( const Rectangle& rRect ) if( nColCount ) { DrawRect(aRect); - SetFillColor( Color( COL_WHITE ) ); + SetFillColor( rFieldColor ); Rectangle aFrmRect(aTL, aFrmSize); long nSum = aTL.X(); for(USHORT i = 0; i < nColCount; i++) |