From e8504ef8f19be56b114d7658c0f52ca555fc600a Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Fri, 13 Sep 2002 11:20:41 +0000 Subject: #103250# allow to paint into layout data --- svtools/source/contnr/imivctl.hxx | 9 ++++--- svtools/source/contnr/imivctl1.cxx | 49 ++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index cb1e2a58b9fe..ea1bb71d8fef 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: imivctl.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: pb $ $Date: 2002-08-13 07:25:03 $ + * last change: $Author: fs $ $Date: 2002-09-13 12:20:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,6 +128,8 @@ class IcnGridMap_Impl; #define DEFAULT_MAX_VIRT_WIDTH 200 #define DEFAULT_MAX_VIRT_HEIGHT 200 +#define VIEWMODE_MASK (WB_ICON | WB_SMALLICON | WB_DETAILS) + /////////////////////////////////////////////////////////////////////////////// // // @@ -464,7 +466,8 @@ public: SvxIconChoiceCtrlEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut, - const String* pStr = 0 ); + const String* pStr = 0, + ::vcl::ControlLayoutData* _pLayoutData = NULL ); // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); } diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 7dc1de1be2f6..ba24ff0349e8 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: imivctl1.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: pb $ $Date: 2002-08-13 07:25:04 $ + * last change: $Author: fs $ $Date: 2002-09-13 12:20:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,6 +88,9 @@ #ifndef _SV_MNEMONIC_HXX #include #endif +#ifndef _VCL_CONTROLLAYOUT_HXX +#include +#endif #pragma hdrstop @@ -97,8 +100,6 @@ #include -#define VIEWMODE_MASK (WB_ICON | WB_SMALLICON | WB_DETAILS) - #define DD_SCROLL_PIXEL 24 #define IMPICNVIEW_ACC_RETURN 1 #define IMPICNVIEW_ACC_ESCAPE 2 @@ -1893,7 +1894,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis( void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect, IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, USHORT nPaintFlags, - OutputDevice* pOut, const String* pStr ) + OutputDevice* pOut, const String* pStr, ::vcl::ControlLayoutData* _pLayoutData ) { if( eItem == IcnViewFieldTypeText ) { @@ -1903,25 +1904,33 @@ void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect, else aText = *pStr; - if ( pView->AutoFontColor() ) + if ( _pLayoutData ) { - Color aBkgColor( pOut->GetBackground().GetColor() ); - Color aFontColor; - USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; - if ( nColor > 128 ) - aFontColor.SetColor ( COL_BLACK ); - else - aFontColor.SetColor( COL_WHITE ); - pOut->SetTextColor( aFontColor ); + pOut->DrawText( rRect, aText, nCurTextDrawFlags, + &_pLayoutData->m_aUnicodeBoundRects, &_pLayoutData->m_aDisplayText ); } + else + { + if ( pView->AutoFontColor() ) + { + Color aBkgColor( pOut->GetBackground().GetColor() ); + Color aFontColor; + USHORT nColor = ( aBkgColor.GetRed() + aBkgColor.GetGreen() + aBkgColor.GetBlue() ) / 3; + if ( nColor > 128 ) + aFontColor.SetColor ( COL_BLACK ); + else + aFontColor.SetColor( COL_WHITE ); + pOut->SetTextColor( aFontColor ); + } - pOut->DrawText( rRect, aText, nCurTextDrawFlags ); + pOut->DrawText( rRect, aText, nCurTextDrawFlags ); - if( pEntry->IsFocused() ) - { - Rectangle aRect ( CalcFocusRect( (SvxIconChoiceCtrlEntry*)pEntry ) ); - /*pView->*/ShowFocus( aRect ); - DrawFocusRect( pOut ); + if( pEntry->IsFocused() ) + { + Rectangle aRect ( CalcFocusRect( (SvxIconChoiceCtrlEntry*)pEntry ) ); + /*pView->*/ShowFocus( aRect ); + DrawFocusRect( pOut ); + } } } else -- cgit