ExtPaintManager.cpp
上传用户:sesekoo
上传日期:2020-07-18
资源大小:21543k
文件大小:1653k
- COLORREF clrForceTabBorderRB, // = COLORREF(-1L)
- COLORREF clrForceTabSeparator, // = COLORREF(-1L)
- bool bDwmMode // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CExtCmdIcon * pIconTabItemCloseButton = NULL;
- CExtCmdIcon::e_paint_type_t ePaintStateITICB =
- (CExtCmdIcon::e_paint_type_t) CExtCmdIcon::__PAINT_INVISIBLE;
- CRect rcTabItemCloseButton( 0, 0, 0, 0 );
- CExtBarButton * pTBB = NULL;
- CExtTabWnd * pTabs = NULL;
- CExtTabWnd::TAB_ITEM_INFO * pTII = NULL;
- bool bNoPrefix = false;
- if( pHelperSrc != NULL )
- {
- pTabs = DYNAMIC_DOWNCAST( CExtTabWnd, pHelperSrc );
- if( pTabs != NULL )
- {
- ASSERT_VALID( pTabs );
- pTII = pTabs->ItemGet( LONG( lParam ) );
- ASSERT( pTII != NULL );
- ASSERT_VALID( pTII );
- pIconTabItemCloseButton =
- pTabs->OnTabWndQueryItemCloseButtonShape( pTII );
- if( pIconTabItemCloseButton != NULL )
- {
- rcTabItemCloseButton = pTII->CloseButtonRectGet();
- ePaintStateITICB = (CExtCmdIcon::e_paint_type_t)
- pTabs->OnTabWndQueryItemCloseButtonPaintState( pTII );
- } // if( pIconTabItemCloseButton != NULL )
- bNoPrefix = ( ( pTabs->GetTabWndStyleEx() & __ETWS_EX_NO_PREFIX ) != 0 ) ? true : false;
- } // if( pTabs != NULL )
- else
- {
- pTBB = DYNAMIC_DOWNCAST( CExtBarButton, pHelperSrc );
- #ifdef _DEBUG
- if( pTBB != NULL )
- {
- ASSERT_VALID( pTBB );
- } // if( pTBB != NULL )
- #endif // _DEBUG
- } // else from if( pTabs != NULL )
- } // if( pHelperSrc != NULL )
- bool bEnabled = true;
- if( pTII != NULL )
- bEnabled = pTII->EnabledGet();
- else if( pTBB != NULL )
- bEnabled = pTBB->IsEnabled();
- #if (!defined __EXT_MFC_NO_DYNAMIC_BAR_SITE)
- if( pTII != NULL )
- {
- CObject * pObject = pTII->EventProviderGet();
- if( pObject != NULL )
- {
- CExtDynamicControlBar * pBar = DYNAMIC_DOWNCAST( CExtDynamicControlBar, pObject );
- if( pBar != NULL )
- {
- bool bFlashCaptionHighlightedState = false;
- if( pBar->FlashCaptionIsInProgress( &bFlashCaptionHighlightedState ) )
- {
- if( bFlashCaptionHighlightedState )
- {
- clrForceText = pBar->m_clrFlashCaptionText;
- clrForceTabBk = pBar->m_clrFlashCaptionBackground;
- bSelected = true;
- }
- }
- }
- }
- }
- #endif// (!defined __EXT_MFC_NO_DYNAMIC_BAR_SITE)
- COLORREF clrText = clrForceText;
- if( clrText == COLORREF(-1L) )
- {
- if( bEnabled )
- {
- clrText =
- GetColor(
- (bSelected && !bGroupedMode)
- ? COLOR_BTNTEXT
- : ( bGroupedMode
- ? COLOR_BTNTEXT
- : COLOR_3DHILIGHT
- )
- ,
- pHelperSrc,
- lParam
- );
- }
- else
- {
- clrText =
- GetColor(
- (bSelected && !bGroupedMode)
- ? CLR_TEXT_DISABLED
- : ( bGroupedMode ? CLR_TEXT_DISABLED : COLOR_3DFACE )
- ,
- pHelperSrc,
- lParam
- );
- }
- }
- COLORREF clrTabBk = clrForceTabBk;
- if( clrTabBk == COLORREF(-1L) )
- clrTabBk =
- GetColor(
- COLOR_BTNFACE,
- pHelperSrc,
- lParam
- );
- COLORREF clrTabBorderLT = clrForceTabBorderLT;
- if( clrTabBorderLT == COLORREF(-1L) )
- clrTabBorderLT =
- GetColor(
- bGroupedMode
- ? COLOR_3DSHADOW
- : COLOR_3DHILIGHT
- ,
- pHelperSrc,
- lParam
- );
- COLORREF clrTabBorderRB = clrForceTabBorderRB;
- if( clrTabBorderRB == COLORREF(-1L) )
- clrTabBorderRB =
- GetColor(
- bGroupedMode
- ? COLOR_3DSHADOW
- : COLOR_3DDKSHADOW
- ,
- pHelperSrc,
- lParam
- );
- COLORREF clrTabSeparator = clrForceTabSeparator;
- if( clrTabSeparator == COLORREF(-1L) )
- clrTabSeparator =
- GetColor(
- bGroupedMode
- ? COLOR_3DSHADOW
- : COLOR_3DLIGHT
- ,
- pHelperSrc,
- lParam
- );
- bool bDrawIcon = (
- pIcon != NULL
- && (!pIcon->IsEmpty())
- && ( pTabs == NULL || (pTabs->GetTabWndStyle()&__ETWS_HIDE_ICONS) == 0 )
- );
- CExtPaintManager::stat_PaintTabItemImpl(
- dc,
- rcTabItemsArea,
- bTopLeft,
- bHorz,
- bSelected,
- bEnabled,
- bCenteredText,
- bGroupedMode,
- bInGroupActive,
- bInvertedVerticalMode,
- bDrawIcon,
- rcEntireItem,
- sizeTextMeasured,
- pFont,
- sText,
- bNoPrefix,
- pIcon,
- pIconTabItemCloseButton,
- INT(ePaintStateITICB),
- rcTabItemCloseButton,
- clrText,
- clrTabBk,
- clrTabBorderLT,
- clrTabBorderRB,
- clrTabSeparator,
- ( pTBB != NULL ) ? false : true,
- pHelperSrc,
- bDwmMode
- );
- }
- void CExtPaintManagerXP::PaintTabItem(
- CDC & dc,
- CRect & rcTabItemsArea,
- bool bTopLeft,
- bool bHorz,
- bool bSelected,
- bool bCenteredText,
- bool bGroupedMode,
- bool bInGroupActive,
- bool bInvertedVerticalMode,
- const CRect & rcEntireItem,
- CSize sizeTextMeasured,
- CFont * pFont,
- __EXT_MFC_SAFE_LPCTSTR sText,
- CExtCmdIcon * pIcon,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- COLORREF clrForceText, // = COLORREF(-1L)
- COLORREF clrForceTabBk, // = COLORREF(-1L)
- COLORREF clrForceTabBorderLT, // = COLORREF(-1L)
- COLORREF clrForceTabBorderRB, // = COLORREF(-1L)
- COLORREF clrForceTabSeparator, // = COLORREF(-1L)
- bool bDwmMode // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CExtCmdIcon * pIconTabItemCloseButton = NULL;
- CExtCmdIcon::e_paint_type_t ePaintStateITICB =
- (CExtCmdIcon::e_paint_type_t) CExtCmdIcon::__PAINT_INVISIBLE;
- CRect rcTabItemCloseButton( 0, 0, 0, 0 );
- CExtBarButton * pTBB = NULL;
- CExtTabWnd * pTabs = NULL;
- CExtTabWnd::TAB_ITEM_INFO * pTII = NULL;
- bool bNoPrefix = false;
- if( pHelperSrc != NULL )
- {
- pTabs = DYNAMIC_DOWNCAST( CExtTabWnd, pHelperSrc );
- if( pTabs != NULL )
- {
- ASSERT_VALID( pTabs );
- pTII = pTabs->ItemGet( LONG( lParam ) );
- ASSERT( pTII != NULL );
- ASSERT_VALID( pTII );
- pIconTabItemCloseButton =
- pTabs->OnTabWndQueryItemCloseButtonShape( pTII );
- if( pIconTabItemCloseButton != NULL )
- {
- rcTabItemCloseButton = pTII->CloseButtonRectGet();
- ePaintStateITICB = (CExtCmdIcon::e_paint_type_t)
- pTabs->OnTabWndQueryItemCloseButtonPaintState( pTII );
- } // if( pIconTabItemCloseButton != NULL )
- bNoPrefix = ( ( pTabs->GetTabWndStyleEx() & __ETWS_EX_NO_PREFIX ) != 0 ) ? true : false;
- } // if( pTabs != NULL )
- else
- {
- pTBB = DYNAMIC_DOWNCAST( CExtBarButton, pHelperSrc );
- #ifdef _DEBUG
- if( pTBB != NULL )
- {
- ASSERT_VALID( pTBB );
- } // if( pTBB != NULL )
- #endif // _DEBUG
- } // else from if( pTabs != NULL )
- } // if( pHelperSrc != NULL )
- bool bEnabled = true;
- if( pTII != NULL )
- bEnabled = pTII->EnabledGet();
- else if( pTBB != NULL )
- bEnabled = pTBB->IsEnabled();
- #if (!defined __EXT_MFC_NO_DYNAMIC_BAR_SITE)
- if( pTII != NULL )
- {
- CObject * pObject = pTII->EventProviderGet();
- if( pObject != NULL )
- {
- CExtDynamicControlBar * pBar = DYNAMIC_DOWNCAST( CExtDynamicControlBar, pObject );
- if( pBar != NULL )
- {
- bool bFlashCaptionHighlightedState = false;
- if( pBar->FlashCaptionIsInProgress( &bFlashCaptionHighlightedState ) )
- {
- if( bFlashCaptionHighlightedState )
- {
- clrForceText = pBar->m_clrFlashCaptionText;
- clrForceTabBk = pBar->m_clrFlashCaptionBackground;
- bSelected = true;
- }
- }
- }
- }
- }
- #endif// (!defined __EXT_MFC_NO_DYNAMIC_BAR_SITE)
- COLORREF clrText = clrForceText;
- if( clrText == COLORREF(-1L) )
- {
- if( bEnabled )
- clrText = GetColor( ( bSelected || bGroupedMode ) ? COLOR_BTNTEXT : COLOR_3DSHADOW, pHelperSrc, lParam );
- else
- clrText = GetColor( CLR_TEXT_DISABLED, pHelperSrc, lParam );
- }
- COLORREF clrTabBk = clrForceTabBk;
- if( clrTabBk == COLORREF(-1L) )
- clrTabBk = GetColor( bGroupedMode ? COLOR_3DFACE : XPCLR_3DFACE_DARK , pHelperSrc, lParam );
- COLORREF clrTabBorderLT = clrForceTabBorderLT;
- if( clrTabBorderLT == COLORREF(-1L) )
- clrTabBorderLT = GetColor( bGroupedMode ? COLOR_3DSHADOW : COLOR_3DHILIGHT, pHelperSrc, lParam );
- COLORREF clrTabBorderRB = clrForceTabBorderRB;
- if( clrTabBorderRB == COLORREF(-1L) )
- clrTabBorderRB = GetColor( bGroupedMode ? COLOR_3DSHADOW : COLOR_3DDKSHADOW, pHelperSrc, lParam );
- COLORREF clrTabSeparator = clrForceTabSeparator;
- if( clrTabSeparator == COLORREF(-1L) )
- clrTabSeparator = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- bool bDrawIcon = (
- pIcon != NULL
- && (!pIcon->IsEmpty())
- && ( pTabs == NULL || (pTabs->GetTabWndStyle()&__ETWS_HIDE_ICONS) == 0 )
- );
- CExtPaintManager::stat_PaintTabItemImpl(
- dc,
- rcTabItemsArea,
- bTopLeft,
- bHorz,
- bSelected,
- bEnabled,
- bCenteredText,
- bGroupedMode,
- bInGroupActive,
- bInvertedVerticalMode,
- bDrawIcon,
- rcEntireItem,
- sizeTextMeasured,
- pFont,
- sText,
- bNoPrefix,
- pIcon,
- pIconTabItemCloseButton,
- INT(ePaintStateITICB),
- rcTabItemCloseButton,
- clrText,
- clrTabBk,
- clrTabBorderLT,
- clrTabBorderRB,
- clrTabSeparator,
- ( pTBB != NULL ) ? false : true,
- pHelperSrc,
- bDwmMode
- );
- }
- void CExtPaintManager::PaintTabClientArea(
- CDC & dc,
- CRect & rcClient,
- CRect & rcTabItemsArea,
- CRect & rcTabNearBorderArea,
- DWORD dwOrientation,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- int idxClrTabNearMargin = COLOR_3DDKSHADOW;
- switch( dwOrientation )
- {
- case __ETWS_ORIENT_TOP:
- idxClrTabNearMargin = COLOR_3DHILIGHT;
- break;
- case __ETWS_ORIENT_BOTTOM:
- break;
- case __ETWS_ORIENT_LEFT:
- idxClrTabNearMargin = COLOR_3DHILIGHT;
- break;
- case __ETWS_ORIENT_RIGHT:
- break;
- #ifdef _DEBUG
- default:
- ASSERT( FALSE );
- break;
- #endif // _DEBUG
- } // switch( dwOrientation )
- COLORREF clrTabItemsAreaBk =
- GetColor(
- ( bGroupedMode || IsHighContrast() )
- ? COLOR_3DFACE
- : COLOR_3DSHADOW,
- pHelperSrc,
- lParam
- );
- COLORREF clrTabNearBorderAreaBk =
- GetColor( COLOR_3DFACE, pHelperSrc, lParam );
- COLORREF clrTabNearMargin =
- GetColor( idxClrTabNearMargin, pHelperSrc, lParam );
- CExtPaintManager::stat_PaintTabClientAreaImpl(
- dc,
- rcClient,
- rcTabItemsArea,
- rcTabNearBorderArea,
- dwOrientation,
- bGroupedMode,
- clrTabItemsAreaBk,
- clrTabNearBorderAreaBk,
- clrTabNearMargin
- );
- }
- bool CExtPaintManager::QueryTabWndHoverChangingRedraw(
- const CExtTabWnd * pWndTab,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pWndTab );
- pWndTab;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::QueryTabWndHoverChangingRedraw(
- const CExtTabWnd * pWndTab,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pWndTab );
- bool bGroupedMode =
- (pWndTab->GetTabWndStyle() & __ETWS_GROUPED) ? true : false;
- if( bGroupedMode
- || (! g_PaintManager.m_UxTheme.IsControlsThemed() )
- )
- {
- return
- CExtPaintManager::QueryTabWndHoverChangingRedraw(
- pWndTab,
- lParam
- );
- }
- return true;
- }
- void CExtPaintManagerXP::PaintTabClientArea(
- CDC & dc,
- CRect & rcClient,
- CRect & rcTabItemsArea,
- CRect & rcTabNearBorderArea,
- DWORD dwOrientation,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- int idxClrTabNearMargin = COLOR_3DSHADOW;
- switch( dwOrientation )
- {
- case __ETWS_ORIENT_TOP:
- idxClrTabNearMargin = COLOR_3DHILIGHT;
- break;
- case __ETWS_ORIENT_BOTTOM:
- break;
- case __ETWS_ORIENT_LEFT:
- idxClrTabNearMargin = COLOR_3DHILIGHT;
- break;
- case __ETWS_ORIENT_RIGHT:
- break;
- #ifdef _DEBUG
- default:
- ASSERT( FALSE );
- break;
- #endif // _DEBUG
- } // switch( dwOrientation )
- COLORREF clrTabItemsAreaBk =
- ( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
- ? GetColor( XPCLR_3DFACE_NORMAL, pHelperSrc, lParam )
- : GetColor( XPCLR_3DFACE_DARK, pHelperSrc, lParam )
- ;
- COLORREF clrTabNearBorderAreaBk =
- GetColor( XPCLR_3DFACE_DARK, pHelperSrc, lParam );
- COLORREF clrTabNearMargin =
- GetColor( idxClrTabNearMargin, pHelperSrc, lParam );
- CExtPaintManager::stat_PaintTabClientAreaImpl(
- dc,
- rcClient,
- rcTabItemsArea,
- rcTabNearBorderArea,
- dwOrientation,
- bGroupedMode,
- clrTabItemsAreaBk,
- clrTabNearBorderAreaBk,
- clrTabNearMargin
- );
- }
- void CExtPaintManagerOffice2003::PaintTabClientArea(
- CDC & dc,
- CRect & rcClient,
- CRect & rcTabItemsArea,
- CRect & rcTabNearBorderArea,
- DWORD dwOrientation,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintTabClientArea(
- dc,
- rcClient,
- rcTabItemsArea,
- rcTabNearBorderArea,
- dwOrientation,
- bGroupedMode,
- pHelperSrc,
- lParam
- );
- return;
- }
- bool bFrameBackground = false;
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtTabWnd))
- && ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8
- )
- {
- CExtTabWnd * pExtTabWnd = DYNAMIC_DOWNCAST( CExtTabWnd, pHelperSrc );
- if( pExtTabWnd != NULL
- && ( pExtTabWnd->m_bReflectParentSizing
- #if (!defined __EXT_MFC_NO_TABMDI_CTRL)
- || pExtTabWnd->_IsMdiTabCtrl()
- #endif // (!defined __EXT_MFC_NO_TABMDI_CTRL)
- )
- )
- bFrameBackground = true;
- #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
- else if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtDynTabWnd))
- || pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtDynAutoHideArea))
- )
- bFrameBackground = true;
- #endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
- }
- if( bFrameBackground )
- {
- CRect rcTabNearMargin( rcTabNearBorderArea ); // prepare tab border margin rect
- switch( dwOrientation )
- {
- case __ETWS_ORIENT_TOP:
- rcTabNearMargin.bottom = rcTabNearMargin.top + 1;
- break;
- case __ETWS_ORIENT_BOTTOM:
- rcTabNearMargin.top = rcTabNearMargin.bottom - 1;
- break;
- case __ETWS_ORIENT_LEFT:
- rcTabNearMargin.right = rcTabNearMargin.left + 1;
- break;
- case __ETWS_ORIENT_RIGHT:
- rcTabNearMargin.left = rcTabNearMargin.right - 1;
- break;
- #ifdef _DEBUG
- default:
- ASSERT( FALSE );
- break;
- #endif // _DEBUG
- } // switch( dwOrientation )
- CWnd * pWnd = STATIC_DOWNCAST( CExtTabWnd, pHelperSrc );
- if( ! PaintDockerBkgnd(
- true,
- dc,
- pWnd
- )
- )
- {
- CWnd * pFrame = pWnd->GetParentFrame();
- if( pFrame == NULL )
- pFrame = pWnd->GetParent();
- ASSERT_VALID( pFrame );
- CRect rcPaintGradient;
- pFrame->GetClientRect( &rcPaintGradient );
- pFrame->ClientToScreen( &rcPaintGradient );
- ((CExtTabWnd*)pHelperSrc)->ScreenToClient( &rcPaintGradient );
- PaintDockerBkgnd(
- true,
- dc,
- rcPaintGradient,
- rcClient
- );
- }
-
- if( ! bGroupedMode )
- {
- COLORREF clrTabNearMargin = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- COLORREF clrTabNearBorderAreaBk = GetColor( CLR_3DFACE_OUT, pHelperSrc, lParam );
- // fill tab border area
- dc.FillSolidRect(
- &rcTabNearBorderArea,
- clrTabNearBorderAreaBk
- );
- // paint tab border margin
- dc.FillSolidRect(
- &rcTabNearMargin,
- clrTabNearMargin
- );
- } // if( !bGroupedMode )
- return;
- } // if( bFrameBackground )
- CExtPaintManagerXP::PaintTabClientArea(
- dc,
- rcClient,
- rcTabItemsArea,
- rcTabNearBorderArea,
- dwOrientation,
- bGroupedMode,
- pHelperSrc,
- lParam
- );
- }
- void CExtPaintManager::PaintTabbedTabClientArea(
- CDC & dc,
- CRect & rcClient,
- CRect & rcTabItemsArea,
- CRect & rcTabNearBorderArea,
- DWORD dwOrientation,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- rcTabNearBorderArea;
- bGroupedMode;
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtTabWnd))
- )
- {
- CWnd * pWnd = STATIC_DOWNCAST( CExtTabWnd, pHelperSrc );
- if( ! PaintDockerBkgnd(
- true,
- dc,
- pWnd,
- lParam
- )
- )
- dc.FillSolidRect(
- &rcClient,
- GetColor(
- CExtPaintManager::CLR_3DFACE_OUT
- )
- );
- COLORREF clr = 0;
- CRect rcTabNearMargin( rcTabItemsArea );
- switch( dwOrientation )
- {
- case __ETWS_ORIENT_TOP:
- rcTabNearMargin.top = rcTabNearMargin.bottom - 1;
- rcTabNearMargin.left = rcClient.left;
- rcTabNearMargin.right = rcClient.right;
- rcTabNearMargin.OffsetRect( 0, 1 );
- clr = GetColor( COLOR_3DHIGHLIGHT );
- break;
- case __ETWS_ORIENT_BOTTOM:
- rcTabNearMargin.bottom = rcTabNearMargin.top + 1;
- rcTabNearMargin.left = rcClient.left;
- rcTabNearMargin.right = rcClient.right;
- rcTabNearMargin.OffsetRect( 0, -1 );
- clr = GetColor( COLOR_3DSHADOW );
- break;
- case __ETWS_ORIENT_LEFT:
- rcTabNearMargin.left = rcTabNearMargin.right - 1;
- rcTabNearMargin.top = rcClient.top;
- rcTabNearMargin.bottom = rcClient.bottom;
- rcTabNearMargin.OffsetRect( 1, 0 );
- clr = GetColor( COLOR_3DHIGHLIGHT );
- break;
- case __ETWS_ORIENT_RIGHT:
- rcTabNearMargin.right = rcTabNearMargin.left + 1;
- rcTabNearMargin.top = rcClient.top;
- rcTabNearMargin.bottom = rcClient.bottom;
- rcTabNearMargin.OffsetRect( -1, 0 );
- clr = GetColor( COLOR_3DSHADOW );
- break;
- default:
- ASSERT( FALSE );
- return;
- } // switch( dwOrientation )
- // paint tab border margin
- dc.FillSolidRect(
- &rcTabNearMargin,
- clr
- );
- }
- }
- void CExtPaintManagerStudio2005::PaintTabbedTabClientArea(
- CDC & dc,
- CRect & rcClient,
- CRect & rcTabItemsArea,
- CRect & rcTabNearBorderArea,
- DWORD dwOrientation,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
-
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintTabbedTabClientArea(
- dc,
- rcClient,
- rcTabItemsArea,
- rcTabNearBorderArea,
- dwOrientation,
- bGroupedMode,
- pHelperSrc,
- lParam
- );
- return;
- }
-
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtTabWnd))
- )
- {
- CWnd * pWnd = STATIC_DOWNCAST( CExtTabWnd, pHelperSrc );
- if( ! PaintDockerBkgnd(
- true,
- dc,
- pWnd,
- lParam
- )
- )
- dc.FillSolidRect(
- &rcClient,
- GetColor(
- CExtPaintManager::CLR_3DFACE_OUT
- )
- );
- CRect rcTabNearMargin( rcTabItemsArea );
- switch( dwOrientation )
- {
- case __ETWS_ORIENT_TOP:
- rcTabNearMargin.top = rcTabNearMargin.bottom - 1;
- rcTabNearMargin.left = rcClient.left;
- rcTabNearMargin.right = rcClient.right;
- rcTabNearMargin.OffsetRect( 0, 1 );
- break;
- case __ETWS_ORIENT_BOTTOM:
- rcTabNearMargin.bottom = rcTabNearMargin.top + 1;
- rcTabNearMargin.left = rcClient.left;
- rcTabNearMargin.right = rcClient.right;
- rcTabNearMargin.OffsetRect( 0, -1 );
- break;
- case __ETWS_ORIENT_LEFT:
- rcTabNearMargin.left = rcTabNearMargin.right - 1;
- rcTabNearMargin.top = rcClient.top;
- rcTabNearMargin.bottom = rcClient.bottom;
- rcTabNearMargin.OffsetRect( 1, 0 );
- break;
- case __ETWS_ORIENT_RIGHT:
- rcTabNearMargin.right = rcTabNearMargin.left + 1;
- rcTabNearMargin.top = rcClient.top;
- rcTabNearMargin.bottom = rcClient.bottom;
- rcTabNearMargin.OffsetRect( -1, 0 );
- break;
- default:
- ASSERT( FALSE );
- return;
- } // switch( dwOrientation )
- // paint tab border margin
- dc.FillSolidRect(
- &rcTabNearMargin,
- GetColor( COLOR_3DSHADOW )
- );
- }
- }
- void CExtPaintManager::PaintTabButton(
- CDC & dc,
- CRect & rcButton,
- LONG nHitTest,
- bool bTopLeft,
- bool bHorz,
- bool bEnabled,
- bool bHover,
- bool bPushed,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bFlat // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- COLORREF clrGlyph = GetColor( bEnabled ? COLOR_BTNTEXT : CLR_TEXT_DISABLED, pHelperSrc, lParam );
- COLORREF clrTL = GetColor( bPushed ? COLOR_3DDKSHADOW : COLOR_3DHILIGHT, pHelperSrc, lParam );
- COLORREF clrBR = GetColor( bPushed ? COLOR_3DHILIGHT : COLOR_3DDKSHADOW, pHelperSrc, lParam );
- CExtPaintManager::stat_PaintTabButtonImpl(
- dc,
- rcButton,
- nHitTest,
- bTopLeft,
- bHorz,
- bEnabled,
- bHover,
- bPushed,
- bGroupedMode,
- clrGlyph,
- clrTL,
- clrBR,
- bFlat
- );
- }
- void CExtPaintManagerXP::PaintTabButton(
- CDC & dc,
- CRect & rcButton,
- LONG nHitTest,
- bool bTopLeft,
- bool bHorz,
- bool bEnabled,
- bool bHover,
- bool bPushed,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bFlat // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- COLORREF clrGlyph = GetColor( bEnabled ? COLOR_BTNTEXT : CLR_TEXT_DISABLED, pHelperSrc, lParam );
- COLORREF clrTL = GetColor( bPushed ? COLOR_3DDKSHADOW : COLOR_3DHILIGHT, pHelperSrc, lParam );
- COLORREF clrBR = GetColor( bPushed ? COLOR_3DHILIGHT : COLOR_3DDKSHADOW, pHelperSrc, lParam );
- CExtPaintManager::stat_PaintTabButtonImpl(
- dc,
- rcButton,
- nHitTest,
- bTopLeft,
- bHorz,
- bEnabled,
- bHover,
- bPushed,
- bGroupedMode,
- clrGlyph,
- clrTL,
- clrBR,
- bFlat
- );
- }
- void CExtPaintManagerStudio2005::PaintTabButton(
- CDC & dc,
- CRect & rcButton,
- LONG nHitTest,
- bool bTopLeft,
- bool bHorz,
- bool bEnabled,
- bool bHover,
- bool bPushed,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bFlat // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintTabButton(
- dc,
- rcButton,
- nHitTest,
- bTopLeft,
- bHorz,
- bEnabled,
- bHover,
- bPushed,
- bGroupedMode,
- pHelperSrc,
- lParam,
- bFlat
- );
- return;
- }
- if( bEnabled && ( bHover || bPushed ) )
- {
- PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- bHorz,
- rcButton,
- _T(""),
- NULL, // pIcon
- false, // bFlat
- bHover,
- bPushed,
- false, // bIndeterminate
- bEnabled,
- false, // bDrawBorder
- false, // bDrawFocusRect
- false, // bDefaultPushButton
- 0,
- NULL, // hFont
- false, // bDropDown
- 0,
- false // bTransparentBackground
- );
- PaintPushButton( dc, _ppbd );
- }
- CExtPaintManagerOffice2003::PaintTabButton(
- dc,
- rcButton,
- nHitTest,
- bTopLeft,
- bHorz,
- bEnabled,
- bHover,
- bPushed,
- bGroupedMode,
- pHelperSrc,
- lParam,
- true
- );
- }
- void CExtPaintManagerOffice2007_R2_Obsidian::PaintTabButton(
- CDC & dc,
- CRect & rcButton,
- LONG nHitTest,
- bool bTopLeft,
- bool bHorz,
- bool bEnabled,
- bool bHover,
- bool bPushed,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bFlat // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintTabButton( dc, rcButton, nHitTest, bTopLeft, bHorz, bEnabled, bHover, bPushed, bGroupedMode, pHelperSrc, lParam, bFlat );
- return;
- }
- COLORREF clrGlyph = RGB(141,141,141);
- if( bEnabled )
- {
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPopupMenuWnd) )
- )
- clrGlyph = RGB(0,0,0);
- else
- clrGlyph = RGB(255,255,255);
- }
- COLORREF clrTL = GetColor( bPushed ? COLOR_3DDKSHADOW : COLOR_3DHILIGHT, pHelperSrc, lParam );
- COLORREF clrBR = GetColor( bPushed ? COLOR_3DHILIGHT : COLOR_3DDKSHADOW, pHelperSrc, lParam );
- CExtPaintManager::stat_PaintTabButtonImpl( dc, rcButton, nHitTest, bTopLeft, bHorz, bEnabled, bHover, bPushed, bGroupedMode, clrGlyph, clrTL, clrBR, bFlat );
- }
- void CExtPaintManagerOffice2010_R2_Black::PaintTabButton(
- CDC & dc,
- CRect & rcButton,
- LONG nHitTest,
- bool bTopLeft,
- bool bHorz,
- bool bEnabled,
- bool bHover,
- bool bPushed,
- bool bGroupedMode,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bFlat // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintTabButton( dc, rcButton, nHitTest, bTopLeft, bHorz, bEnabled, bHover, bPushed, bGroupedMode, pHelperSrc, lParam, bFlat );
- return;
- }
- COLORREF clrGlyph = RGB(141,141,141);
- if( bEnabled )
- {
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPopupMenuWnd) )
- )
- clrGlyph = RGB(0,0,0);
- else
- clrGlyph = RGB(220,220,220);
- }
- COLORREF clrTL = GetColor( bPushed ? COLOR_3DDKSHADOW : COLOR_3DHILIGHT, pHelperSrc, lParam );
- COLORREF clrBR = GetColor( bPushed ? COLOR_3DHILIGHT : COLOR_3DDKSHADOW, pHelperSrc, lParam );
- CExtPaintManager::stat_PaintTabButtonImpl( dc, rcButton, nHitTest, bTopLeft, bHorz, bEnabled, bHover, bPushed, bGroupedMode, clrGlyph, clrTL, clrBR, bFlat );
- }
- void CExtPaintManager::TabWnd_MeasureItemAreaMargins(
- CExtTabWnd * pTabWnd,
- LONG & nSpaceBefore,
- LONG & nSpaceAfter,
- LONG & nSpaceOver
- )
- {
- ASSERT_VALID( this );
- ASSERT( pTabWnd != NULL && ::IsWindow(pTabWnd->m_hWnd) );
- ASSERT_VALID( pTabWnd );
- pTabWnd;
- nSpaceBefore = 4;
- nSpaceAfter = 2;
- if( (pTabWnd->GetTabWndStyle() & __ETWS_GROUPED) == 0 )
- nSpaceOver = 2;
- }
- void CExtPaintManagerNativeXP::TabWnd_MeasureItemAreaMargins(
- CExtTabWnd * pTabWnd,
- LONG & nSpaceBefore,
- LONG & nSpaceAfter,
- LONG & nSpaceOver
- )
- {
- ASSERT_VALID( this );
- ASSERT( pTabWnd != NULL && ::IsWindow(pTabWnd->m_hWnd) );
- ASSERT_VALID( pTabWnd );
- bool bGroupedMode =
- (pTabWnd->GetTabWndStyle() & __ETWS_GROUPED) ? true : false;
- if( bGroupedMode
- || (! g_PaintManager.m_UxTheme.IsControlsThemed() )
- )
- {
- CExtPaintManager::TabWnd_MeasureItemAreaMargins(
- pTabWnd,
- nSpaceBefore,
- nSpaceAfter,
- nSpaceOver
- );
- return;
- }
- nSpaceBefore = 0;
- nSpaceAfter = 0;
- nSpaceOver = 0;
- }
- void CExtPaintManager::TabWnd_UpdateItemMeasure(
- CExtTabWnd * pTabWnd,
- CExtTabWnd::TAB_ITEM_INFO * pTii,
- CDC & dcMeasure,
- CSize & sizePreCalc
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pTii );
- ASSERT( dcMeasure.GetSafeHdc() != NULL );
- ASSERT( pTii->GetTabWnd() == pTabWnd );
- pTabWnd;
- pTii;
- dcMeasure;
- sizePreCalc;
- }
- void CExtPaintManager::TabWnd_AdjustItemCloseButtonRect(
- CRect & rcCloseButton,
- CExtTabWnd * pTabWnd
- )
- {
- ASSERT_VALID( this );
- pTabWnd;
- rcCloseButton;
- }
- bool CExtPaintManager::TabWnd_GetParentSizingMargin(
- INT & nMargin,
- DWORD dwOrientation,
- CExtTabWnd * pTabWnd
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pTabWnd );
- nMargin;
- dwOrientation;
- pTabWnd;
- return false;
- }
- bool CExtPaintManagerNativeXP::TabWnd_GetParentSizingMargin(
- INT & nMargin,
- DWORD dwOrientation,
- CExtTabWnd * pTabWnd
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pTabWnd );
- if( (! g_PaintManager.m_UxTheme.IsControlsThemed() )
- || pTabWnd->_IsCustomLayoutTabWnd()
- )
- return
- CExtPaintManager::TabWnd_GetParentSizingMargin(
- nMargin,
- dwOrientation,
- pTabWnd
- );
- nMargin = 1;
- return true;
- }
- void CExtPaintManager::PaintTabNcAreaRect(
- CDC & dc,
- const RECT & rc,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- COLORREF clrTL = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- COLORREF clrBR = GetColor( COLOR_3DHILIGHT, pHelperSrc, lParam );
- dc.Draw3dRect(
- &rc,
- clrTL,
- clrBR
- );
- }
- void CExtPaintManagerXP::PaintTabNcAreaRect(
- CDC & dc,
- const RECT & rc,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- COLORREF clrTL = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- COLORREF clrBR = clrTL;
- dc.Draw3dRect(
- &rc,
- clrTL,
- clrBR
- );
- }
- void CExtPaintManagerNativeXP::PaintTabNcAreaRect(
- CDC & dc,
- const RECT & rc,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( (! g_PaintManager.m_UxTheme.IsControlsThemed() )
- || pHelperSrc == NULL
- || (! pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtTabWnd ) ) )
- || ((CExtTabWnd*)pHelperSrc)->_IsCustomLayoutTabWnd()
- )
- CExtPaintManager::PaintTabNcAreaRect( dc, rc, pHelperSrc, lParam );
- PaintDockerBkgnd( false, dc, (CWnd*)pHelperSrc, lParam );
- }
- #endif // #if (!defined __EXT_MFC_NO_TAB_CTRL)
- void CExtPaintManager::PaintDockBarClientArea(
- CDC & dc,
- const RECT & rcClient,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ::IsRectEmpty( &rcClient ) || ( ! dc.RectVisible( &rcClient ) ) )
- return;
- if( RenderCustomBackground( true, dc, pHelperSrc, lParam ) )
- return;
- dc.FillSolidRect( &rcClient, GetColor( CLR_3DFACE_OUT, pHelperSrc, lParam ) );
- }
- CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA::PAINTINHERITEDBACKGROUNDDATA(
- bool bClientMapping,
- CDC & dc,
- CWnd * pWnd,
- CObject * pObjHelperSrc, // = NULL
- LPARAM lParam // = 0L
- )
- : m_bClientMapping( bClientMapping )
- , m_bBackgroundDrawn( false )
- , m_bSequenceCanceled( false )
- , m_hWndBackgroundRequestPainter( NULL )
- , m_dc( dc )
- , m_pWnd( pWnd )
- , m_pObjHelperSrc( pObjHelperSrc )
- , m_lParam( lParam )
- {
- ASSERT_VALID( (&m_dc) );
- ASSERT( m_dc.GetSafeHdc() != NULL );
- ASSERT_VALID( m_pWnd );
- ASSERT( m_pWnd->GetSafeHwnd() != NULL );
- }
- CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA::PAINTINHERITEDBACKGROUNDDATA(
- bool bClientMapping,
- CDC & dc,
- CObject * pObjHelperSrc,
- LPARAM lParam // = 0L
- )
- : m_bClientMapping( bClientMapping )
- , m_bBackgroundDrawn( false )
- , m_bSequenceCanceled( false )
- , m_hWndBackgroundRequestPainter( NULL )
- , m_dc( dc )
- , m_pWnd( NULL )
- , m_pObjHelperSrc( pObjHelperSrc )
- , m_lParam( lParam )
- {
- ASSERT_VALID( (&m_dc) );
- ASSERT( m_dc.GetSafeHdc() != NULL );
- ASSERT_VALID( m_pObjHelperSrc );
- m_pWnd = STATIC_DOWNCAST( CWnd, m_pObjHelperSrc );
- ASSERT_VALID( m_pWnd );
- ASSERT( m_pWnd->GetSafeHwnd() != NULL );
- }
- bool CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA::Notify()
- {
- ASSERT_VALID( (&m_dc) );
- ASSERT( m_dc.GetSafeHdc() != NULL );
- ASSERT_VALID( m_pWnd );
- ASSERT( m_pWnd->GetSafeHwnd() != NULL );
- HWND hWnd = m_pWnd->GetSafeHwnd();
- for( ; hWnd != NULL; hWnd = ::GetParent(hWnd) )
- {
- ::SendMessage(
- hWnd,
- CExtPaintManager::g_nMsgPaintInheritedBackground,
- *this,
- 0
- );
- if( m_bSequenceCanceled )
- {
- m_bBackgroundDrawn = false;
- m_hWndBackgroundRequestPainter = NULL;
- break;
- } // if( m_bSequenceCanceled )
- if( m_bBackgroundDrawn )
- {
- if( m_hWndBackgroundRequestPainter == NULL )
- m_hWndBackgroundRequestPainter = hWnd;
- return true;
- } // if( m_bBackgroundDrawn )
- __EXT_MFC_LONG_PTR dwStyle = ::__EXT_MFC_GetWindowLong( hWnd, GWL_STYLE );
- if( (dwStyle&WS_CHILD) == 0 )
- break;
- } // for( ; hWnd != NULL; hWnd = ::GetParent(hWnd) )
- return false;
- }
- CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA::operator WPARAM() const
- {
- return WPARAM( this );
- }
- CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA *
- CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA::FromWPARAM( WPARAM wParam )
- {
- PAINTINHERITEDBACKGROUNDDATA * pPIBD =
- reinterpret_cast < PAINTINHERITEDBACKGROUNDDATA * > ( wParam );
- ASSERT( pPIBD != NULL );
- return pPIBD;
- }
- CRect CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA::GetRenderingRect() const
- {
- CRect rc;
- if( m_bClientMapping )
- m_pWnd->GetClientRect( &rc );
- else
- {
- m_pWnd->GetWindowRect( &rc );
- rc.OffsetRect( -rc.left, -rc.top );
- }
- return rc;
- }
- bool CExtPaintManager::RenderCustomBackground(
- bool bClientMapping,
- CDC & dc,
- CObject * pObjHelperSrc,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- if( pObjHelperSrc == NULL
- || (! GetCustomBackgroundInheritanceMode(
- pObjHelperSrc,
- lParam
- ) )
- || dc.GetSafeHdc() == NULL
- )
- return false;
- CWnd * pWnd = DYNAMIC_DOWNCAST( CWnd, pObjHelperSrc );
- if( pWnd->GetSafeHwnd() == NULL )
- {
- CExtBarButton * pTBB = DYNAMIC_DOWNCAST( CExtBarButton, pObjHelperSrc );
- if( pTBB != NULL )
- pWnd = pTBB->GetBar();
- }
- if( pWnd->GetSafeHwnd() == NULL )
- return false;
- CExtPaintManager::PAINTINHERITEDBACKGROUNDDATA _pibd(
- bClientMapping,
- dc,
- pWnd,
- pObjHelperSrc = NULL,
- lParam
- );
- return _pibd.Notify();
- }
- UINT CExtPaintManager::g_nMsgPaintInheritedBackground =
- ::RegisterWindowMessage(
- _T("CExtPaintManager::g_nMsgPaintInheritedBackground")
- );
- bool CExtPaintManager::IsCustomBackgroundInheritanceEnabled() const
- {
- ASSERT_VALID( this );
- return m_bCustomBackgroundInheritanceEnabled;
- }
- bool CExtPaintManager::GetCustomBackgroundInheritanceMode(
- CObject * pObjHelperSrc,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pObjHelperSrc );
- pObjHelperSrc;
- lParam;
- return IsCustomBackgroundInheritanceEnabled();
- }
- bool CExtPaintManager::GetCb2DbTransparentMode(
- CObject * pObjHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( GetCustomBackgroundInheritanceMode(
- pObjHelperSrc,
- lParam
- )
- )
- return true;
- return false;
- }
- bool CExtPaintManagerNativeXP::GetCb2DbTransparentMode(
- CObject * pObjHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( GetCustomBackgroundInheritanceMode(
- pObjHelperSrc,
- lParam
- )
- )
- return true;
- // return false;
- return true;
- }
- bool CExtPaintManagerOffice2003::GetCb2DbTransparentMode(
- CObject * pObjHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return CExtPaintManagerXP::GetCb2DbTransparentMode( pObjHelperSrc, lParam );
- if( stat_GetBPP() <= 8 )
- return false;
- // (- 2.25)
- // if( g_PaintManager.m_bUxValidColorsExtracted && pObjHelperSrc != NULL )
- // {
- // ASSERT_VALID( pObjHelperSrc );
- // CDialog * pWnd = DYNAMIC_DOWNCAST( CDialog, pObjHelperSrc );
- // if( pWnd != NULL
- // && pWnd->GetSafeHwnd() != NULL
- // && (pWnd->GetStyle()&WS_CHILD) != 0
- // )
- // {
- // return false;
- // } // if( pWnd != NULL && ...
- // } // if( g_PaintManager.m_bUxValidColorsExtracted && pObjHelperSrc != NULL )
- return true;
- }
- bool CExtPaintManager::PaintDocumentClientAreaBkgnd(
- CDC & dc,
- CWnd * pWnd,
- LPARAM lParam // = NULL
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- ASSERT( pWnd->GetSafeHwnd() != NULL && ::IsWindow(pWnd->GetSafeHwnd()) );
- CRect rcClient;
- pWnd->GetClientRect( &rcClient );
- if( dc.RectVisible( &rcClient ) )
- dc.FillSolidRect( rcClient, GetColor( COLOR_3DFACE, pWnd, lParam ) );
- return true;
- }
- bool CExtPaintManager::PaintDockerBkgnd(
- bool bClientMapping,
- CDC & dc,
- CWnd * pWnd,
- LPARAM lParam // = NULL
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- ASSERT( pWnd->GetSafeHwnd() != NULL && ::IsWindow(pWnd->GetSafeHwnd()) );
- if( RenderCustomBackground( bClientMapping, dc, pWnd, lParam ) )
- return true;
- CRect rc;
- if( bClientMapping )
- pWnd->GetClientRect( &rc );
- else
- {
- pWnd->GetWindowRect( &rc );
- rc.OffsetRect( -rc.left, -rc.top );
- }
- dc.FillSolidRect( rc, GetColor( CLR_3DFACE_OUT, pWnd, lParam ) );
- return true;
- }
- bool CExtPaintManager::PaintDockerBkgnd(
- bool bClientMapping,
- CDC & dc,
- const CRect &rcDst,
- const CRect &rcWnd,
- LPARAM lParam // = NULL
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- rcWnd; lParam; bClientMapping;
- dc.FillSolidRect( rcDst, GetColor( CLR_3DFACE_OUT, NULL ) );
- return true;
- }
- bool CExtPaintManagerNativeXP::PaintDockerBkgnd(
- bool bClientMapping,
- CDC & dc,
- CWnd * pWnd,
- LPARAM lParam // = NULL
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- ASSERT( pWnd->GetSafeHwnd() != NULL && ::IsWindow(pWnd->GetSafeHwnd()) );
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- return CExtPaintManager::PaintDockerBkgnd( bClientMapping, dc, pWnd, lParam );
- if( RenderCustomBackground( bClientMapping, dc, pWnd, lParam ) )
- return true;
- if( ! GetCb2DbTransparentMode( pWnd ) )
- return false;
- bool bToolbarShade = false;
- bool bToolbarHorz = false;
- CWnd * pFrame = pWnd;
- for( ; pFrame != NULL; pFrame = pFrame->GetParent() )
- {
- if( (pFrame->GetStyle() & WS_CHILD) == 0 )
- break;
- else // frame features - design mode
- if( pFrame->IsKindOf(RUNTIME_CLASS(CFrameWnd)) )
- break;
- if( pFrame != pWnd
- && pFrame->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- )
- {
- if( ((CExtToolControlBar*)pFrame)->m_pDockSite != NULL )
- {
- if( (!( pFrame->IsKindOf( RUNTIME_CLASS(CExtPanelControlBar) )
- || pFrame->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) )
- ) )
- && (! ((CExtToolControlBar*)pFrame)->m_bForceNoBalloonWhenRedockable)
- )
- {
- if( ((CExtToolControlBar*)pFrame)->m_pDockBar == NULL )
- {
- if( ((CExtToolControlBar*)pFrame)->m_bForceBalloonGradientInDialogs != 0 )
- {
- bToolbarShade = true;
- DWORD dwBarStyle = ((CExtToolControlBar*)pFrame)->GetBarStyle();
- bToolbarHorz = ( ( dwBarStyle & ( CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT ) ) != 0 ) ? false : true;
- break;
- }
- continue;
- }
- if( ! ((CExtToolControlBar*)pFrame)->IsFloating() )
- {
- bToolbarShade = true;
- bToolbarHorz = ((CExtToolControlBar*)pFrame)->IsDockedHorizontally();
- }
- break;
- }
- }
- else if( ((CExtToolControlBar*)pFrame)->m_bForceBalloonGradientInDialogs != 0 )
- {
- bToolbarShade = true;
- DWORD dwBarStyle = ((CExtToolControlBar*)pFrame)->GetBarStyle();
- bToolbarHorz = ( ( dwBarStyle & ( CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT ) ) != 0 ) ? false : true;
- break;
- }
- }
- } // for( ; pFrame != NULL; pFrame = pFrame->GetParent() )
- if( pFrame == NULL )
- return false;
- CExtToolControlBar::FtLayoutQuery _FtLayoutQuery;
- if( _FtLayoutQuery.Query( pWnd->m_hWnd ) )
- {
- if( bClientMapping )
- _FtLayoutQuery.ReMapRectsToTargetClient();
- else
- _FtLayoutQuery.ReMapRectsToTargetWindow();
- _FtLayoutQuery.DrawRects( dc );
- return true;
- } // if( _FtLayoutQuery.Query( pWnd->m_hWnd ) )
- CRect rcPaintGradient;
- pFrame->GetClientRect( &rcPaintGradient );
- pFrame->ClientToScreen( &rcPaintGradient );
- if( bClientMapping )
- {
- pWnd->ScreenToClient( &rcPaintGradient );
- } // if( bClientMapping )
- else
- {
- CRect rc;
- pWnd->GetWindowRect( &rc );
- rcPaintGradient.OffsetRect( -rc.left, -rc.top );
- } // else from if( bClientMapping )
- if( ::IsRectEmpty( &rcPaintGradient )
- || ( ! dc.RectVisible( &rcPaintGradient ) )
- )
- return true;
- if( bToolbarShade )
- {
- bool bRebarDrawingStyle = false;
- CExtControlBar * pWndCB = DYNAMIC_DOWNCAST( CExtControlBar, pFrame );
- if( pWndCB != NULL )
- {
- ASSERT_VALID( pWndCB );
- if( pWndCB->m_pDockBar->GetSafeHwnd() != NULL )
- {
- ASSERT_VALID( pWndCB->m_pDockBar );
- if( pWndCB->IsFixedDockStyle()
- && (!pWndCB->IsFloating())
- )
- bRebarDrawingStyle = true;
- }
- }
- if( bRebarDrawingStyle )
- {
- CRect rcPaint;
- pWndCB->m_pDockBar->GetWindowRect( &rcPaint );
- pWndCB->ScreenToClient( &rcPaint );
- if( g_PaintManager.m_UxTheme.OpenThemeData( pWndCB->GetSafeHwnd(), VSCLASS_REBAR ) != NULL )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pWndCB->GetSafeHwnd(),
- dc.GetSafeHdc(),
- 0,
- 0,
- &rcPaint,
- &rcPaint
- ) == S_OK
- );
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- }
- else
- dc.FillSolidRect( &rcPaintGradient, ::GetSysColor( COLOR_3DFACE ) );
- } // else if( bToolbarShade )
- else
- dc.FillSolidRect( rcPaintGradient, ::GetSysColor( COLOR_3DFACE ) );
- return true;
- }
- bool CExtPaintManagerOffice2003::PaintDockerBkgnd(
- bool bClientMapping,
- CDC & dc,
- CWnd * pWnd,
- LPARAM lParam // = NULL
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- ASSERT( pWnd->GetSafeHwnd() != NULL && ::IsWindow(pWnd->GetSafeHwnd()) );
- if( IsHighContrast() )
- return CExtPaintManagerXP::PaintDockerBkgnd( bClientMapping, dc, pWnd, lParam );
- if( RenderCustomBackground( bClientMapping, dc, pWnd, lParam ) )
- return true;
- if( ! GetCb2DbTransparentMode( pWnd ) )
- return false;
- COLORREF clrSolidShade0 = ((COLORREF)(-1L));
- COLORREF clrSolidShade1 = ((COLORREF)(-1L));
- bool bToolbarShade = false;
- bool bToolbarHorz = false;
- CWnd * pFrame = pWnd;
- for( ; pFrame != NULL; pFrame = pFrame->GetParent() )
- {
- if( (pFrame->GetStyle() & WS_CHILD) == 0 )
- break;
- else // frame features - design mode
- if( pFrame->IsKindOf(RUNTIME_CLASS(CFrameWnd)) )
- break;
- if( pFrame != pWnd
- && pFrame->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- )
- {
- if( ((CExtToolControlBar*)pFrame)->m_pDockSite != NULL )
- {
- if( (!( pFrame->IsKindOf( RUNTIME_CLASS(CExtPanelControlBar) )
- || pFrame->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) )
- ) )
- && (! ((CExtToolControlBar*)pFrame)->m_bForceNoBalloonWhenRedockable)
- )
- {
- if( ((CExtToolControlBar*)pFrame)->m_pDockBar == NULL )
- {
- if( ((CExtToolControlBar*)pFrame)->m_bForceBalloonGradientInDialogs != 0 )
- {
- bToolbarShade = true;
- DWORD dwBarStyle = ((CExtToolControlBar*)pFrame)->GetBarStyle();
- bToolbarHorz = ( ( dwBarStyle & ( CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT ) ) != 0 ) ? false : true;
- break;
- }
- continue;
- }
- if( ((CExtToolControlBar*)pFrame)->IsFloating() )
- {
- clrSolidShade0 = GetColor( _2003CLR_GRADIENT_DARK, pWnd, lParam );
- clrSolidShade1 = GetColor( _2003CLR_GRADIENT_LIGHT, pWnd, lParam );
- }
- else
- {
- bToolbarShade = true;
- bToolbarHorz = ((CExtToolControlBar*)pFrame)->IsDockedHorizontally();
- }
- break;
- }
- }
- else if( ((CExtToolControlBar*)pFrame)->m_bForceBalloonGradientInDialogs != 0 )
- {
- bToolbarShade = true;
- DWORD dwBarStyle = ((CExtToolControlBar*)pFrame)->GetBarStyle();
- bToolbarHorz = ( ( dwBarStyle & ( CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT ) ) != 0 ) ? false : true;
- break;
- }
- }
- } // for( ; pFrame != NULL; pFrame = pFrame->GetParent() )
- if( pFrame == NULL )
- return false;
- CExtToolControlBar::FtLayoutQuery _FtLayoutQuery;
- if( _FtLayoutQuery.Query( pWnd->m_hWnd ) )
- {
- if( bClientMapping )
- _FtLayoutQuery.ReMapRectsToTargetClient();
- else
- _FtLayoutQuery.ReMapRectsToTargetWindow();
- _FtLayoutQuery.DrawRects( dc );
- return true;
- } // if( _FtLayoutQuery.Query( pWnd->m_hWnd ) )
- CRect rcPaintGradient;
- /// pFrame->GetWindowRect( &rcPaintGradient );
- pFrame->GetClientRect( &rcPaintGradient );
- pFrame->ClientToScreen( &rcPaintGradient );
- if( bClientMapping )
- {
- pWnd->ScreenToClient( &rcPaintGradient );
- } // if( bClientMapping )
- else
- {
- CRect rc;
- pWnd->GetWindowRect( &rc );
- rcPaintGradient.OffsetRect( -rc.left, -rc.top );
- /// rcPaintGradient.OffsetRect( -rcPaintGradient.left, -rcPaintGradient.top );
- } // else from if( bClientMapping )
- if( ::IsRectEmpty( &rcPaintGradient )
- || ( ! dc.RectVisible( &rcPaintGradient ) )
- )
- return true;
- if( clrSolidShade0 != ((COLORREF)(-1L)) )
- {
- if( clrSolidShade1 != ((COLORREF)(-1L)) )
- {
- bool bRTL = ( (dc.GetLayout()&LAYOUT_RTL) != 0 ) ? true : false;
- if( bRTL )
- {
- COLORREF clrTmp = clrSolidShade0;
- clrSolidShade0 = clrSolidShade1;
- clrSolidShade1 = clrTmp;
- } // if( bRTL )
- stat_PaintGradientRect(
- dc,
- rcPaintGradient,
- clrSolidShade0,
- clrSolidShade1,
- true
- );
- } // if( clrSolidShade1 != ((COLORREF)(-1L)) )
- else
- dc.FillSolidRect( rcPaintGradient, clrSolidShade0 );
- return true;
- } // if( clrSolidShade0 != ((COLORREF)(-1L)) )
- if( bToolbarShade )
- {
- if( OnQueryUseThemeColors() )
- {
- // if use WinXP themed colors
- COLORREF clrLeft = GetColor( _2003CLR_TOOLBAR_GRADIENT_LIGHT, pWnd, lParam );
- COLORREF clrMiddle = GetColor( _2003CLR_TOOLBAR_GRADIENT_MIDDLE, pWnd, lParam );
- COLORREF clrRight = GetColor( _2003CLR_TOOLBAR_GRADIENT_DARK, pWnd, lParam );
- stat_PaintGradientRect2steps( dc, rcPaintGradient, clrLeft, clrMiddle, clrRight, bToolbarHorz, 5, 11 );
- } // if( OnQueryUseThemeColors() )
- else
- {
- COLORREF clrLeft =
- bToolbarHorz
- ? GetColor( _2003CLR_MLA_NORM_RIGHT, pWnd, lParam )
- : GetColor( _2003CLR_MLA_NORM_LEFT, pWnd, lParam )
- ;
- COLORREF clrRight =
- bToolbarHorz
- ? GetColor( _2003CLR_MLA_NORM_LEFT, pWnd, lParam )
- : GetColor( _2003CLR_MLA_NORM_RIGHT, pWnd, lParam )
- ;
- stat_PaintGradientRect( dc, rcPaintGradient, clrLeft, clrRight, bToolbarHorz );
- } // else from if( OnQueryUseThemeColors() )
- } // if( bToolbarShade )
- else
- {
- CRect rcWnd;
- if( bClientMapping )
- {
- pWnd->GetClientRect( &rcWnd );
- pFrame->ClientToScreen( &rcWnd );
- }
- else
- pWnd->GetWindowRect( &rcWnd );
- PaintDockerBkgnd( bClientMapping, dc, rcPaintGradient, rcWnd );
- } // else from if( bToolbarShade )
- return true;
- }
- bool CExtPaintManagerOffice2003::PaintDockerBkgnd(
- bool bClientMapping,
- CDC & dc,
- const CRect &rcDst,
- const CRect &rcWnd,
- LPARAM lParam // = NULL
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return CExtPaintManagerXP::PaintDockerBkgnd( bClientMapping, dc, rcDst, rcWnd, lParam );
- COLORREF clrLeft = GetColor( _2003CLR_GRADIENT_DARK, NULL );
- COLORREF clrRight = GetColor( _2003CLR_GRADIENT_LIGHT, NULL );
- if( clrLeft == clrRight )
- {
- dc.FillSolidRect( &rcDst, clrLeft );
- return true;
- }
- CRect rcDst1( rcDst );
- CRect rcDst2( 0, 0, 0, 0 );
- bool bRTL = ( (dc.GetLayout()&LAYOUT_RTL) != 0 ) ? true : false;
- if( rcDst.Width() >= 686 )
- {
- if( bRTL )
- {
- rcDst2 = rcDst;
- rcDst2.right = rcDst2.left + rcDst1.Width() - 686;
- rcDst1 = rcDst;
- rcDst1.left = rcDst2.right;
- } // if( bRTL )
- else
- {
- rcDst1.right = rcDst1.left + 686;
- rcDst2 = rcDst;
- rcDst2.left = rcDst1.right;
- } // else from if( bRTL )
- } // if( rcDst.Width() >= 686 )
- stat_PaintGradientRect( dc, rcDst1, bRTL ? clrRight : clrLeft, bRTL ? clrLeft : clrRight, false, 64 );
- if( ! rcDst2.IsRectNull() )
- {
- if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 16 )
- dc.FillSolidRect( &rcDst2, clrRight );
- else
- stat_PaintGradientRect( dc, rcDst2, clrRight, clrRight, false, 64 );
- }
- return true;
- }
- void CExtPaintManager::PaintControlBarClientArea(
- CDC & dc,
- const RECT & rcClient,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ::IsRectEmpty( &rcClient ) || ( ! dc.RectVisible( &rcClient ) ) )
- return;
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ( ((CExtToolControlBar*)pHelperSrc)->m_bForceNoBalloonWhenRedockable )
- && RenderCustomBackground( true, dc, pHelperSrc, lParam )
- )
- return;
- dc.FillSolidRect( &rcClient, GetColor( CLR_3DFACE_OUT, pHelperSrc, lParam ) );
- }
- void CExtPaintManagerOffice2003::InitTranslatedColors()
- {
- ASSERT_VALID( this );
- m_nIdxClrBtnHoverLeft = -1;
- m_nIdxClrBtnHoverRight = -1;
- m_nIdxClrBtnPressedLeft = -1;
- m_nIdxClrBtnPressedRight = -1;
- m_nIdxClrBtnHovPresLeft = -1;
- m_nIdxClrBtnHovPresRight = -1;
- m_nIdxClrTbFillMargin = -1;
- g_PaintManager.m_bUxValidColorsExtracted = false;
- g_PaintManager.InitUserExApi();
-
- CExtPaintManagerXP::InitTranslatedColors();
- if( stat_GetBPP() > 8 )
- {
- if( OnQueryUseThemeColors() )
- {
- // if use WinXP themed colors
- COLORREF clrFillHint, clrAccentHint;
- OnQueryThemeColors( &clrFillHint, &clrAccentHint );
- // xp - menu face
- COLORREF xpclr_MenuLight = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.95, -0.05 );
- xpclr_MenuLight = RGB(
- GetRValue(xpclr_MenuLight) + ::MulDiv( 255 - GetRValue(xpclr_MenuLight), 40, 100 ),
- GetGValue(xpclr_MenuLight) + ::MulDiv( 255 - GetGValue(xpclr_MenuLight), 20, 100 ),
- GetBValue(xpclr_MenuLight) );
- xpclr_MenuLight = CExtBitmap::stat_HLS_Adjust( xpclr_MenuLight, 0.00, 0.06, 0.05 );
- // 2003 - float light
- COLORREF xpclr_FloatFace = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.50, 0.00 );
-
- // xp - rarely used item left side
- COLORREF xpclr_RarelyUsedMenuLeft = RGB(
- ( 999L*long(GetRValue(clrFillHint)) ) / 1000L,
- ( 995L*long(GetGValue(clrFillHint)) ) / 1000L,
- ( 995L*long(GetBValue(clrFillHint)) ) / 1000L );
-
- // xp - control bar background
- COLORREF xpclr_ControlBarBk = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.20, 0.00 );
-
- // xp - orange like light ver
- COLORREF xpclr_Highlight = CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.02, 0.60, 0.45 );
-
- // 2003 - dark orange
- COLORREF clr2003faceIn = CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.00, -0.30, 0.45 );
-
- // xp - blue like dark ver
- COLORREF clrTmp = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.20, 0.00 );
- COLORREF xpclr_HighlightDarked = CExtBitmap::stat_HLS_Adjust( clrTmp, 0.00, -0.25, 0.10 );
-
- // xp - dark selected border
- COLORREF xpclr_HighlightBorder = CExtBitmap::stat_HLS_Adjust( xpclr_HighlightDarked, 0.00, -0.50, 0.00 );
-
- // xp - dark gray separator
- COLORREF xpclr_Separator = RGB(
- ( 857L*long(GetRValue(clrFillHint)) ) / 1000L,
- ( 857L*long(GetGValue(clrFillHint)) ) / 1000L,
- ( 857L*long(GetBValue(clrFillHint)) ) / 1000L );
-
- // xp - dark panel border (for floating controlbars)
- COLORREF xpclr_PanelBorder =
- CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.25, 0.00 );
- m_mapColorTranslate[CLR_3DFACE_OUT] = InstallColor( xpclr_ControlBarBk );
- m_mapColorTranslate[CLR_3DFACE_IN] = InstallColor( xpclr_Highlight );
- m_mapColorTranslate[CLR_3DFACE_DISABLED] = COLOR_3DFACE;
- int idxClrDark = InstallColor( xpclr_PanelBorder );
- m_mapColorTranslate[CLR_3DLIGHT_OUT] = idxClrDark;
- m_mapColorTranslate[CLR_3DLIGHT_IN] = idxClrDark;
- m_mapColorTranslate[CLR_3DLIGHT_DISABLED] = idxClrDark;
- m_mapColorTranslate[CLR_3DHILIGHT_OUT] = idxClrDark;
- m_mapColorTranslate[CLR_3DHILIGHT_IN] = idxClrDark;
- m_mapColorTranslate[CLR_3DHILIGHT_DISABLED] = idxClrDark;
- m_mapColorTranslate[CLR_3DSHADOW_OUT] = idxClrDark;
- m_mapColorTranslate[CLR_3DSHADOW_IN] = idxClrDark;
- m_mapColorTranslate[CLR_3DSHADOW_DISABLED] = idxClrDark;
- m_mapColorTranslate[CLR_3DDKSHADOW_OUT] = idxClrDark;
- m_mapColorTranslate[CLR_3DDKSHADOW_IN] = idxClrDark;
- m_mapColorTranslate[CLR_3DDKSHADOW_DISABLED] = idxClrDark;
-
- m_mapColorTranslate[CLR_TEXT_OUT] = COLOR_WINDOWTEXT;
- m_mapColorTranslate[CLR_TEXT_IN] = COLOR_WINDOWTEXT;
- m_mapColorTranslate[CLR_TEXT_DISABLED] = COLOR_GRAYTEXT;
- m_mapColorTranslate[XPCLR_PUSHEDHOVERTEXT] = COLOR_BTNTEXT;
- // Menu text colors
- m_mapColorTranslate[CLR_MENUTEXT_OUT] = InstallColor( RGB(0,0,0) );
- m_mapColorTranslate[CLR_MENUTEXT_IN] = InstallColor( RGB(0,0,0) );
- m_mapColorTranslate[CLR_MENUTEXT_DISABLED] = COLOR_GRAYTEXT;
- m_mapColorTranslate[XPCLR_TEXT_FIELD_BORDER_NORMAL] = COLOR_3DFACE;
- m_mapColorTranslate[XPCLR_TEXT_FIELD_BORDER_DISABLED] = InstallColor( xpclr_Separator );
- m_mapColorTranslate[XPCLR_3DFACE_DARK] = InstallColor( xpclr_ControlBarBk );
- m_mapColorTranslate[XPCLR_3DFACE_NORMAL] = InstallColor( xpclr_MenuLight );
- m_mapColorTranslate[XPCLR_SEPARATOR] = InstallColor( xpclr_Separator );
- m_mapColorTranslate[XPCLR_HILIGHT] =
- //InstallColor( xpclr_HighlightDarked );
- InstallColor( clr2003faceIn );
- m_mapColorTranslate[XPCLR_HILIGHT_BORDER] = InstallColor( xpclr_HighlightBorder );
- m_mapColorTranslate[XPCLR_HILIGHT_BORDER_SELECTED] = InstallColor( xpclr_HighlightBorder );
-
- m_mapColorTranslate[XPCLR_RARELY_BORDER] = InstallColor( xpclr_RarelyUsedMenuLeft );
- m_mapColorTranslate[XPCLR_3DFACE_FLOAT_F] = InstallColor( xpclr_FloatFace );
-
- // install new colors
- m_mapColorTranslate[_2003CLR_GRADIENT_LIGHT] =
- InstallColor(
- ( OnQuerySystemTheme() == ThemeLunaSilver )
- ? CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.845, 0.10 )
- : CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.43, 0.00 )
- );
- m_mapColorTranslate[_2003CLR_GRADIENT_DARK] =
- InstallColor(
- ( OnQuerySystemTheme() == ThemeLunaSilver )
- ? CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.45, 0.10 )
- : CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.02, 0.07, 0.00 )
- );
- m_mapColorTranslate[_2003CLR_SEPARATOR_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.98, 0.00 ) );
- m_mapColorTranslate[_2003CLR_SEPARATOR_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.45, -0.00 ) );
- m_mapColorTranslate[_2003CLR_GRIPPER_DOT_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.60, 0.00 ) );
- m_mapColorTranslate[_2003CLR_GRIPPER_DOT_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.95, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.10, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.60, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_HOVER_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.00, 0.85, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_HOVER_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.00, -0.05, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_PRESSED_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.00, 0.30, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_PRESSED_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.00, -0.30, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPGLYPH_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.97, 0.00 ) );
- m_mapColorTranslate[_2003CLR_EXPGLYPH_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.97, 0.00 ) );
- m_mapColorTranslate[_2003CLR_STATUSBAR_ITEM] = COLOR_3DSHADOW;
- COLORREF clrTbGradientLight = (COLORREF)(-1L);
- COLORREF clrTbGradientMiddle = (COLORREF)(-1L);
- COLORREF clrTbGradientDark = (COLORREF)(-1L);
- COLORREF clrTbBottomLine = (COLORREF)(-1L);
- COLORREF clrMlaNormLeft = (COLORREF)(-1L);
- COLORREF clrMlaNormMiddle = (COLORREF)(-1L);
- COLORREF clrMlaNormRight = (COLORREF)(-1L);
- COLORREF clrMlaRarelyLeft = (COLORREF)(-1L);
- COLORREF clrMlaRarelyMiddle = (COLORREF)(-1L);
- COLORREF clrMlaRarelyRight = (COLORREF)(-1L);
- COLORREF clrMenuBorder = (COLORREF)(-1L);
- COLORREF clrTbbBkTop = (COLORREF)(-1L);
- COLORREF clrTbbBkBottom = (COLORREF)(-1L);
- e_system_theme_t eCurrentTheme = OnQuerySystemTheme();
- switch( eCurrentTheme )
- {
- case ThemeLunaRoyale: // +2.87
- case ThemeVistaOrLaterUX: // +2.87
- case ThemeVistaOrLaterDWM: // +2.87
- case ThemeLunaBlue:
- clrTbGradientLight = RGB(221, 236, 254);
- clrTbGradientMiddle = RGB(202, 225, 252);
- clrTbGradientDark = RGB(110, 155, 216);
- clrTbBottomLine = RGB(59, 97, 156);
- clrMlaNormLeft = RGB(227, 239, 255);
- clrMlaNormMiddle = RGB(202, 225, 252);
- clrMlaNormRight = RGB(135, 173, 228);
- clrMlaRarelyLeft = RGB(203, 221, 246);
- clrMlaRarelyMiddle = RGB(161, 196, 248);
- clrMlaRarelyRight = RGB(121, 161, 220);
- clrMenuBorder = RGB(0, 45, 150);
- clrTbbBkTop = RGB(227, 239, 255);
- clrTbbBkBottom = RGB(123, 164, 224);
- break;
- case ThemeLunaOlive:
- clrTbGradientLight = RGB(244, 247, 222);
- clrTbGradientMiddle = RGB(206, 220, 167);
- clrTbGradientDark = RGB(177, 192, 139);
- clrTbBottomLine = RGB(96, 128, 88);
- clrMlaNormLeft = RGB(255, 255, 237);
- clrMlaNormMiddle = RGB(206, 219, 167);
- clrMlaNormRight = RGB(184, 199, 146);
- clrMlaRarelyLeft = RGB(230, 230, 209);
- clrMlaRarelyMiddle = RGB(186, 200, 143);
- clrMlaRarelyRight = RGB(164, 180, 120);
- clrMenuBorder = RGB(117, 141, 94);
- clrTbbBkTop = RGB(237, 239, 214);
- clrTbbBkBottom = RGB(181, 196, 143);
- break;
- case ThemeLunaSilver:
- clrTbGradientLight = RGB(243, 244, 250);
- clrTbGradientMiddle = RGB(225, 226, 236);
- clrTbGradientDark = RGB(134, 130, 166);
- clrTbBottomLine = RGB(124, 124, 148);
- clrMlaNormLeft = RGB(249, 249, 255);
- clrMlaNormMiddle = RGB(225, 226, 236);
- clrMlaNormRight = RGB(159, 157, 185);
- clrMlaRarelyLeft = RGB(215, 215, 226);
- clrMlaRarelyMiddle = RGB(184, 185, 202);
- clrMlaRarelyRight = RGB(128, 126, 158);
- clrMenuBorder = RGB(124, 124, 148);
- clrTbbBkTop = RGB(231, 233, 241);
- clrTbbBkBottom = RGB(172, 170, 194);
- break;
- default:
- clrTbGradientLight = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.75, 0.15 );
- clrTbGradientMiddle = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.65, 0.15 );
- clrTbGradientDark = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00,-0.22,-0.25 );
- clrTbBottomLine = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.60, 0.00 );
- clrMlaNormLeft = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.75, 0.00 );
- clrMlaNormRight = CExtBitmap::stat_HLS_Adjust( GetColor( XPCLR_3DFACE_DARK, this ), 0.00, -0.10, 0.00 );
- clrMlaNormMiddle = CExtBitmap::stat_HLS_Adjust( clrMlaNormRight, 0.00, 0.55, 0.00 );
- clrMlaRarelyLeft = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.30, 0.00 );
- clrMlaRarelyRight = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.25, 0.00 );
- clrMlaRarelyMiddle = CExtBitmap::stat_HLS_Adjust( clrMlaRarelyRight, 0.00, 0.55, 0.00 );
- clrMenuBorder = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.68, 0.00 );
- clrTbbBkTop = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.75, 0.00 );
- clrTbbBkBottom = CExtBitmap::stat_HLS_Adjust( GetColor( XPCLR_3DFACE_DARK, this ), 0.00, -0.10, 0.00 );
- break;
- } // switch( eCurrentTheme )
- m_mapColorTranslate[_2003CLR_TBB_BK_COMBINED_TOP] = InstallColor( clrTbbBkTop );
- m_mapColorTranslate[_2003CLR_TBB_BK_COMBINED_BOTTOM] = InstallColor( clrTbbBkBottom );
- m_mapColorTranslate[_2003CLR_TOOLBAR_GRADIENT_LIGHT] = InstallColor( clrTbGradientLight );
- m_mapColorTranslate[_2003CLR_TOOLBAR_GRADIENT_MIDDLE] = InstallColor( clrTbGradientMiddle );
- m_mapColorTranslate[_2003CLR_TOOLBAR_GRADIENT_DARK] = InstallColor( clrTbGradientDark );
- m_mapColorTranslate[_2003CLR_TOOLBAR_BOTTOM_LINE] = InstallColor( clrTbBottomLine );
- m_mapColorTranslate[_2003CLR_MLA_NORM_LEFT] = InstallColor( clrMlaNormLeft );
- m_mapColorTranslate[_2003CLR_MLA_NORM_MIDDLE] = InstallColor( clrMlaNormMiddle );
- m_mapColorTranslate[_2003CLR_MLA_NORM_RIGHT] = InstallColor( clrMlaNormRight );
- m_mapColorTranslate[_2003CLR_MLA_RARELY_LEFT] = InstallColor( clrMlaRarelyLeft );
- m_mapColorTranslate[_2003CLR_MLA_RARELY_MIDDLE] = InstallColor( clrMlaRarelyMiddle );
- m_mapColorTranslate[_2003CLR_MLA_RARELY_RIGHT] = InstallColor( clrMlaRarelyRight );
- m_mapColorTranslate[XPCLR_MENU_BORDER] = InstallColor( clrMenuBorder );
- m_mapColorTranslate[_2003CLR_BTN_HOVER_LEFT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.05, 0.75, 0.00 ) );
- m_mapColorTranslate[_2003CLR_BTN_HOVER_RIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, -0.05, -0.02, 0.00 ) );
- m_mapColorTranslate[_2003CLR_BTN_PRESSED_LEFT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.02, 0.40, 0.00 ) );
- m_mapColorTranslate[_2003CLR_BTN_PRESSED_RIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, -0.07, -0.31, 0.00 ) );
- m_mapColorTranslate[_2003CLR_BTN_HP_LEFT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, -0.07, -0.31, 0.00 ) );
- m_mapColorTranslate[_2003CLR_BTN_HP_RIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrAccentHint, 0.02, 0.40, 0.00 ) );
- // page navigator colors
- m_mapColorTranslate[_2003CLR_PN_BORDER] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.10, -0.55, 0.00 ) );
- m_mapColorTranslate[_2003CLR_PN_GRIPPER_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.02, -0.23, -0.25 ) );
- m_mapColorTranslate[_2003CLR_PN_GRIPPER_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.05, -0.60, 0.00 ) );
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.45, 0.00 ) );
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.00, 0.00 ) );
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_HOVER_LIGHT] = m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_LIGHT];
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_HOVER_DARK] = m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_DARK];
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_BOTTOM_LINE] = m_mapColorTranslate[_2003CLR_PN_BORDER];
- m_mapColorTranslate[_2003CLR_PN_ITEM_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.55, 0.20 ) );
- m_mapColorTranslate[_2003CLR_PN_ITEM_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.13, -0.15 ) );
- // Popup menu Expand Button
- m_mapColorTranslate[_2003CLR_EXPBTN_CIRCLE_LIGHT] = InstallColor( GetColor( _2003CLR_MLA_NORM_LEFT, this ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_CIRCLE_DARK] = InstallColor( GetColor( _2003CLR_MLA_NORM_RIGHT, this ) );
- // Button colors
- m_nIdxClrBtnHoverLeft = _2003CLR_BTN_HOVER_LEFT;
- m_nIdxClrBtnHoverRight = _2003CLR_BTN_HOVER_RIGHT;
- m_nIdxClrBtnPressedLeft = _2003CLR_BTN_PRESSED_LEFT;
- m_nIdxClrBtnPressedRight = _2003CLR_BTN_PRESSED_RIGHT;
- m_nIdxClrBtnHovPresLeft = _2003CLR_BTN_HP_LEFT;
- m_nIdxClrBtnHovPresRight = _2003CLR_BTN_HP_RIGHT;
-
- m_nIdxClrTbFillMargin = _2003CLR_TOOLBAR_BOTTOM_LINE;
- m_colors[COLOR_3DFACE] = clrFillHint;
- m_colors[COLOR_3DLIGHT] = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.45, 0.10 );
- m_colors[COLOR_3DHIGHLIGHT] = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, 0.75, 0.00 );
- m_colors[COLOR_3DSHADOW] = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.45, 0.10 );
- m_colors[COLOR_3DDKSHADOW] = CExtBitmap::stat_HLS_Adjust( clrFillHint, 0.00, -0.75, 0.00 );
- // Task Pane Colors
- COLORREF clrTPBkTop = (COLORREF)(-1L);
- COLORREF clrTPBkBottom = (COLORREF)(-1L);
- COLORREF clrTPGroupCaptionTextNormal = (COLORREF)(-1L);
- COLORREF clrTPGroupCaptionTextNormalHover = (COLORREF)(-1L);
- COLORREF clrTPGroupCaptionBkLeftNormal = (COLORREF)(-1L);
- COLORREF clrTPGroupCaptionBkRightNormal = (COLORREF)(-1L);
-
- switch( eCurrentTheme )
- {
- case ThemeLunaRoyale: // +2.87
- case ThemeVistaOrLaterUX: // +2.87
- case ThemeVistaOrLaterDWM: // +2.87
- case ThemeLunaBlue:
- clrTPBkTop = RGB(221, 236, 254);
- clrTPBkBottom = RGB(74, 122, 201);
- clrTPGroupCaptionTextNormal = RGB(0, 45, 134);
- clrTPGroupCaptionTextNormalHover = RGB(0, 45, 134);
- clrTPGroupCaptionBkLeftNormal = RGB(196, 219, 249);
- clrTPGroupCaptionBkRightNormal = RGB(101, 143, 224);
- break;
- case ThemeLunaOlive:
- clrTPBkTop = RGB(243, 242, 231);
- clrTPBkBottom = RGB(190, 198, 152);
- clrTPGroupCaptionTextNormal = RGB(90, 107, 70);
- clrTPGroupCaptionTextNormalHover = RGB(90, 107, 70);
- clrTPGroupCaptionBkLeftNormal = RGB(210, 223, 174);
- clrTPGroupCaptionBkRightNormal = RGB(161, 176, 128);
- break;
- case ThemeLunaSilver:
- clrTPBkTop = RGB(238, 238, 244);
- clrTPBkBottom = RGB(177, 176, 195);
- clrTPGroupCaptionTextNormal = RGB(92, 91, 121);
- clrTPGroupCaptionTextNormalHover = RGB(92, 91, 121);
- clrTPGroupCaptionBkLeftNormal = RGB(207, 207, 222);
- clrTPGroupCaptionBkRightNormal = RGB(169, 168, 191);
- break;
- default:
- clrTPBkTop = CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 50 );
- clrTPBkBottom = GetColor( COLOR_3DFACE, this );
- clrTPGroupCaptionTextNormal = GetColor( COLOR_WINDOWTEXT, this );
- clrTPGroupCaptionTextNormalHover = GetColor( COLOR_WINDOWTEXT, this );
- clrTPGroupCaptionBkLeftNormal = CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 39 );
- clrTPGroupCaptionBkRightNormal = CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 70 );
- break;
- } // switch( eCurrentTheme )
- m_mapColorTranslate[ CLR_TASK_PANE_BK_TOP ] = InstallColor( clrTPBkTop );
- m_mapColorTranslate[ CLR_TASK_PANE_BK_BOTTOM ] = InstallColor( clrTPBkBottom );
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL ] = InstallColor( clrTPGroupCaptionTextNormal );
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL_HOVERED ] = InstallColor( clrTPGroupCaptionTextNormalHover );
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_HIGHLIGHTED ] = m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL ];
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_HIGHLIGHTED_HOVERED ] = m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL_HOVERED ];
- m_mapColorTranslate[CLR_TASK_PANE_GROUP_CAPTION_BK_LEFT_NORMAL] = InstallColor( clrTPGroupCaptionBkLeftNormal );
- m_mapColorTranslate[CLR_TASK_PANE_GROUP_CAPTION_BK_LEFT_HIGHLIGHTED] = InstallColor( clrTPGroupCaptionBkRightNormal );
- m_mapColorTranslate[CLR_TASK_PANE_GROUP_CAPTION_BK_RIGHT_NORMAL] = InstallColor( clrTPGroupCaptionBkRightNormal );
- m_mapColorTranslate[CLR_TASK_PANE_GROUP_CAPTION_BK_RIGHT_HIGHLIGHTED] = InstallColor( clrTPGroupCaptionBkLeftNormal );
- } // if use WinXP themed colors
- else
- { // if use system colors
- // install new colors
- m_mapColorTranslate[_2003CLR_GRADIENT_LIGHT] = InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 222 ) );
- m_mapColorTranslate[_2003CLR_GRADIENT_DARK] = COLOR_3DFACE;
- m_mapColorTranslate[_2003CLR_SEPARATOR_LIGHT] = InstallColor( RGB(255,255,255) );
- m_mapColorTranslate[_2003CLR_SEPARATOR_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( COLOR_WINDOW, this ), 0.0, -0.36, -0.80 ) );
- m_mapColorTranslate[_2003CLR_GRIPPER_DOT_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( COLOR_3DSHADOW, this ), 0.0, 0.20, 0.0 ) );
- m_mapColorTranslate[_2003CLR_GRIPPER_DOT_LIGHT] = COLOR_WINDOW;
- m_mapColorTranslate[_2003CLR_EXPBTN_LIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( COLOR_3DSHADOW, this ), 0.0, 0.70, 0.10 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_DARK] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( COLOR_3DSHADOW, this ), 0.0, -0.05, 0.0 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_HOVER_LIGHT] = m_mapColorTranslate[_2003CLR_EXPBTN_HOVER_DARK] =
- InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( XPCLR_HILIGHT, this ), 0.0, 0.30, 0.0 ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_PRESSED_LIGHT] = m_mapColorTranslate[_2003CLR_EXPBTN_PRESSED_DARK] =
- InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( XPCLR_HILIGHT, this ), 0.0, 0.60, 0.0 ) );
- m_mapColorTranslate[_2003CLR_EXPGLYPH_LIGHT] = COLOR_WINDOW;
- m_mapColorTranslate[_2003CLR_EXPGLYPH_DARK] = COLOR_BTNTEXT;
- m_mapColorTranslate[_2003CLR_STATUSBAR_ITEM] = COLOR_3DSHADOW;
-
- m_mapColorTranslate[_2003CLR_MLA_NORM_LEFT] = InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_WINDOW, this ), GetColor( XPCLR_3DFACE_NORMAL, this ), 0 ) );
- m_mapColorTranslate[_2003CLR_MLA_NORM_MIDDLE] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( XPCLR_3DFACE_DARK, this ), 0.00, 0.40, 0.00 ) );
- m_mapColorTranslate[_2003CLR_MLA_NORM_RIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( XPCLR_3DFACE_DARK, this ), 0.00, -0.04, 0.00 ) );
- m_mapColorTranslate[_2003CLR_MLA_RARELY_LEFT] = InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_WINDOW, this ), GetColor( XPCLR_3DFACE_DARK, this ), 500 ) );
- m_mapColorTranslate[_2003CLR_MLA_RARELY_MIDDLE] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( _2003CLR_MLA_NORM_RIGHT, this ), 0.00, 0.30, 0.00 ) );
- m_mapColorTranslate[_2003CLR_MLA_RARELY_RIGHT] = InstallColor( CExtBitmap::stat_HLS_Adjust( GetColor( _2003CLR_MLA_NORM_RIGHT, this ), 0.00, -0.04, 0.00 ) );
- m_mapColorTranslate[_2003CLR_TBB_BK_COMBINED_TOP] = m_mapColorTranslate[_2003CLR_MLA_NORM_LEFT];
- m_mapColorTranslate[_2003CLR_TBB_BK_COMBINED_BOTTOM] = m_mapColorTranslate[_2003CLR_MLA_NORM_RIGHT];
- // Button colors
- m_mapColorTranslate[_2003CLR_BTN_HOVER_LEFT] = InstallColor( GetColor( CLR_3DFACE_IN, this ) );
- m_mapColorTranslate[_2003CLR_BTN_HOVER_RIGHT] = InstallColor( GetColor( CLR_3DFACE_IN, this ) );
- m_mapColorTranslate[_2003CLR_BTN_PRESSED_LEFT] = InstallColor( GetColor( CLR_3DFACE_IN, this ) );
- m_mapColorTranslate[_2003CLR_BTN_PRESSED_RIGHT] = InstallColor( GetColor( CLR_3DFACE_IN, this ) );
- m_mapColorTranslate[_2003CLR_BTN_HP_LEFT] = InstallColor( GetColor( XPCLR_HILIGHT, this ) );
- m_mapColorTranslate[_2003CLR_BTN_HP_RIGHT] = InstallColor( GetColor( XPCLR_HILIGHT, this ) );
- // page navigator colors
- m_mapColorTranslate[_2003CLR_PN_BORDER] = InstallColor( GetColor( COLOR_3DSHADOW, this ) );
- m_mapColorTranslate[_2003CLR_PN_GRIPPER_LIGHT] = InstallColor( GetColor( COLOR_3DLIGHT, this ) );
- m_mapColorTranslate[_2003CLR_PN_GRIPPER_DARK] = InstallColor( GetColor( COLOR_3DSHADOW, this ) );
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_LIGHT] = InstallColor( GetColor( COLOR_3DHILIGHT, this ) );
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_DARK] = InstallColor( GetColor( COLOR_3DLIGHT, this ) );
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_HOVER_LIGHT] = m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_LIGHT];
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_HOVER_DARK] = m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_DARK];
- m_mapColorTranslate[_2003CLR_PN_PANE_CAPTION_BOTTOM_LINE] = m_mapColorTranslate[_2003CLR_PN_BORDER];
- m_mapColorTranslate[_2003CLR_PN_ITEM_LIGHT] = InstallColor( GetColor( COLOR_3DHILIGHT, this ) );
- m_mapColorTranslate[_2003CLR_PN_ITEM_DARK] = InstallColor( GetColor( COLOR_3DLIGHT, this ) );
- // Popup menu Expand Button
- m_mapColorTranslate[_2003CLR_EXPBTN_CIRCLE_LIGHT] = InstallColor( GetColor( XPCLR_3DFACE_NORMAL, this ) );
- m_mapColorTranslate[_2003CLR_EXPBTN_CIRCLE_DARK] = InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_WINDOW, this ), GetColor( COLOR_3DFACE, this ), 550 ) );
- // Task Pane Colors
- m_mapColorTranslate[ CLR_TASK_PANE_BK_TOP ] = InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 50 ) );
- m_mapColorTranslate[ CLR_TASK_PANE_BK_BOTTOM ] = InstallColor( GetColor( COLOR_3DFACE, this ) );
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL ] = COLOR_WINDOWTEXT;
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL_HOVERED ] = COLOR_WINDOWTEXT;
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_HIGHLIGHTED ] = m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL ];
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_HIGHLIGHTED_HOVERED ] = m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_TEXT_NORMAL_HOVERED ];
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_BK_LEFT_NORMAL ] =
- InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 39 ) );
- m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_BK_RIGHT_NORMAL ] =
- InstallColor( CExtBitmap::stat_RGB_Enlight( GetColor( COLOR_3DFACE, this ), GetColor( COLOR_WINDOW, this ), 70 ) );
- m_mapColorTranslate[CLR_TASK_PANE_GROUP_CAPTION_BK_LEFT_HIGHLIGHTED] = m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_BK_RIGHT_NORMAL ];
- m_mapColorTranslate[CLR_TASK_PANE_GROUP_CAPTION_BK_RIGHT_HIGHLIGHTED] = m_mapColorTranslate[ CLR_TASK_PANE_GROUP_CAPTION_BK_LEFT_NORMAL ];
- } // if use system colors
- } // if( stat_GetBPP() > 8 )
- else
- {
- m_mapColorTranslate[_2003CLR_STATUSBAR_ITEM] = InstallColor( GetColor( COLOR_3DSHADOW, this ) );
- } // else from if( stat_GetBPP() > 8 )
- }
- void CExtPaintManagerOffice2003::PaintControlBarClientArea(
- CDC & dc,
- const RECT & rcClient,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ::IsRectEmpty( &rcClient ) || ( ! dc.RectVisible( &rcClient ) ) )
- return;
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintControlBarClientArea( dc, rcClient, pHelperSrc, lParam );
- return;
- }
- CExtToolControlBar * pToolBar = NULL;
- CWnd * pFrame = NULL;
- if( pHelperSrc != NULL )
- {
- pToolBar = DYNAMIC_DOWNCAST( CExtToolControlBar, pHelperSrc );
- if( pToolBar != NULL )
- {
- if( ! ( pToolBar->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) )
- || pToolBar->IsKindOf( RUNTIME_CLASS(CExtPanelControlBar) )
- )
- )
- { // not menu bar, not panel bar
- if( pToolBar->m_pDockSite != NULL )
- {
- if( pToolBar->m_bForceNoBalloonWhenRedockable
- && (! pToolBar->IsFloating() )
- )
- pToolBar = NULL;
- else
- if( ( pToolBar->m_pDockBar == NULL || pToolBar->IsFloating() )
- && (!pToolBar->m_bForceBalloonGradientInDialogs)
- )
- pToolBar = NULL;
- } // if( pToolBar->m_pDockSite != NULL )
- else
- {
- CWnd * pWndOwner = pToolBar->GetOwner();
- if( pWndOwner != NULL )
- {
- pFrame =
- DYNAMIC_DOWNCAST( CFrameWnd, pWndOwner );
- if( pFrame == NULL )
- {
- if( (pWndOwner->GetStyle()&WS_CHILD) != 0 )
- pFrame = pWndOwner->GetParentFrame();
- } // if( pFrame == NULL )
- if( pFrame != NULL
- && (!pToolBar->m_bForceBalloonGradientInDialogs)
- )
- {
- if( pFrame->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
- { // if ext mini dock frame
- } // if ext mini dock frame
- else
- {
- CControlBar * pDocker =
- ((CFrameWnd *)pFrame)->
- GetControlBar( AFX_IDW_DOCKBAR_TOP );
- if( pDocker == NULL )
- {
- pFrame = NULL;
- pToolBar = NULL;
- }
- else if( ! pDocker->IsKindOf(RUNTIME_CLASS(CExtDockOuterBar)) )
- {
- pFrame = NULL;
- pToolBar = NULL;
- }
- }
- } // if( pFrame != NULL )
- } // if( pWndOwner != NULL )
- } // else from if( pToolBar->m_pDockSite != NULL )
- } // not menu bar, not panel bar
- } // if( pToolBar != NULL )
- } // if( pHelperSrc != NULL )
- if( pToolBar == NULL
- || ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8
- )
- {
- CWnd * pWnd = DYNAMIC_DOWNCAST( CWnd, pHelperSrc );
- if( pWnd != NULL
- && GetCb2DbTransparentMode( pWnd )
- && PaintDockerBkgnd( true, dc, pWnd )
- )
- return;
- CExtPaintManagerXP::PaintControlBarClientArea(
- dc,
- rcClient,
- pHelperSrc,
- lParam
- );
- return;
- }
- CRect rcPaintGradient;
- if( pFrame == NULL )
- pFrame = (pToolBar->m_pDockSite == NULL)
- ? pToolBar->GetParent()
- : pToolBar->GetParentFrame()
- ;
- ASSERT_VALID( pFrame );
- pFrame->GetClientRect( &rcPaintGradient );
- pFrame->ClientToScreen( &rcPaintGradient );
- pToolBar->ScreenToClient( &rcPaintGradient );
- if( ::IsRectEmpty( &rcPaintGradient )
- || ( ! dc.RectVisible( &rcPaintGradient ) )
- )
- return;
- bool bHorz = true;
- if( pToolBar->IsDocked() )
- bHorz = (! pToolBar->IsDockedVertically() );
- PaintDockerBkgnd( true, dc, pToolBar );
- if( pToolBar->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) )
- || pToolBar->IsKindOf( RUNTIME_CLASS(CExtPanelControlBar) )
- || ( ( pToolBar->m_pDockSite == NULL || pToolBar->m_bPresubclassDialogMode )
- && (! pToolBar->m_bForceBalloonGradientInDialogs )
- )
- )
- return; // if dockbar-like background style
- pToolBar->GetWindowRect( &rcPaintGradient );
- pToolBar->ScreenToClient( &rcPaintGradient );
- int nIdxClrTbFillMargin = -1;
- CRgn _rgnBaloonRight, _rgnBaloonLeft, _rgnBaloonSet;
- CSize _sizeRoundedAreaMerics = FixedBar_GetRoundedAreaMerics();
- if( g_PaintManager.m_bIsWin9x )
- { // region fix for Win9x
- if( _sizeRoundedAreaMerics.cx > 0
- && _sizeRoundedAreaMerics.cx <= 4
- )
- _sizeRoundedAreaMerics.cx +=
- __WIN9X_FIXED_BAR_ROUNDED_AREA_ADJUST_X;
- if( _sizeRoundedAreaMerics.cy > 0
- && _sizeRoundedAreaMerics.cy <= 4
- )
- _sizeRoundedAreaMerics.cy +=
- __WIN9X_FIXED_BAR_ROUNDED_AREA_ADJUST_Y;
- } // region fix for Win9x
- if( _sizeRoundedAreaMerics.cx > 0
- && _sizeRoundedAreaMerics.cy > 0
- && pToolBar->IsDocked()
- )
- { // if balloon style
- nIdxClrTbFillMargin = m_nIdxClrTbFillMargin;
- if( pToolBar->IsBarWithGripper() )
- {
- if( _rgnBaloonRight.CreateRoundRectRgn(
- 0,
- 0,
- rcClient.right - rcClient.left,
- rcClient.bottom - rcClient.top,
- _sizeRoundedAreaMerics.cx,
- _sizeRoundedAreaMerics.cy
- )
- && _rgnBaloonLeft.CreateRectRgn(
- 0,
- 0,
- bHorz
- ? (_sizeRoundedAreaMerics.cx + 2)
- : (rcClient.right - rcClient.left - 1),
- bHorz
- ? (rcClient.bottom - rcClient.top - 1)
- : (_sizeRoundedAreaMerics.cy + 2)
- )
- && _rgnBaloonSet.CreateRectRgn( 0, 0, 1, 1 )
- && _rgnBaloonSet.CombineRgn(
- &_rgnBaloonLeft,
- &_rgnBaloonRight,
- RGN_OR
- ) != ERROR
- )
- dc.SelectClipRgn( &_rgnBaloonSet );
- #ifdef _DEBUG
- else
- {
- ASSERT( FALSE );
- }
- #endif // _DEBUG
- } // if( pToolBar->IsBarWithGripper() )
- else
- {
- if( _rgnBaloonSet.CreateRoundRectRgn(
- 0,
- 0,
- (rcClient.right - rcClient.left - 1),
- (rcClient.bottom - rcClient.top - 1),
- _sizeRoundedAreaMerics.cx,
- _sizeRoundedAreaMerics.cy
- )
- )
- {
- dc.SelectClipRgn( &_rgnBaloonSet );
- }
- #ifdef _DEBUG
- else
- {
- ASSERT( FALSE );
- }
- #endif // _DEBUG
- } // else from if( pToolBar->IsBarWithGripper() )
- } // if balloon style
- OnPaintToolBarGradient( dc, rcPaintGradient, bHorz, pHelperSrc, lParam );
- if( nIdxClrTbFillMargin >= 0 )
- {
- CPen _pen( PS_SOLID, 1, GetColor( m_nIdxClrTbFillMargin, pHelperSrc, lParam ) );
- CPen * pOldPen = dc.SelectObject( &_pen );
- CRect rcClient;
- pToolBar->GetClientRect( &rcClient );
- if( bHorz )
- {
- dc.MoveTo( rcClient.left, rcClient.bottom - 2 );
- dc.LineTo( rcClient.right, rcClient.bottom - 2 );
- } // if( bHorz )
- else
- {
- dc.MoveTo( rcClient.right - 2, rcClient.top );
- dc.LineTo( rcClient.right - 2, rcClient.bottom );
- } // else from if( bHorz )
- dc.SelectObject( pOldPen );
- } // if( nIdxClrTbFillMargin >= 0 )
- if( _rgnBaloonSet.GetSafeHandle() != NULL )
- dc.SelectClipRgn( NULL );
- }
- void CExtPaintManagerNativeXP::PaintControlBarClientArea(
- CDC & dc,
- const RECT & rcClient,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ::IsRectEmpty( &rcClient ) || ( ! dc.RectVisible( &rcClient ) ) )
- return;
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- CExtPaintManager::PaintControlBarClientArea( dc, rcClient, pHelperSrc, lParam );
- return;
- } // if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ( ((CExtToolControlBar*)pHelperSrc)->m_bForceNoBalloonWhenRedockable )
- && RenderCustomBackground( true, dc, pHelperSrc, lParam )
- )
- return;
- bool bRebarDrawingStyle = false;
- CExtControlBar * pWnd = DYNAMIC_DOWNCAST( CExtControlBar, pHelperSrc );
- if( pWnd != NULL )
- {
- ASSERT_VALID( pWnd );
- if( pWnd->m_pDockBar->GetSafeHwnd() != NULL )
- {
- ASSERT_VALID( pWnd->m_pDockBar );
- if( pWnd->IsFixedDockStyle() && ( ! pWnd->IsFloating() ) )
- bRebarDrawingStyle = true;
- }
- }
- if( bRebarDrawingStyle )
- {
- CRect rcPaint;
- pWnd->m_pDockBar->GetWindowRect( &rcPaint );
- pWnd->ScreenToClient( &rcPaint );
- if( g_PaintManager.m_UxTheme.OpenThemeData( pWnd->GetSafeHwnd(), VSCLASS_REBAR ) != NULL )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pWnd->GetSafeHwnd(),
- dc.GetSafeHdc(),
- 0,
- 0,
- &rcPaint,
- &rcPaint
- ) == S_OK
- );
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- }
- else
- dc.FillSolidRect( &rcClient, ::GetSysColor( COLOR_3DFACE ) );
- }
- void CExtPaintManagerOffice2003::OnPaintToolBarGradient(
- CDC & dc,
- CRect rcPaintGradient,
- bool bHorz,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- COLORREF clrLeft, // = COLORREF(-1L)
- COLORREF clrRight // = COLORREF(-1L)
- ) const
- {
- ASSERT_VALID( this );
- if( clrLeft != COLORREF(-1L) && clrRight != COLORREF(-1L) )
- stat_PaintGradientRect( dc, rcPaintGradient, clrLeft, clrRight, bHorz );
- else
- {
- CExtPaintManagerOffice2003 * pThis = const_cast < CExtPaintManagerOffice2003 * > ( this );
- if( OnQueryUseThemeColors() )
- {
- // if use WinXP themed colors
- COLORREF clrLeft = pThis->GetColor( _2003CLR_TOOLBAR_GRADIENT_LIGHT, pHelperSrc, lParam );
- COLORREF clrMiddle = pThis->GetColor( _2003CLR_TOOLBAR_GRADIENT_MIDDLE, pHelperSrc, lParam );
- COLORREF clrRight = pThis->GetColor( _2003CLR_TOOLBAR_GRADIENT_DARK, pHelperSrc, lParam );
- stat_PaintGradientRect2steps( dc, rcPaintGradient, clrLeft, clrMiddle, clrRight, bHorz, 5, 11 );
- } // if( OnQueryUseThemeColors() )
- else
- {
- clrLeft = bHorz
- ? pThis->GetColor( _2003CLR_MLA_NORM_RIGHT, pHelperSrc, lParam )
- : pThis->GetColor( _2003CLR_MLA_NORM_LEFT, pHelperSrc, lParam );
- clrRight = bHorz
- ? pThis->GetColor( _2003CLR_MLA_NORM_LEFT, pHelperSrc, lParam )
- : pThis->GetColor( _2003CLR_MLA_NORM_RIGHT, pHelperSrc, lParam );
- stat_PaintGradientRect( dc, rcPaintGradient, clrLeft, clrRight, bHorz );
- } // else from if( OnQueryUseThemeColors() )
- } // else from if( clrLeft != COLORREF(-1L) && clrRight != COLORREF(-1L) )
- }
- void CExtPaintManagerOffice2003::PaintDockBarClientArea(
- CDC & dc,
- const RECT & rcClient,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ::IsRectEmpty( &rcClient )
- || ( ! dc.RectVisible( &rcClient ) )
- )
- return;
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintDockBarClientArea(
- dc,
- rcClient,
- pHelperSrc,
- lParam
- );
- return;
- }
- CRect rcPaintGradient( 0, 0, 0, 0 );
- CExtDockOuterBar * pOuterDocker = NULL;
- if( pHelperSrc != NULL )
- {
- pOuterDocker =
- DYNAMIC_DOWNCAST(
- CExtDockOuterBar,
- pHelperSrc
- );
- if( pOuterDocker != NULL )
- {
- CFrameWnd * pFrame =
- pOuterDocker->GetParentFrame();
- ASSERT_VALID( pFrame );
- pFrame->GetClientRect( &rcPaintGradient );
- pFrame->ClientToScreen( &rcPaintGradient );
- pOuterDocker->ScreenToClient( &rcPaintGradient );
- if( ::IsRectEmpty( &rcPaintGradient )
- || ( ! dc.RectVisible( &rcPaintGradient ) )
- )
- return;
- }
- }
- if( pOuterDocker == NULL
- || ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8
- )
- {
- CExtPaintManagerXP::PaintDockBarClientArea(
- dc,
- rcClient,
- pHelperSrc,
- lParam
- );
- return;
- }
- if( RenderCustomBackground(
- true,
- dc,
- pHelperSrc,
- lParam
- )
- )
- return;
- PaintDockerBkgnd(
- true,
- dc,
- rcPaintGradient,
- rcClient
- );
- }
- void CExtPaintManagerNativeXP::PaintDockBarClientArea(
- CDC & dc,
- const RECT & rcClient,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ::IsRectEmpty( &rcClient ) || ( ! dc.RectVisible( &rcClient ) ) )
- return;
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- CExtPaintManager::PaintDockBarClientArea( dc, rcClient, pHelperSrc, lParam );
- return;
- } // if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- if( RenderCustomBackground( true, dc, pHelperSrc, lParam ) )
- return;
- HWND hWnd = NULL;
- CWnd * pWnd = DYNAMIC_DOWNCAST( CWnd, pHelperSrc );
- if( pWnd != NULL )
- {
- ASSERT_VALID( pWnd );
- hWnd = pWnd->GetSafeHwnd();
- }
- if( g_PaintManager.m_UxTheme.OpenThemeData( hWnd, VSCLASS_REBAR ) != NULL )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- hWnd,
- dc.GetSafeHdc(),
- 0,
- 0,
- &rcClient,
- &rcClient
- ) == S_OK
- );
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- }
- CExtPaintManager::PAINTDOCKINGFRAMEDATA::PAINTDOCKINGFRAMEDATA()
- : m_pHelperSrc( NULL )
- , m_lParam( 0L )
- , m_rcWindow( 0,0,0,0 )
- , m_rcClient( 0,0,0,0 )
- , m_bActive( false )
- , m_bFloating( false )
- , m_bExtBar( false )
- , m_bSideBar( false )
- {
- }
- CExtPaintManager::PAINTDOCKINGFRAMEDATA::PAINTDOCKINGFRAMEDATA(
- CObject * pHelperSrc,
- const RECT & rcWindow,
- const RECT & rcClient,
- bool bActive,
- bool bFloating,
- bool bExtBar,
- bool bSideBar // = false
- )
- : m_pHelperSrc( pHelperSrc )
- , m_lParam( 0L )
- , m_rcWindow( rcWindow )
- , m_rcClient( rcClient )
- , m_bActive( bActive )
- , m_bFloating( bFloating )
- , m_bExtBar( bExtBar )
- , m_bSideBar( bSideBar )
- {
- }
- void CExtPaintManager::PaintDockingFrame(
- CDC & dc,
- CExtPaintManager::PAINTDOCKINGFRAMEDATA & _pdfd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( _pdfd.m_rcWindow.IsRectEmpty() )
- return;
- dc.ExcludeClipRect( _pdfd.m_rcClient );
- CRect rcWnd( _pdfd.m_rcWindow );
- COLORREF clr3dFace = GetColor( CLR_3DFACE_OUT, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- COLORREF clr3dHilight = GetColor( CLR_3DHILIGHT_OUT, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- COLORREF clr3dShadow = GetColor( CLR_3DSHADOW_OUT, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- COLORREF clr3dDkShadow = GetColor( CLR_3DDKSHADOW_OUT, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- if( _pdfd.m_pHelperSrc != NULL
- && _pdfd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ( ((CExtToolControlBar*)_pdfd.m_pHelperSrc)->m_pDockSite != NULL )
- && ( ((CExtToolControlBar*)_pdfd.m_pHelperSrc)->m_bForceNoBalloonWhenRedockable )
- )
- return;
- dc.FillSolidRect(
- &rcWnd,
- clr3dFace
- );
- if( _pdfd.m_bFloating )
- {
- dc.Draw3dRect(
- &rcWnd, clr3dFace, clr3dDkShadow);
- rcWnd.DeflateRect(1,1);
- dc.Draw3dRect(
- &rcWnd, clr3dHilight, clr3dShadow);
- }
- else
- {
- if( !_pdfd.m_bExtBar )
- {
- dc.Draw3dRect(
- &rcWnd, clr3dHilight, clr3dShadow);
- }
- }
- dc.IntersectClipRect( _pdfd.m_rcWindow );
- }
- void CExtPaintManagerXP::PaintDockingFrame(
- CDC & dc,
- CExtPaintManager::PAINTDOCKINGFRAMEDATA & _pdfd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( _pdfd.m_rcWindow.IsRectEmpty() )
- return;
- dc.ExcludeClipRect( _pdfd.m_rcClient );
- CRect rcWnd( _pdfd.m_rcWindow );
- COLORREF clr3dFace = GetColor( COLOR_3DFACE, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- COLORREF clrDark = GetColor( COLOR_3DSHADOW, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- COLORREF clrBkOld = dc.GetBkColor();
- COLORREF clrBkNew =
- GetColor(
- ( _pdfd.m_bFloating )
- ? ( _pdfd.m_bExtBar
- ? XPCLR_3DFACE_FLOAT_R
- : XPCLR_3DFACE_FLOAT_F
- )
- : CLR_3DFACE_OUT
- ,
- _pdfd.m_pHelperSrc,
- _pdfd.m_lParam
- );
- if( _pdfd.m_bFloating )
- {
- dc.Draw3dRect( &rcWnd, clrDark, clrDark);
- rcWnd.DeflateRect(1,1);
- dc.Draw3dRect( &rcWnd, clrDark, clrDark);
- rcWnd.DeflateRect(1,1);
- dc.Draw3dRect( &rcWnd, clrBkNew, clrBkNew);
- rcWnd.DeflateRect(0,0,1,1);
- dc.SetPixel( rcWnd.left, rcWnd.top, clrDark );
- dc.SetPixel( rcWnd.left, rcWnd.bottom, clrDark );
- dc.SetPixel( rcWnd.right, rcWnd.top, clrDark );
- dc.SetPixel( rcWnd.right, rcWnd.bottom, clrDark );
- } // if( _pdfd.m_bFloating )
- else
- {
- if( _pdfd.m_pHelperSrc != NULL
- && _pdfd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ( ((CExtToolControlBar*)_pdfd.m_pHelperSrc)->m_pDockSite != NULL )
- && ( ((CExtToolControlBar*)_pdfd.m_pHelperSrc)->m_bForceNoBalloonWhenRedockable )
- )
- return;
- dc.FillSolidRect( &rcWnd, clrBkNew );
- if( ! _pdfd.m_bExtBar )
- dc.Draw3dRect( &rcWnd, clr3dFace, clr3dFace);
- if( _pdfd.m_pHelperSrc != NULL
- && _pdfd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && (!_pdfd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) ))
- && IsHighContrast()
- )
- {
- CExtToolControlBar * pBar =
- STATIC_DOWNCAST( CExtToolControlBar, _pdfd.m_pHelperSrc );
- ASSERT_VALID( pBar );
- if( ! pBar->IsFloating() )
- {
- COLORREF clrOldText =
- dc.SetTextColor( GetColor( COLOR_3DSHADOW, _pdfd.m_pHelperSrc, _pdfd.m_lParam ) );
- dc.DrawFocusRect( &rcWnd );
- dc.SetTextColor( clrOldText );
- }
- }
- if( (!_pdfd.m_bSideBar)
- && (::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8 )
- )
- {
- static WORD hatchBits[8] =
- {
- 0xAA,
- 0x55,
- 0xAA,
- 0x55,
- 0xAA,
- 0x55,
- 0xAA,
- 0x55,
- };
- CBrush br;
- CBitmap bmp;
- bmp.CreateBitmap( 8, 8, 1, 1, hatchBits );
- br.CreatePatternBrush( &bmp );
- LOGBRUSH lbr;
- br.GetLogBrush( &lbr );
- HPEN hPenDesired =
- ::ExtCreatePen(
- PS_GEOMETRIC,
- 1,
- &lbr,
- 0,
- NULL
- );
- if( hPenDesired == NULL )
- {
- COLORREF clrDesiredSolidPen =
- GetColor( COLOR_3DSHADOW, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
- hPenDesired =
- ::CreatePen(
- PS_SOLID,
- 1,
- clrDesiredSolidPen
- );
- if( hPenDesired == NULL )
- {
- hPenDesired = (HPEN)
- ::GetStockObject(BLACK_PEN);
- ASSERT( hPenDesired != NULL );
- } // if( hPenDesired == NULL )
- } // if( hPenDesired == NULL )
- // CPen pen( PS_GEOMETRIC, 1, &lbr );
- CPen pen;
- VERIFY( pen.Attach( hPenDesired ) );
- CPen * pOldPen = dc.SelectObject( &pen );
- if( m_bHelperXpStyle8BitBarRect )
- {
- dc.MoveTo( rcWnd.left, rcWnd.top );
- dc.LineTo( rcWnd.right-1, rcWnd.top );
- dc.LineTo( rcWnd.right-1, rcWnd.bottom-1 );
- dc.LineTo( rcWnd.left, rcWnd.bottom-1 );
- dc.LineTo( rcWnd.left, rcWnd.top );
- } // if( m_bHelperXpStyle8BitBarRect )
- else
- {
- static const SIZE g_sizeRO = { 2, 2 };
- dc.MoveTo( rcWnd.left+g_sizeRO.cx, rcWnd.top );
- dc.LineTo( rcWnd.right-1-g_sizeRO.cx, rcWnd.top );
- dc.LineTo( rcWnd.right-1, rcWnd.top+g_sizeRO.cy );
- dc.LineTo( rcWnd.right-1, rcWnd.bottom-1-g_sizeRO.cy );
- dc.LineTo( rcWnd.right-1-g_sizeRO.cx, rcWnd.bottom-1 );
- dc.LineTo( rcWnd.left+g_sizeRO.cx, rcWnd.bottom-1 );
- dc.LineTo( rcWnd.left, rcWnd.bottom-1-g_sizeRO.cy );
- dc.LineTo( rcWnd.left, rcWnd.top+g_sizeRO.cy );
- dc.LineTo( rcWnd.left+g_sizeRO.cx, rcWnd.top );
- } // else from if( m_bHelperXpStyle8BitBarRect )
- dc.SelectObject( pOldPen );
- } // if( !_pdfd.m_bSideBar && ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) < 8 )
- } // else from if( _pdfd.m_bFloating )
- dc.SetBkColor( clrBkOld );
- //dc.IntersectClipRect(rectWindow);
- dc.SelectClipRgn(NULL);
- }
- void CExtPaintManagerOffice2003::PaintDockingFrame(
- CDC & dc,
- CExtPaintManager::PAINTDOCKINGFRAMEDATA & _pdfd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( _pdfd.m_rcWindow.IsRectEmpty() )
- return;
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintDockingFrame( dc, _pdfd );
- return;
- }
- if( _pdfd.m_bFloating
- //|| (!_pdfd.m_bExtBar)
- //|| _pdfd.m_bSideBar
- || _pdfd.m_pHelperSrc == NULL
- || (! _pdfd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtControlBar) ) )
- || ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8
- )
- {
- CExtPaintManagerXP::PaintDockingFrame(
- dc,
- _pdfd
- );
- return;
- }
- }
- void CExtPaintManagerNativeXP::PaintDockingFrame(
- CDC & dc,
- CExtPaintManager::PAINTDOCKINGFRAMEDATA & _pdfd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( _pdfd.m_rcWindow.IsRectEmpty() )
- return;
- if( _pdfd.m_pHelperSrc != NULL
- && _pdfd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ( ((CExtToolControlBar*)_pdfd.m_pHelperSrc)->m_pDockSite != NULL )
- && ( ((CExtToolControlBar*)_pdfd.m_pHelperSrc)->m_bForceNoBalloonWhenRedockable )
- )
- return;
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- CExtPaintManager::PaintDockingFrame(
- dc,
- _pdfd
- );
- return;
- } // if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- CWnd * pWnd =
- DYNAMIC_DOWNCAST(
- CWnd,
- _pdfd.m_pHelperSrc
- );
- ASSERT( pWnd != NULL );
- ASSERT_VALID( pWnd );
- CRect rcWnd( _pdfd.m_rcWindow );
- dc.ExcludeClipRect( _pdfd.m_rcClient );
- dc.FillSolidRect(
- &rcWnd,
- ::GetSysColor( COLOR_3DFACE )
- );
- bool bRebarDrawingStyle = false;
- CExtControlBar * pCB =
- DYNAMIC_DOWNCAST(
- CExtControlBar,
- _pdfd.m_pHelperSrc
- );
- if( pCB != NULL )
- {
- ASSERT_VALID( pCB );
- if( pCB->m_pDockBar->GetSafeHwnd() != NULL )
- {
- ASSERT_VALID( pCB->m_pDockBar );
- if( pCB->IsFixedDockStyle()
- && (!pCB->IsFloating())
- )
- bRebarDrawingStyle = true;
- }
- }
- if( bRebarDrawingStyle
- && (!_pdfd.m_bFloating)
- && (!_pdfd.m_bExtBar)
- )
- {
- CRect rcPaint;
- pCB->m_pDockBar->GetWindowRect( &rcPaint );
- pCB->ScreenToClient( &rcPaint );
- CRect rcAdjust( 0, 0, 0, 0 );
- FixedBar_AdjustClientRect(
- pCB,
- rcAdjust
- );
- rcPaint.DeflateRect( &rcAdjust );
- if( g_PaintManager.m_UxTheme.OpenThemeData( pCB->GetSafeHwnd(), VSCLASS_REBAR ) != NULL )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pCB->GetSafeHwnd(),
- dc.GetSafeHdc(),
- 0,
- 0,
- &rcPaint,
- &rcPaint
- ) == S_OK
- );
- COLORREF clrEdgeShadow = COLORREF( -1L );
- VERIFY(
- g_PaintManager.m_UxTheme.GetThemeColor(
- RP_BAND,
- 0,
- TMT_EDGESHADOWCOLOR,
- &clrEdgeShadow
- ) == S_OK
- );
- if( clrEdgeShadow != COLORREF( -1L ) )
- {
- dc.Draw3dRect(
- &rcWnd,
- ::GetSysColor( COLOR_BTNHIGHLIGHT ),
- clrEdgeShadow
- );
- }
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- }
- if( _pdfd.m_bFloating )
- {
- if( g_PaintManager.m_UxTheme.OpenThemeData( pCB->GetSafeHwnd(), VSCLASS_WINDOW ) != NULL )
- {
- // !!! TODO
- // _pdfd.m_bActive = true;
- // !!! TODO
- INT nStateID =
- _pdfd.m_bActive
- ? FS_ACTIVE
- : FS_INACTIVE;
- CRect rcNcLeft( _pdfd.m_rcWindow );
- rcNcLeft.right = _pdfd.m_rcClient.left;
- if( rcNcLeft.Width() > 0 )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pCB->GetSafeHwnd(),
- dc.GetSafeHdc(),
- WP_SMALLFRAMELEFT,
- nStateID,
- &rcNcLeft,
- &rcNcLeft
- ) == S_OK
- );
- }
-
- CRect rcNcRight( _pdfd.m_rcWindow );
- rcNcRight.left = _pdfd.m_rcClient.right;
- if( rcNcRight.Width() > 0 )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pCB->GetSafeHwnd(),
- dc.GetSafeHdc(),
- WP_SMALLFRAMERIGHT,
- nStateID,
- &rcNcRight,
- &rcNcRight
- ) == S_OK
- );
- }
- CRect rcNcTop( _pdfd.m_rcWindow );
- rcNcTop.bottom = _pdfd.m_rcClient.top;
- if( rcNcTop.Height() > 0 )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pCB->GetSafeHwnd(),
- dc.GetSafeHdc(),
- WP_SMALLCAPTION,
- _pdfd.m_bActive
- ? CS_ACTIVE
- : CS_INACTIVE,
- &rcNcTop,
- &rcNcTop
- ) == S_OK
- );
- }
- CRect rcNcBottom( _pdfd.m_rcWindow );
- rcNcBottom.top = _pdfd.m_rcClient.bottom;
- if( rcNcBottom.Height() > 0 )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pCB->GetSafeHwnd(),
- dc.GetSafeHdc(),
- WP_SMALLFRAMEBOTTOM,
- nStateID,
- &rcNcBottom,
- &rcNcBottom
- ) == S_OK
- );
- }
- } // if( g_PaintManager.m_UxTheme.OpenThemeData ...
- } // if( _pdfd.m_bFloating )
- dc.IntersectClipRect( _pdfd.m_rcWindow );
- }
- CExtPaintManager::PAINTGRIPPERDATA::PAINTGRIPPERDATA()
- : m_pHelperSrc( NULL )
- , m_lParam( 0L )
- , m_rcGripper( 0,0,0,0 )
- , m_rcText( 0,0,0,0 )
- , m_bActive( false )
- , m_bFloating( false )
- , m_bHorz( false )
- , m_bSideBar( false )
- , m_sCaption( _T("") )
- , m_bHelperNoRect( false )
- , m_bHelperNoFill( false )
- , m_bForceRTL( false )
- , m_bFlashCaptionHighlightedState( false )
- , m_clrFlashCaptionText( COLORREF(-1L) )
- , m_clrFlashCaptionBackground( COLORREF(-1L) )
- {
- }
- CExtPaintManager::PAINTGRIPPERDATA::PAINTGRIPPERDATA(
- CObject * pHelperSrc,
- const RECT & rcGripper,
- const RECT & rcText,
- bool bActive,
- bool bFloating,
- bool bHorz,
- bool bSideBar, // = false
- __EXT_MFC_SAFE_LPCTSTR sCaption, // = NULL
- bool bForceRTL // = false
- )
- : m_pHelperSrc( pHelperSrc )
- , m_lParam( 0L )
- , m_rcGripper( rcGripper )
- , m_rcText( rcText )
- , m_bActive( bActive )
- , m_bFloating( bFloating )
- , m_bHorz( bHorz )
- , m_bSideBar( bSideBar )
- , m_sCaption( (sCaption == NULL) ? _T("") : sCaption )
- , m_bHelperNoRect( false )
- , m_bHelperNoFill( false )
- , m_bForceRTL( bForceRTL )
- , m_bFlashCaptionHighlightedState( false )
- , m_clrFlashCaptionText( COLORREF(-1L) )
- , m_clrFlashCaptionBackground( COLORREF(-1L) )
- {
- }
- void CExtPaintManager::PaintGripper(
- CDC & dc,
- CExtPaintManager::PAINTGRIPPERDATA & _pgd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CRect rectGripper2( _pgd.m_rcGripper );
- COLORREF clrBtnShadow = GetColor( CLR_3DSHADOW_OUT, _pgd.m_pHelperSrc, _pgd.m_lParam );
- COLORREF clrBtnHilight = GetColor( CLR_3DHILIGHT_OUT, _pgd.m_pHelperSrc, _pgd.m_lParam );
- if( _pgd.m_bSideBar || _pgd.m_bFloating )
- {
- if( ! _pgd.m_bFloating )
- rectGripper2.DeflateRect( 1, 1 );
- #if (defined COLOR_GRADIENTACTIVECAPTION && defined COLOR_GRADIENTACTIVECAPTION)
- ASSERT( COLOR_GRADIENTACTIVECAPTION == 27 );
- ASSERT( COLOR_GRADIENTINACTIVECAPTION == 28 );
- #endif
- INT nTextColorIndex = COLOR_HIGHLIGHTTEXT;
- if( _pgd.m_bFlashCaptionHighlightedState )
- {
- ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
- ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
- dc.FillSolidRect(
- rectGripper2,
- _pgd.m_clrFlashCaptionBackground
- );
- } // if( _pgd.m_bFlashCaptionHighlightedState )
- else if( _pgd.m_bSideBar )
- {
- #ifdef __FREIWALD_ORIGINAL__
- if( _pgd.m_bFloating || _pgd.m_bActive )
- #else
- /*
- // draw an active gripper only,
- // when the bar actually has the focus
- // (and not, whenever it is floating)
- */
- if (_pgd.m_bActive)
- #endif
- {
- nTextColorIndex = COLOR_CAPTIONTEXT;
- if( !_pgd.m_bHelperNoFill )
- {
- if( stat_GetBPP() > 8 )
- {
- COLORREF clrLeft =
- GetColor( COLOR_ACTIVECAPTION, _pgd.m_pHelperSrc, _pgd.m_lParam );
- COLORREF clrRight =
- GetColor( 27, _pgd.m_pHelperSrc, _pgd.m_lParam );
- if( (!_pgd.m_bHorz) && _pgd.m_bForceRTL )
- {
- COLORREF clrTemp = clrLeft;
- clrLeft = clrRight;
- clrRight = clrTemp;
- } // if( (!_pgd.m_bHorz) && _pgd.m_bForceRTL )
- stat_PaintGradientRect(
- dc,
- rectGripper2,
- clrLeft,
- clrRight,
- _pgd.m_bHorz
- );
- } // if( stat_GetBPP() > 8 )
- else
- {
- dc.FillSolidRect(
- rectGripper2,
- GetColor( COLOR_ACTIVECAPTION, _pgd.m_pHelperSrc, _pgd.m_lParam )
- );
- } // else from if( stat_GetBPP() > 8 )
- } // if( !_pgd.m_bHelperNoFill )
- }
- else
- {
- nTextColorIndex = COLOR_INACTIVECAPTIONTEXT;
- if( !_pgd.m_bHelperNoFill )
- {
- if( stat_GetBPP() > 8 )
- {
- COLORREF clrLeft =
- GetColor( COLOR_INACTIVECAPTION, _pgd.m_pHelperSrc, _pgd.m_lParam );
- COLORREF clrRight =
- GetColor( 28, _pgd.m_pHelperSrc, _pgd.m_lParam );
- if( (!_pgd.m_bHorz) && _pgd.m_bForceRTL )
- {
- COLORREF clrTemp = clrLeft;
- clrLeft = clrRight;
- clrRight = clrTemp;
- } // if( (!_pgd.m_bHorz) && _pgd.m_bForceRTL )
- stat_PaintGradientRect(
- dc,
- rectGripper2,
- clrLeft,
- clrRight,
- _pgd.m_bHorz
- );
- } // if( stat_GetBPP() > 8 )
- else
- {
- dc.FillSolidRect(
- rectGripper2,
- GetColor( COLOR_INACTIVECAPTION, _pgd.m_pHelperSrc, _pgd.m_lParam )
- );
- } // else from if( stat_GetBPP() > 8 )
- } // if( !_pgd.m_bHelperNoFill )
- }
- } // else if( _pgd.m_bSideBar )
- else
- {
- dc.FillSolidRect(
- rectGripper2,
- GetColor( COLOR_HIGHLIGHT, _pgd.m_pHelperSrc, _pgd.m_lParam )
- );
- } // else from if( _pgd.m_bSideBar )
- int nTextLen = 0;
- if( _pgd.m_sCaption != NULL
- && ( nTextLen = int(_tcslen(_pgd.m_sCaption)) ) > 0
- && (! _pgd.m_rcText.IsRectEmpty() )
- && _pgd.m_rcText.right > _pgd.m_rcText.left
- && _pgd.m_rcText.bottom > _pgd.m_rcText.top
- )
- {
- COLORREF clrText =
- _pgd.m_bFlashCaptionHighlightedState
- ? _pgd.m_clrFlashCaptionText
- : GetColor( nTextColorIndex, _pgd.m_pHelperSrc, _pgd.m_lParam );
- COLORREF clrOldText = dc.SetTextColor(clrText);
- int nOldBkMode = dc.SetBkMode( TRANSPARENT );
- CFont * pCurrFont =
- ( _pgd.m_bSideBar && (!_pgd.m_bFloating) )
- ? (
- (!_pgd.m_bHorz) ?
- &m_FontNormalBC : &m_FontNormalVertXBC
- )
- : (
- (!_pgd.m_bHorz) ?
- &m_FontBoldBC : &m_FontBoldVertXBC
- )
- ;
- CFont * pOldFont =
- dc.SelectObject( pCurrFont );
- ASSERT( pOldFont != NULL );
- if( ! _pgd.m_bHorz )
- { // if text is horizontal
- UINT nDtAlign = _pgd.m_bForceRTL ? DT_RIGHT : DT_LEFT;
- bool bFloatingFixedBar = false;
- if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
- {
- CExtControlBar * pBar =
- ((CExtMiniDockFrameWnd *)_pgd.m_pHelperSrc)->GetControlBarExt();
- if( pBar != NULL
- && pBar->IsFixedMode()
- )
- bFloatingFixedBar = true;
- }
- if( bFloatingFixedBar )
- {
- CExtSafeString sCaption( _pgd.m_sCaption );
- INT nAvailableWidth = _pgd.m_rcText.Width();
- for(;;)
- {
- INT nWidth =
- stat_CalcTextWidth(
- dc,
- *pCurrFont,
- sCaption
- );
- if( nAvailableWidth >= nWidth
- || sCaption.IsEmpty()
- )
- break;
- sCaption.Delete( sCaption.GetLength() - 1 );
- }
- if( sCaption.GetLength() > 0 )
- dc.DrawText(
- sCaption,
- sCaption.GetLength(),
- (LPRECT)&_pgd.m_rcText,
- nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_NOCLIP
- );
- } // if( bFloatingFixedBar )
- else
- {
- dc.DrawText(
- _pgd.m_sCaption,
- nTextLen,
- (LPRECT)&_pgd.m_rcText,
- nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS
- );
- } // else if( bFloatingFixedBar )
- } // if text is horizontal
- else
- { // if text is vertical
- LOGFONT lf;
- ::memset(&lf,0,sizeof(LOGFONT));
- pCurrFont->GetLogFont(&lf);
- int _cyHorzFont = abs(lf.lfHeight);
- int _cyTextMargin =
- (_pgd.m_rcText.Width() - _cyHorzFont) / 2
- ;
- CRect rcString =
- CRect(
- CPoint(
- _pgd.m_rcText.left + _cyTextMargin - __ExtMfc_CXTEXTMARGIN,
- _pgd.m_rcText.bottom - __ExtMfc_CYTEXTMARGIN
- ),
- _pgd.m_rcText.Size() //m_sizeHorz
- );
- rcString.DeflateRect(2,2);
- CRect rcExclude;
- rcExclude.SetRect(
- _pgd.m_rcGripper.left,
- _pgd.m_rcGripper.top,
- _pgd.m_rcGripper.right,
- _pgd.m_rcText.top
- );
- dc.ExcludeClipRect( &rcExclude );
- rcString.OffsetRect( -2, -3 );
- dc.DrawText(
- _pgd.m_sCaption,
- nTextLen,
- rcString,
- DT_SINGLELINE //|DT_CENTER|DT_VCENTER
- |DT_NOCLIP |DT_NOPREFIX
- ); // don't forget DT_NOCLIP
- //dc.IntersectClipRect( &rectGripper );
- dc.SelectClipRgn(NULL);
- } // if text is vertical
- dc.SelectObject( pOldFont );
- dc.SetBkMode(nOldBkMode);
- dc.SetTextColor(clrOldText);
- }
- } // if( _pgd.m_bSideBar || _pgd.m_bFloating )
- else
- {
- if( _pgd.m_bHorz )
- {
- rectGripper2.DeflateRect( 4, 1, 4, 0 );
- rectGripper2.right = rectGripper2.left + 3;
- dc.Draw3dRect(
- rectGripper2,
- clrBtnHilight,
- clrBtnShadow
- );
- rectGripper2.OffsetRect( 3, 0 );
- dc.Draw3dRect(
- rectGripper2,
- clrBtnHilight,
- clrBtnShadow
- );
- } // if( bHorz )
- else
- {
- rectGripper2.OffsetRect( 1, 0 );
- rectGripper2.DeflateRect( 0, 4, 1, 4 );
- rectGripper2.bottom = rectGripper2.top + 3;
- dc.Draw3dRect(
- rectGripper2,
- clrBtnHilight,
- clrBtnShadow
- );
- rectGripper2.OffsetRect( 0, 3 );
- dc.Draw3dRect(
- rectGripper2,
- clrBtnHilight,
- clrBtnShadow
- );
- } // else from if( bHorz )
- } // else from if( _pgd.m_bSideBar || _pgd.m_bFloating )
- }
- void CExtPaintManagerXP::PaintGripper(
- CDC & dc,
- CExtPaintManager::PAINTGRIPPERDATA & _pgd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CRect rectGripper( _pgd.m_rcGripper );
- if( _pgd.m_bSideBar || _pgd.m_bFloating )
- {
- if( _pgd.m_bFlashCaptionHighlightedState )
- {
- ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
- ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
- dc.FillSolidRect(
- rectGripper,
- _pgd.m_clrFlashCaptionBackground
- );
- } // if( _pgd.m_bFlashCaptionHighlightedState )
- else
- {
- COLORREF clrGrip =
- GetColor(
- _pgd.m_bSideBar
- ? (_pgd.m_bActive ? COLOR_HIGHLIGHT : XPCLR_3DFACE_DARK )
- : COLOR_3DSHADOW
- ,
- _pgd.m_pHelperSrc,
- _pgd.m_lParam
- );
- if( ! _pgd.m_bHelperNoFill )
- dc.FillSolidRect( rectGripper, clrGrip );
- if( _pgd.m_bSideBar
- && (!_pgd.m_bHelperNoFill)
- && (!_pgd.m_bFloating)
- && (!_pgd.m_bActive)
- )
- { // rect border of docked bar caption like VS-.NET-7.0
- COLORREF clrSideRect = GetColor( COLOR_3DSHADOW, _pgd.m_pHelperSrc, _pgd.m_lParam );
- stat_PaintDotNet3dRect(
- dc,
- rectGripper,
- clrSideRect,
- clrSideRect
- );
- } // rect border of docked bar caption like VS-.NET-7.0
- } // else from // if( _pgd.m_bFlashCaptionHighlightedState )
- int nTextLen = 0;
- if( _pgd.m_sCaption != NULL
- && ( nTextLen = int(_tcslen(_pgd.m_sCaption)) ) > 0
- && (! _pgd.m_rcText.IsRectEmpty() )
- && _pgd.m_rcText.right > _pgd.m_rcText.left
- && _pgd.m_rcText.bottom > _pgd.m_rcText.top
- )
- {
- e_paint_manager_name_t ePMN = OnQueryPaintManagerName();
- e_system_theme_t eST = OnQuerySystemTheme();
- COLORREF clrText =
- _pgd.m_bFlashCaptionHighlightedState
- ? _pgd.m_clrFlashCaptionText
- : (
- ( _pgd.m_bActive || (! _pgd.m_bSideBar) )
- ? GetColor(
- ( ( ePMN == Office2003 || ePMN == Studio2005 )
- && (eST == ThemeLunaSilver)
- )
- ? COLOR_WINDOW
- : COLOR_HIGHLIGHTTEXT, // COLOR_CAPTIONTEXT
- _pgd.m_pHelperSrc,
- _pgd.m_lParam
- )
- : GetColor(
- COLOR_BTNTEXT,
- _pgd.m_pHelperSrc,
- _pgd.m_lParam
- )
- );
- COLORREF clrOldText =
- dc.SetTextColor(clrText);
- int nOldBkMode = dc.SetBkMode( TRANSPARENT );
- CFont * pCurrFont =
- (! _pgd.m_bHorz)
- ? ( _pgd.m_bSideBar
- ? &m_FontNormalBC
- : &m_FontBoldBC
- )
- : ( _pgd.m_bSideBar
- ? &m_FontNormalVertXBC
- : &m_FontBoldVertXBC
- )
- ;
- CFont * pOldFont =
- dc.SelectObject( pCurrFont );
- //ASSERT( pOldFont != NULL );
- if( !_pgd.m_bHorz )
- { // if text is horizontal
- bool bFloatingFixedBar = false;
- UINT nDtAlign = _pgd.m_bForceRTL ? DT_RIGHT : DT_LEFT;
- if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
- {
- CExtControlBar * pBar =
- ((CExtMiniDockFrameWnd *)_pgd.m_pHelperSrc)->GetControlBarExt();
- if( pBar != NULL
- && pBar->IsFixedMode()
- )
- bFloatingFixedBar = true;
- }
- if( bFloatingFixedBar )
- {
- CExtSafeString sCaption( _pgd.m_sCaption );
- INT nAvailableWidth = _pgd.m_rcText.Width();
- for(;;)
- {
- INT nWidth =
- stat_CalcTextWidth(
- dc,
- *pCurrFont,
- sCaption
- );
- if( nAvailableWidth >= nWidth
- || sCaption.IsEmpty()
- )
- break;
- sCaption.Delete( sCaption.GetLength() - 1 );
- }
- if( sCaption.GetLength() > 0 )
- dc.DrawText(
- sCaption,
- sCaption.GetLength(),
- (LPRECT)&_pgd.m_rcText,
- nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_NOCLIP
- );
- } // if( bFloatingFixedBar )
- else
- {
- dc.DrawText(
- _pgd.m_sCaption,
- nTextLen,
- (LPRECT)&_pgd.m_rcText,
- nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS
- );
- } // else if( bFloatingFixedBar )
- } // if text is horizontal
- else
- { // if text is vertical
- LOGFONT lf;
- ::memset(&lf,0,sizeof(LOGFONT));
- pCurrFont->GetLogFont(&lf);
- int _cyHorzFont = abs(lf.lfHeight);
- int _cyTextMargin =
- (_pgd.m_rcText.Width() - _cyHorzFont) / 2
- ;
- CRect rcString =
- CRect(
- CPoint(
- _pgd.m_rcText.left + _cyTextMargin - __ExtMfc_CXTEXTMARGIN,
- _pgd.m_rcText.bottom - __ExtMfc_CYTEXTMARGIN
- ),
- _pgd.m_rcText.Size() //m_sizeHorz
- );
- rcString.DeflateRect(2,2);
- CRect rcExclude;
- rcExclude.SetRect(
- _pgd.m_rcGripper.left,
- _pgd.m_rcGripper.top,
- _pgd.m_rcGripper.right,
- _pgd.m_rcText.top
- );
- dc.ExcludeClipRect( &rcExclude );
- rcString.OffsetRect( -2, -3 );
- dc.DrawText(
- _pgd.m_sCaption,
- nTextLen,
- rcString,
- DT_SINGLELINE //|DT_CENTER|DT_VCENTER
- |DT_NOCLIP |DT_NOPREFIX
- ); // don't forget DT_NOCLIP
- //dc.IntersectClipRect( &rectGripper );
- dc.SelectClipRgn(NULL);
- } // if text is vertical
- dc.SelectObject( pOldFont );
- dc.SetBkMode(nOldBkMode);
- dc.SetTextColor(clrOldText);
- }
- } // if( _pgd.m_bSideBar || _pgd.m_bFloating )
- else
- {
- COLORREF clrGrip =
- GetColor( CLR_3DFACE_OUT, _pgd.m_pHelperSrc, _pgd.m_lParam );
- CRect rcGripToClear( _pgd.m_rcGripper );
- rcGripToClear.DeflateRect( 1, 1 );
- if( _pgd.m_pHelperSrc != NULL
- && _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ((CControlBar*)_pgd.m_pHelperSrc)->m_pDockSite != NULL
- && ((CExtToolControlBar*)_pgd.m_pHelperSrc)->m_bForceNoBalloonWhenRedockable
- )
- {
- }
- else
- dc.FillSolidRect(
- rcGripToClear,
- clrGrip
- );
- CPen pen;
- pen.CreatePen(
- PS_SOLID,
- 1,
- GetColor( XPCLR_GRIPPER, _pgd.m_pHelperSrc, _pgd.m_lParam )
- );
- CPen * pOldPen = dc.SelectObject( &pen );
- if( _pgd.m_bHorz )
- {
- rectGripper.DeflateRect( 4, 1, 6, 2 );
- rectGripper.right = rectGripper.left + 5;
- rectGripper.DeflateRect( 1, 0 );
- CRect rcLine( rectGripper );
-
- INT nLineCount = rectGripper.Height() / (1 + 1);
- rcLine.top += rcLine.Height() - (1 + 1) * nLineCount;
- rcLine.bottom = rcLine.top + 1;
- for( INT nLine = 0; nLine < nLineCount; nLine++ )
- {
- dc.MoveTo( rcLine.left, rcLine.top + 1 );
- dc.LineTo( rcLine.right, rcLine.bottom );
- rcLine.OffsetRect( 0, 1 + 1 );
- }
- }
- else
- {
- rectGripper.OffsetRect( 1, 0 );
- rectGripper.DeflateRect( 1, 4, 2, 6 );
- rectGripper.bottom = rectGripper.top + 5;
- rectGripper.DeflateRect( 0, 1 );
- CRect rcLine( rectGripper );
-
- int nLineCount = rectGripper.Width() / (1 + 1);
- rcLine.left += rcLine.Width() - (1 + 1) * nLineCount;
-
- rcLine.right = rcLine.left + 1;
- for( int nLine = 0; nLine < nLineCount; nLine++ )
- {
- dc.MoveTo( rcLine.left + 1, rcLine.top );
- dc.LineTo( rcLine.right, rcLine.bottom );
- rcLine.OffsetRect( 1 + 1, 0 );
- }
- } // else from if( _pgd.m_bHorz )
- dc.SelectObject( pOldPen );
- } // else from if( _pgd.m_bSideBar || _pgd.m_bFloating )
- }
- void CExtPaintManagerOffice2003::PaintGripper(
- CDC & dc,
- CExtPaintManager::PAINTGRIPPERDATA & _pgd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintGripper( dc, _pgd );
- return;
- }
- // if( _pgd.m_pHelperSrc != NULL
- // && _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CWnd) )
- // )
- // PaintDockerBkgnd(
- // false,
- // dc,
- // (CWnd*)_pgd.m_pHelperSrc
- // );
- bool bStyleOffice2003 = true;
- if( _pgd.m_bFloating
- //|| _pgd.m_bSideBar
- || _pgd.m_pHelperSrc == NULL
- || (!(
- _pgd.m_pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtControlBar))
- #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
- || _pgd.m_pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtDynAutoHideSlider))
- #endif
- ))
- || ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8
- )
- bStyleOffice2003 = false;
- CWnd * pBar = NULL;
- bool bForceNoBaloon = false;
- bool bInactiveResizableBarCapt = false;
- #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
- if( bStyleOffice2003
- && _pgd.m_pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtDynAutoHideSlider))
- )
- { // auto-hide slider
- pBar = STATIC_DOWNCAST( CWnd, _pgd.m_pHelperSrc );
- bInactiveResizableBarCapt = true;
- } // auto-hide slider
- else
- #endif
- if( bStyleOffice2003 )
- { // non-dockers
- pBar =
- STATIC_DOWNCAST(
- CWnd,
- _pgd.m_pHelperSrc
- );
- ASSERT_VALID( pBar );
- if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPanelControlBar) ) )
- { // if panel bar
- bForceNoBaloon = true;
- } // if panel bar
- if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
- && ((CControlBar*)_pgd.m_pHelperSrc)->m_pDockSite != NULL
- && ((CExtToolControlBar*)_pgd.m_pHelperSrc)->m_bForceNoBalloonWhenRedockable
- )
- bForceNoBaloon = true;
- if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtControlBar) ) )
- { // if control bar
- if( ((CExtControlBar*)pBar)->m_pDockSite != NULL )
- { // if docked
- if( ((CExtControlBar*)pBar)->IsFloating() )
- bStyleOffice2003 = false;
- } // if docked
- else
- { // if simple
- CExtToolControlBar *pToolBar =
- DYNAMIC_DOWNCAST( CExtToolControlBar, _pgd.m_pHelperSrc );
- if( pToolBar == NULL || ( ! pToolBar->m_bForceBalloonGradientInDialogs ) )
- bForceNoBaloon = true;
- } // if simple
- } // if control bar
- else
- { // if NOT control bar
- bStyleOffice2003 = false;
- } // if NOT control bar
- } // non-dockers
- if( ! bStyleOffice2003 )
- {
- CExtPaintManagerXP::PaintGripper( dc, _pgd );
- return;
- } // if( !bStyleOffice2003 )
- ASSERT_VALID( pBar );
- CRect rcBarWnd, rcBarClient;
- pBar->GetWindowRect( &rcBarWnd );
- pBar->GetClientRect( &rcBarClient );
- pBar->ClientToScreen( &rcBarClient );
- if( _pgd.m_bSideBar || bInactiveResizableBarCapt )
- { // if resizable bar caption
- _pgd.m_bHelperNoFill
- = _pgd.m_bHelperNoRect
- = !_pgd.m_bActive;
- if( _pgd.m_bSideBar )
- bInactiveResizableBarCapt = !_pgd.m_bActive;
- if( bInactiveResizableBarCapt )
- {
- CRect rcHelper( rcBarClient );
- rcHelper.OffsetRect( -rcBarWnd.TopLeft() );
- CRect rcGripper( _pgd.m_rcGripper );
- rcGripper.bottom = rcHelper.top + 4;
- COLORREF clrLeft =
- GetColor( _2003CLR_GRADIENT_LIGHT, _pgd.m_pHelperSrc, _pgd.m_lParam );
- COLORREF clrRight =
- GetColor( _2003CLR_GRADIENT_DARK, _pgd.m_pHelperSrc, _pgd.m_lParam );
- if( _pgd.m_bForceRTL )
- {
- COLORREF clrTemp = clrLeft;
- clrLeft = clrRight;
- clrRight = clrTemp;
- }
- stat_PaintGradientRect(
- dc,
- rcGripper,
- clrLeft,
- clrRight
- );
- } // if( bInactiveResizableBarCapt )
- CExtPaintManagerXP::PaintGripper( dc, _pgd );
- return;
- } // if resizable bar caption
- if( (! pBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar)) )
- && (! bForceNoBaloon )
- )
- { // if toolbar balloon style
- CRect rcPaintGradient( rcBarWnd );
- if( _pgd.m_bHorz )
- {
- rcPaintGradient.top = rcBarClient.top;
- rcPaintGradient.bottom = rcBarClient.bottom; // + 1;
- rcPaintGradient.right = rcBarClient.right;
- rcPaintGradient.OffsetRect(
- -rcPaintGradient.left,
- -rcPaintGradient.top
- + rcBarClient.top - rcBarWnd.top
- );
- } // if( _pgd.m_bHorz )
- else
- {
- rcPaintGradient.left = rcBarClient.left;
- rcPaintGradient.right = rcBarClient.right; // + 1;
- rcPaintGradient.bottom = rcBarClient.bottom;
- rcPaintGradient.OffsetRect(
- -rcPaintGradient.left
- + rcBarClient.left - rcBarWnd.left,
- -rcPaintGradient.top
- );
- } // else from if( _pgd.m_bHorz )
- int nIdxClrTbFillMargin = -1;
- CRgn _rgnBaloonSet;
- const CSize _sizeRoundedAreaMerics =
- FixedBar_GetRoundedAreaMerics();
- if( _sizeRoundedAreaMerics.cx > 0
- && _sizeRoundedAreaMerics.cy > 0
- )
- { // if baloon style
- nIdxClrTbFillMargin = m_nIdxClrTbFillMargin;
- if( _rgnBaloonSet.CreateRoundRectRgn(
- rcPaintGradient.left,
- rcPaintGradient.top,
- rcPaintGradient.Width(),
- rcPaintGradient.Height(),
- _sizeRoundedAreaMerics.cx,
- _sizeRoundedAreaMerics.cy
- )
- )
- {
- dc.SelectClipRgn( &_rgnBaloonSet );
- }
- } // if baloon style
- OnPaintToolBarGradient( dc, rcPaintGradient, _pgd.m_bHorz, _pgd.m_pHelperSrc, _pgd.m_lParam );
- if( nIdxClrTbFillMargin >= 0 )
- {
- CPen _pen( PS_SOLID, 1, GetColor( m_nIdxClrTbFillMargin, _pgd.m_pHelperSrc, _pgd.m_lParam ) );
- CPen * pOldPen = dc.SelectObject( &_pen );
- if( _pgd.m_bHorz )
- {
- dc.MoveTo(
- rcPaintGradient.left,
- rcPaintGradient.bottom-2
- );
- dc.LineTo(
- rcPaintGradient.right,
- rcPaintGradient.bottom-2
- );
- } // if( _pgd.m_bHorz )
- else
- {
- dc.MoveTo(
- rcPaintGradient.right-2,
- rcPaintGradient.top
- );
- dc.LineTo(
- rcPaintGradient.right-2,
- rcPaintGradient.bottom
- );
- } // else from if( _pgd.m_bHorz )
- dc.SelectObject( pOldPen );
- } // if( nIdxClrTbFillMargin >= 0 )
- if( _rgnBaloonSet.GetSafeHandle() != NULL )
- dc.SelectClipRgn( NULL );
- } // if toolbar balloon style
- COLORREF clrDotShadow = GetColor( _2003CLR_GRIPPER_DOT_LIGHT, _pgd.m_pHelperSrc, _pgd.m_lParam );
- COLORREF clrDotFace = GetColor( _2003CLR_GRIPPER_DOT_DARK, _pgd.m_pHelperSrc, _pgd.m_lParam );
- static const CSize g_sizeGripDot( 2, 2 );
- static const CSize g_sizeGripDist( 1, 1 );
- static const CSize g_sizeGripShadowOffset( 1, 1 );
- CRect rcGripHelper( _pgd.m_rcGripper );
- CRect rcBarClientW( rcBarClient );
- rcBarClientW.OffsetRect( -rcBarWnd.TopLeft() );
- if( _pgd.m_bHorz )
- {
- rcGripHelper.top = rcBarClientW.top;
- rcGripHelper.bottom = rcBarClientW.bottom;
- rcGripHelper.OffsetRect( 1, 0 );
- rcGripHelper.left +=
- (rcGripHelper.Width() - g_sizeGripDot.cx) / 2;
- rcGripHelper.right =
- rcGripHelper.left + g_sizeGripDot.cx;
- rcGripHelper.DeflateRect( 0, g_sizeGripDot.cy + g_sizeGripDist.cy + g_sizeGripShadowOffset.cy );
- rcGripHelper.DeflateRect( 0, 1 ); // + 2.27
- rcGripHelper.OffsetRect( 0, -1 ); // + 2.27
- int nDotCount =
- rcGripHelper.Height()
- / (g_sizeGripDot.cy + g_sizeGripDist.cy + g_sizeGripShadowOffset.cy);
- rcGripHelper.top +=
- rcGripHelper.Height()
- - (g_sizeGripDot.cy + g_sizeGripDist.cy + g_sizeGripShadowOffset.cy)
- * nDotCount;
- CRect rcDotFace( rcGripHelper );
- rcDotFace.bottom = rcDotFace.top + g_sizeGripDot.cy;
- CRect rcDotShadow( rcDotFace );
- rcDotShadow.OffsetRect( g_sizeGripShadowOffset );
- for( int nDot = 0; nDot < nDotCount; nDot++ )
- {
- dc.FillSolidRect( &rcDotShadow, clrDotShadow );
- dc.FillSolidRect( &rcDotFace, clrDotFace );
- rcDotFace.OffsetRect( 0, g_sizeGripDot.cy + g_sizeGripDist.cy + g_sizeGripShadowOffset.cy );
- rcDotShadow.OffsetRect( 0, g_sizeGripDot.cy + g_sizeGripDist.cy + g_sizeGripShadowOffset.cy );
- } // for( int nDot = 0; nDot < nDotCount; nDot++ )
- } // if( _pgd.m_bHorz )
- else
- {
- rcGripHelper.left = rcBarClientW.left;
- rcGripHelper.right = rcBarClientW.right;
- rcGripHelper.OffsetRect( 0, 1 );
- rcGripHelper.top +=
- (rcGripHelper.Height() - g_sizeGripDot.cy) / 2;
- rcGripHelper.bottom =
- rcGripHelper.top + g_sizeGripDot.cy;
- rcGripHelper.DeflateRect( g_sizeGripDot.cx + g_sizeGripDist.cx + g_sizeGripShadowOffset.cx, 0 );
- rcGripHelper.OffsetRect( -1, 0 ); // + 2.27
- rcGripHelper.DeflateRect( 1, 0 ); // + 2.27
- int nDotCount =
- rcGripHelper.Width()
- / (g_sizeGripDot.cx + g_sizeGripDist.cx + g_sizeGripShadowOffset.cx);
- rcGripHelper.left +=
- rcGripHelper.Width()
- - (g_sizeGripDot.cx + g_sizeGripDist.cx + g_sizeGripShadowOffset.cx)
- * nDotCount;
- CRect rcDotFace( rcGripHelper );
- rcDotFace.right = rcDotFace.left + g_sizeGripDot.cx;
- CRect rcDotShadow( rcDotFace );
- rcDotShadow.OffsetRect( g_sizeGripShadowOffset );
- for( int nDot = 0; nDot < nDotCount; nDot++ )
- {
- dc.FillSolidRect( &rcDotShadow, clrDotShadow );
- dc.FillSolidRect( &rcDotFace, clrDotFace );
- rcDotFace.OffsetRect( g_sizeGripDot.cx + g_sizeGripDist.cx + g_sizeGripShadowOffset.cx, 0 );
- rcDotShadow.OffsetRect( g_sizeGripDot.cx + g_sizeGripDist.cx + g_sizeGripShadowOffset.cx, 0 );
- } // for( int nDot = 0; nDot < nDotCount; nDot++ )
- } // else from if( _pgd.m_bHorz )
- }
- void CExtPaintManagerNativeXP::PaintGripper(
- CDC & dc,
- CExtPaintManager::PAINTGRIPPERDATA & _pgd
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- CExtPaintManager::PaintGripper(
- dc,
- _pgd
- );
- return;
- } // if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- CWnd * pWnd =
- DYNAMIC_DOWNCAST(
- CWnd,
- _pgd.m_pHelperSrc
- );
- ASSERT( pWnd != NULL );
- ASSERT_VALID( pWnd );
- if( (!_pgd.m_bSideBar)
- && (!_pgd.m_bFloating)
- )
- {
- if( g_PaintManager.m_UxTheme.OpenThemeData( pWnd->GetSafeHwnd(), VSCLASS_REBAR ) != NULL )
- {
- INT nPartID = _pgd.m_bHorz ? RP_GRIPPER : RP_GRIPPERVERT;
- CSize szPart(0,0);
- VERIFY(
- g_PaintManager.m_UxTheme.GetThemePartSize(
- dc.GetSafeHdc(),
- nPartID,
- 0,
- NULL,
- CExtUxTheme::__EXT_UX_TS_TRUE,
- &szPart
- ) == S_OK
- );
- CRect rcGripper(
- 0,
- 0,
- _pgd.m_bHorz ? szPart.cx : _pgd.m_rcGripper.Width(),
- _pgd.m_bHorz ? _pgd.m_rcGripper.Height() : szPart.cy
- );
- rcGripper.OffsetRect(
- _pgd.m_rcGripper.left + ( _pgd.m_rcGripper.Width() - rcGripper.Width() ) / 2,
- _pgd.m_rcGripper.top + ( _pgd.m_rcGripper.Height() - rcGripper.Height() ) / 2
- );
- // if( _pgd.m_bFlashCaptionHighlightedState )
- // {
- // ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
- // ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
- // dc.FillSolidRect(
- // rcGripper,
- // _pgd.m_clrFlashCaptionBackground
- // );
- // } // if( _pgd.m_bFlashCaptionHighlightedState )
- // else
- {
- //VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pWnd->GetSafeHwnd(),
- dc.GetSafeHdc(),
- nPartID,
- 0,
- &rcGripper,
- &_pgd.m_rcGripper
- //) == S_OK
- );
- } // else from if( _pgd.m_bFlashCaptionHighlightedState )
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- }
- else
- {
- INT nTextColorIndex = COLOR_HIGHLIGHTTEXT;
- if( !_pgd.m_bFloating )
- {
- #if (defined COLOR_GRADIENTACTIVECAPTION && defined COLOR_GRADIENTACTIVECAPTION)
- ASSERT( COLOR_GRADIENTACTIVECAPTION == 27 );
- ASSERT( COLOR_GRADIENTINACTIVECAPTION == 28 );
- #endif
- if( _pgd.m_bFlashCaptionHighlightedState )
- {
- ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
- ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
- dc.FillSolidRect(
- _pgd.m_rcGripper,
- _pgd.m_clrFlashCaptionBackground
- );
- } // if( _pgd.m_bFlashCaptionHighlightedState )
- else if( _pgd.m_bActive )
- {
- nTextColorIndex = COLOR_CAPTIONTEXT;
- if( _pgd.m_bFlashCaptionHighlightedState )
- {
- ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
- ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
- dc.FillSolidRect(
- _pgd.m_rcGripper,
- _pgd.m_clrFlashCaptionBackground
- );
- } // if( _pgd.m_bFlashCaptionHighlightedState )
- else if( !_pgd.m_bHelperNoFill )
- {
- if( stat_GetBPP() > 8 )
- {
- COLORREF clrLeft = ::GetSysColor( COLOR_ACTIVECAPTION );
- COLORREF clrRight = ::GetSysColor( 27 );
- if( (!_pgd.m_bHorz) && _pgd.m_bForceRTL )
- {
- COLORREF clrTemp = clrLeft;
- clrLeft = clrRight;
- clrRight = clrTemp;
- }
- stat_PaintGradientRect(
- dc,
- _pgd.m_rcGripper,
- clrLeft,
- clrRight,
- _pgd.m_bHorz
- );
- }
- else
- {
- dc.FillSolidRect(
- _pgd.m_rcGripper,
- ::GetSysColor( COLOR_ACTIVECAPTION )
- );
- }
- }
- }
- else
- {
- nTextColorIndex = COLOR_INACTIVECAPTIONTEXT;
- if( !_pgd.m_bHelperNoFill )
- {
- if( stat_GetBPP() > 8 )
- {
- COLORREF clrLeft = ::GetSysColor( COLOR_INACTIVECAPTION );
- COLORREF clrRight = ::GetSysColor( 28 );
- if( (!_pgd.m_bHorz) && _pgd.m_bForceRTL )
- {
- COLORREF clrTemp = clrLeft;
- clrLeft = clrRight;
- clrRight = clrTemp;
- }
- stat_PaintGradientRect(
- dc,
- _pgd.m_rcGripper,
- clrLeft,
- clrRight,
- _pgd.m_bHorz
- );
- }
- else
- {
- dc.FillSolidRect(
- _pgd.m_rcGripper,
- ::GetSysColor( COLOR_INACTIVECAPTION )
- );
- }
- }
- }
- } // if( !_pgd.m_bFloating )
- else
- {
- if( _pgd.m_bFlashCaptionHighlightedState )
- {
- ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
- ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
- dc.FillSolidRect(
- _pgd.m_rcGripper,
- _pgd.m_clrFlashCaptionBackground
- );
- } // if( _pgd.m_bFlashCaptionHighlightedState )
- }
- int nTextLen = 0;
- if( _pgd.m_sCaption != NULL
- && ( nTextLen = int(_tcslen(_pgd.m_sCaption)) ) > 0
- && (! _pgd.m_rcText.IsRectEmpty() )
- && _pgd.m_rcText.right > _pgd.m_rcText.left
- && _pgd.m_rcText.bottom > _pgd.m_rcText.top
- )
- {
- COLORREF clrText =
- _pgd.m_bFlashCaptionHighlightedState
- ? _pgd.m_clrFlashCaptionText
- : ::GetSysColor( nTextColorIndex )
- ;
- COLORREF clrOldText =
- dc.SetTextColor(clrText);
- int nOldBkMode = dc.SetBkMode( TRANSPARENT );
- CFont * pCurrFont =
- ( _pgd.m_bSideBar && (!_pgd.m_bFloating) )
- ? (
- (!_pgd.m_bHorz) ?
- &m_FontNormalBC : &m_FontNormalVertXBC
- )
- : (
- (!_pgd.m_bHorz) ?
- &m_FontBoldBC : &m_FontBoldVertXBC
- )
- ;
- CFont * pOldFont =
- dc.SelectObject( pCurrFont );
- ASSERT( pOldFont != NULL );
- if( ! _pgd.m_bHorz )
- {
- // if text is horizontal
- UINT nDtAlign = _pgd.m_bForceRTL ? DT_RIGHT : DT_LEFT;
- bool bFloatingFixedBar = false;
- if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
- {
- CExtControlBar * pBar =
- ((CExtMiniDockFrameWnd *)_pgd.m_pHelperSrc)->GetControlBarExt();
- if( pBar != NULL
- && pBar->IsFixedMode()
- )
- bFloatingFixedBar = true;
- }
- if( bFloatingFixedBar )
- {
- CExtSafeString sCaption( _pgd.m_sCaption );
- INT nAvailableWidth = _pgd.m_rcText.Width();
- for(;;)
- {
- INT nWidth =
- stat_CalcTextWidth(
- dc,
- *pCurrFont,
- sCaption
- );
- if( nAvailableWidth >= nWidth
- || sCaption.IsEmpty()
- )
- break;
- sCaption.Delete( sCaption.GetLength() - 1 );
- }
- if( sCaption.GetLength() > 0 )
- dc.DrawText(
- sCaption,
- sCaption.GetLength(),
- (LPRECT)&_pgd.m_rcText,
- nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_NOCLIP
- );
- } // if( bFloatingFixedBar )
- else
- {
- dc.DrawText(
- _pgd.m_sCaption,
- nTextLen,
- (LPRECT)&_pgd.m_rcText,
- nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS
- );
- } // else if( bFloatingFixedBar )
- } // if text is horizontal
- else
- { // if text is vertical
- LOGFONT lf;
- ::memset(&lf,0,sizeof(LOGFONT));
- pCurrFont->GetLogFont(&lf);
- int _cyHorzFont = abs(lf.lfHeight);
- int _cyTextMargin =
- (_pgd.m_rcText.Width() - _cyHorzFont) / 2
- ;
- CRect rcString =
- CRect(
- CPoint(
- _pgd.m_rcText.left + _cyTextMargin - __ExtMfc_CXTEXTMARGIN,
- _pgd.m_rcText.bottom - __ExtMfc_CYTEXTMARGIN
- ),
- _pgd.m_rcText.Size() //m_sizeHorz
- );
- rcString.DeflateRect(2,2);
- CRect rcExclude;
- rcExclude.SetRect(
- _pgd.m_rcGripper.left,
- _pgd.m_rcGripper.top,
- _pgd.m_rcGripper.right,
- _pgd.m_rcText.top
- );
- dc.ExcludeClipRect( &rcExclude );
- rcString.OffsetRect( -2, -3 );
- dc.DrawText(
- _pgd.m_sCaption,
- nTextLen,
- rcString,
- DT_SINGLELINE | DT_NOCLIP | DT_NOPREFIX // don't forget DT_NOCLIP
- );
- dc.SelectClipRgn(NULL);
- } // if text is vertical
- dc.SelectObject( pOldFont );
- dc.SetBkMode(nOldBkMode);