diff options
author | Carsten Driesner <cd@openoffice.org> | 2002-07-31 06:31:01 +0000 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2002-07-31 06:31:01 +0000 |
commit | 110b2f24b604ef37141167943e58c03ec9754528 (patch) | |
tree | 140703db231e5d62238e3ac9c274f7bc7edf9416 /sfx2 | |
parent | 01f8d0ed0e7241154f284f61b6976286f085d169 (diff) |
#101060# Support HC bitmaps for GetContent/GetStyleFamilyBitmap
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docvor.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 74 |
2 files changed, 76 insertions, 26 deletions
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index cb52c2437edc..721c7761c1b8 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docvor.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: gt $ $Date: 2002-07-26 13:32:40 $ + * last change: $Author: cd $ $Date: 2002-07-31 07:31:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,6 +98,7 @@ #include <vcl/waitobj.hxx> #endif #include <tools/urlobj.hxx> +#include <tools/color.hxx> #include <svtools/pathoptions.hxx> #pragma hdrstop @@ -1183,10 +1184,20 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) { // wenn keine Childs vorhanden sind, gfs. Childs // einfuegen + BmpColorMode eColorMode = BMP_COLOR_NORMAL; + + if ( GetDisplayBackground().GetColor().IsDark() ) + eColorMode = BMP_COLOR_HIGHCONTRAST; + + if ( !GetModel()->HasChilds( pEntry ) ) { WaitObject aWaitCursor( this ); + // Choose the correct mask color dependent from eColorMode. This must be adopted if + // we change the mask color for normal images, too! + Color aMaskColor(( eColorMode == BMP_COLOR_NORMAL ) ? COL_LIGHTGRAY : COL_LIGHTMAGENTA ); + // hier sind alle initial eingefuegt SfxErrorContext aEc(ERRCTX_SFX_CREATEOBJSH, pDlg->pDialog); if(VIEW_TEMPLATES == GetViewType() && 0 == GetModel()->GetDepth(pEntry)) @@ -1213,15 +1224,16 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry ) for(USHORT i = 0; i < nCount; ++i) { BOOL bDeletable; - // #101060# - // !! NOT SOLVED YET: - // GetContent() only returns normal bitmaps and no HC ones. This hast to be extended to show - // HC-images for the doc contents! aRef->GetContent( - aText, aClosedBmp, aOpenedBmp, bDeletable, + aText, aClosedBmp, aOpenedBmp, eColorMode, bDeletable, i, aPath[nDocLevel+1], aPath[nDocLevel+2]); + + // Create image with the correct mask color + Image aClosedImage( aClosedBmp, aMaskColor ); + Image aOpenedImage( aOpenedBmp, aMaskColor ); + SvLBoxEntry *pNew = SvTreeListBox::InsertEntry( - aText, aOpenedBmp, aClosedBmp, + aText, aOpenedImage, aClosedImage, pEntry, bCanHaveChilds); pNew->SetUserData(bDeletable ? &bDeletable : 0); } diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index f891f62c3ce8..c7b5ab65a3c4 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: objcont.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: mav $ $Date: 2002-07-17 14:39:50 $ + * last change: $Author: cd $ $Date: 2002-07-31 07:30:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1048,13 +1048,28 @@ BOOL SfxObjectShell::CanHaveChilds(USHORT nIdx1, //-------------------------------------------------------------------- +void SfxObjectShell::GetContent(String &rText, + Bitmap &rClosedBitmap, + Bitmap &rOpenedBitmap, + BOOL &bCanDel, + USHORT i, + USHORT nIdx1, + USHORT nIdx2 ) +{ + DBG_ERRORFILE( "Non high contrast method called. Please update calling code!" ); + SfxObjectShell::GetContent( rText, rClosedBitmap, rOpenedBitmap, BMP_COLOR_NORMAL, bCanDel, i, nIdx1, nIdx2 ); +} + +//-------------------------------------------------------------------- + void SfxObjectShell::GetContent(String &rText, - Bitmap &rClosedBitmap, - Bitmap &rOpenedBitmap, - BOOL &bCanDel, - USHORT i, - USHORT nIdx1, - USHORT nIdx2) + Bitmap &rClosedBitmap, + Bitmap &rOpenedBitmap, + BmpColorMode eColorMode, + BOOL &bCanDel, + USHORT i, + USHORT nIdx1, + USHORT nIdx2 ) { bCanDel=TRUE; @@ -1069,13 +1084,29 @@ void SfxObjectShell::GetContent(String &rText, { case CONTENT_STYLE: nTextResId = STR_STYLES; - nClosedBitmapResId= BMP_STYLES_CLOSED; - nOpenedBitmapResId= BMP_STYLES_OPENED; + if ( eColorMode == BMP_COLOR_NORMAL ) + { + nClosedBitmapResId= BMP_STYLES_CLOSED; + nOpenedBitmapResId= BMP_STYLES_OPENED; + } + else + { + nClosedBitmapResId= BMP_STYLES_CLOSED_HC; + nOpenedBitmapResId= BMP_STYLES_OPENED_HC; + } break; case CONTENT_MACRO: nTextResId = STR_MACROS; - nClosedBitmapResId= BMP_STYLES_CLOSED; - nOpenedBitmapResId= BMP_STYLES_OPENED; + if ( eColorMode == BMP_COLOR_NORMAL ) + { + nClosedBitmapResId= BMP_STYLES_CLOSED; + nOpenedBitmapResId= BMP_STYLES_OPENED; + } + else + { + nClosedBitmapResId= BMP_STYLES_CLOSED_HC; + nOpenedBitmapResId= BMP_STYLES_OPENED_HC; + } break; /* case CONTENT_CONFIG: @@ -1104,7 +1135,7 @@ void SfxObjectShell::GetContent(String &rText, bCanDel=((pStyle->GetMask() & SFXSTYLEBIT_USERDEF) == SFXSTYLEBIT_USERDEF); rClosedBitmap = rOpenedBitmap = - GetStyleFamilyBitmap(pStyle->GetFamily()); + GetStyleFamilyBitmap(pStyle->GetFamily(), eColorMode ); } break; case CONTENT_MACRO: @@ -1126,23 +1157,30 @@ void SfxObjectShell::GetContent(String &rText, } //-------------------------------------------------------------------- +Bitmap SfxObjectShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily ) +{ + DBG_ERRORFILE( "Non high contrast method called. Please update calling code!" ); + return SfxObjectShell::GetStyleFamilyBitmap( eFamily, BMP_COLOR_NORMAL ); +} + +//-------------------------------------------------------------------- -Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily) +Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily, BmpColorMode eColorMode ) { USHORT nResId = 0; switch(eFamily) { case SFX_STYLE_FAMILY_CHAR: - nResId = BMP_STYLES_FAMILY1; + nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY1 : BMP_STYLES_FAMILY1_HC; break; case SFX_STYLE_FAMILY_PARA: - nResId = BMP_STYLES_FAMILY2; + nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY2 : BMP_STYLES_FAMILY2_HC; break; case SFX_STYLE_FAMILY_FRAME: - nResId = BMP_STYLES_FAMILY3; + nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY3 : BMP_STYLES_FAMILY3_HC; break; case SFX_STYLE_FAMILY_PAGE : - nResId = BMP_STYLES_FAMILY4; + nResId = ( eColorMode == BMP_COLOR_NORMAL ) ? BMP_STYLES_FAMILY4 : BMP_STYLES_FAMILY4_HC; break; } |