summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2002-09-13 11:20:41 +0000
committerFrank Schönheit <fs@openoffice.org>2002-09-13 11:20:41 +0000
commite8504ef8f19be56b114d7658c0f52ca555fc600a (patch)
treeaa5bf2c7edcb9a8c427baab2debd6dad1a2c6782
parenta7a2496d16717f418072751e67a024a0450e0fdc (diff)
#103250# allow to paint into layout data
-rw-r--r--svtools/source/contnr/imivctl.hxx9
-rw-r--r--svtools/source/contnr/imivctl1.cxx49
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 <vcl/mnemonic.hxx>
#endif
+#ifndef _VCL_CONTROLLAYOUT_HXX
+#include <vcl/controllayout.hxx>
+#endif
#pragma hdrstop
@@ -97,8 +100,6 @@
#include <algorithm>
-#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