diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-06-06 13:21:07 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-06-06 13:21:07 +0000 |
commit | d3551a51ac9dc12131cd965aa35e5347a4b94cf8 (patch) | |
tree | 3242e8c7f71ca0f5e7189614acf5e34e460ce183 /vcl/source/control | |
parent | 135e6988c99e5995c6059caa229a372f9b56964e (diff) |
INTEGRATION: CWS ka009 (1.44.36); FILE MERGED
2007/06/06 13:25:56 ka 1.44.36.6: resolved conflicts
2007/06/06 12:51:12 ka 1.44.36.5: resolved conflicts
2007/02/12 16:42:45 ka 1.44.36.4: RESYNC: (1.45-1.46); FILE MERGED
2006/10/13 16:15:26 ka 1.44.36.3: RESYNC: (1.44-1.45); FILE MERGED
2006/07/14 14:56:58 dr 1.44.36.2: #i66680# warningfree
2006/07/12 22:03:52 ka 1.44.36.1: #i66680#: added patch for optimized ImageList handling
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/button.cxx | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index defb2ecb0eb7..7fedb8932b4d 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -4,9 +4,9 @@ * * $RCSfile: button.cxx,v $ * - * $Revision: 1.48 $ + * $Revision: 1.49 $ * - * last change: $Author: rt $ $Date: 2007-04-26 10:36:08 $ + * last change: $Author: ihi $ $Date: 2007-06-06 14:21:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -3115,6 +3115,31 @@ Size RadioButton::ImplGetRadioImageSize() const return aSize; } +static void LoadThemedImageList (const StyleSettings &rStyleSettings, + ImageList *pList, const ResId &rResId, + USHORT nImages) +{ + Color pColorAry1[6]; + Color pColorAry2[6]; + pColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); + pColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); + pColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); + pColorAry1[3] = Color( 0x80, 0x80, 0x80 ); + pColorAry1[4] = Color( 0x00, 0x00, 0x00 ); + pColorAry1[5] = Color( 0x00, 0xFF, 0x00 ); + pColorAry2[0] = rStyleSettings.GetFaceColor(); + pColorAry2[1] = rStyleSettings.GetWindowColor(); + pColorAry2[2] = rStyleSettings.GetLightColor(); + pColorAry2[3] = rStyleSettings.GetShadowColor(); + pColorAry2[4] = rStyleSettings.GetDarkShadowColor(); + pColorAry2[5] = rStyleSettings.GetWindowTextColor(); + + Color aMaskColor(0x00, 0x00, 0xFF ); + // FIXME: do we want the mask for the checkbox ? + pList->InsertFromHorizontalBitmap (rResId, nImages, &aMaskColor, + pColorAry1, pColorAry2, nImages); +} + Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags ) { ImplSVData* pSVData = ImplGetSVData(); @@ -3137,10 +3162,8 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags ) pSVData->maCtrlData.mnLastRadioWColor = rStyleSettings.GetWindowColor().GetColor(); pSVData->maCtrlData.mnLastRadioLColor = rStyleSettings.GetLightColor().GetColor(); - long aTempAry1[(6*sizeof(Color))/sizeof(long)]; - long aTempAry2[(6*sizeof(Color))/sizeof(long)]; - Color* pColorAry1 = (Color*)aTempAry1; - Color* pColorAry2 = (Color*)aTempAry2; + Color pColorAry1[6]; + Color pColorAry2[6]; pColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); pColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); pColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); @@ -3155,12 +3178,12 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, USHORT nFlags ) pColorAry2[5] = rStyleSettings.GetWindowTextColor(); ResMgr* pResMgr = ImplGetResMgr(); - Bitmap aBmp; + pSVData->maCtrlData.mpRadioImgList = new ImageList(); if( pResMgr ) - aBmp = Bitmap( ResId( SV_RESID_BITMAP_RADIO+nStyle, *pResMgr ) ); - aBmp.Replace( pColorAry1, pColorAry2, 6, NULL ); - pSVData->maCtrlData.mpRadioImgList = new ImageList( aBmp, Color( 0x00, 0x00, 0xFF ), 6 ); - pSVData->maCtrlData.mnRadioStyle = nStyle; + LoadThemedImageList( rStyleSettings, + pSVData->maCtrlData.mpRadioImgList, + ResId( SV_RESID_BITMAP_RADIO+nStyle, *pResMgr ), 6 ); + pSVData->maCtrlData.mnRadioStyle = nStyle; } USHORT nId; @@ -3979,29 +4002,12 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, USHORT nFlags ) pSVData->maCtrlData.mnLastCheckWColor = rStyleSettings.GetWindowColor().GetColor(); pSVData->maCtrlData.mnLastCheckLColor = rStyleSettings.GetLightColor().GetColor(); - long aTempAry1[(6*sizeof(Color))/sizeof(long)]; - long aTempAry2[(6*sizeof(Color))/sizeof(long)]; - Color* pColorAry1 = (Color*)aTempAry1; - Color* pColorAry2 = (Color*)aTempAry2; - pColorAry1[0] = Color( 0xC0, 0xC0, 0xC0 ); - pColorAry1[1] = Color( 0xFF, 0xFF, 0x00 ); - pColorAry1[2] = Color( 0xFF, 0xFF, 0xFF ); - pColorAry1[3] = Color( 0x80, 0x80, 0x80 ); - pColorAry1[4] = Color( 0x00, 0x00, 0x00 ); - pColorAry1[5] = Color( 0x00, 0xFF, 0x00 ); - pColorAry2[0] = rStyleSettings.GetFaceColor(); - pColorAry2[1] = rStyleSettings.GetWindowColor(); - pColorAry2[2] = rStyleSettings.GetLightColor(); - pColorAry2[3] = rStyleSettings.GetShadowColor(); - pColorAry2[4] = rStyleSettings.GetDarkShadowColor(); - pColorAry2[5] = rStyleSettings.GetWindowTextColor(); - ResMgr* pResMgr = ImplGetResMgr(); - Bitmap aBmp; + pSVData->maCtrlData.mpCheckImgList = new ImageList(); if( pResMgr ) - aBmp = Bitmap( ResId( SV_RESID_BITMAP_CHECK+nStyle, *pResMgr ) ); - aBmp.Replace( pColorAry1, pColorAry2, 6, NULL ); - pSVData->maCtrlData.mpCheckImgList = new ImageList( aBmp, 9 ); + LoadThemedImageList( rStyleSettings, + pSVData->maCtrlData.mpCheckImgList, + ResId( SV_RESID_BITMAP_CHECK+nStyle, *pResMgr ), 9 ); pSVData->maCtrlData.mnCheckStyle = nStyle; } |