ExtPaintManager.cpp
上传用户:sesekoo
上传日期:2020-07-18
资源大小:21543k
文件大小:1653k
- // This is part of the Professional User Interface Suite library.
- // Copyright (C) 2001-2009 FOSS Software, Inc.
- // All rights reserved.
- //
- // http://www.prof-uis.com
- // mailto:support@prof-uis.com
- //
- // This source code can be used, modified and redistributed
- // under the terms of the license agreement that is included
- // in the Professional User Interface Suite package.
- //
- // Warranties and Disclaimers:
- // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
- // INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- // IN NO EVENT WILL FOSS SOFTWARE INC. BE LIABLE FOR ANY DIRECT,
- // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES,
- // INCLUDING DAMAGES FOR LOSS OF PROFITS, LOSS OR INACCURACY OF DATA,
- // INCURRED BY ANY PERSON FROM SUCH PERSON'S USAGE OF THIS SOFTWARE
- // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- #include "StdAfx.h"
- #if _MFC_VER < 0x700
- #include <../src/AfxImpl.h>
- #else
- #include <../src/mfc/AfxImpl.h>
- #endif
- #if (!defined __EXT_PAINT_MANAGER_H)
- #include <ExtPaintManager.h>
- #endif
- #if (!defined __ExtCmdManager_H)
- #include <ExtCmdManager.h>
- #endif
- #if (!defined __EXT_MEMORY_DC_H)
- #include <../Src/ExtMemoryDC.h>
- #endif
- #if (!defined __EXT_POPUP_MENU_WND_H)
- #include <ExtPopupMenuWnd.h>
- #endif
- #if (!defined __EXT_MENUCONTROLBAR_H)
- #include <ExtMenuControlBar.h>
- #endif
- #if (!defined __EXTDOCKBAR_H)
- #include <../Src/ExtDockBar.h>
- #endif
- #if (!defined __EXT_STATUSCONTROLBAR_H)
- #include <ExtStatusControlBar.h>
- #endif
- #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
- #if (!defined __EXT_CONTROLBAR_TABBED_FEATURES_H)
- #include "ExtControlBarTabbedFeatures.h"
- #endif // __EXT_CONTROLBAR_TABBED_FEATURES_H
- #endif
- #if( !defined __EXTMINIDOCKFRAMEWND_H)
- #include "ExtMiniDockFrameWnd.h"
- #endif
- #if (!defined __EXT_MFC_NO_SHORTCUTLIST_CTRL)
- #if (!defined __EXTSHORTCUTLISTWND_H)
- #include <ExtShortcutListWnd.h>
- #endif
- #endif // (!defined __EXT_MFC_NO_SHORTCUTLIST_CTRL)
- #if (!defined __EXT_BUTTON_H)
- #include <ExtButton.h>
- #endif
- #if (!defined __EXT_GROUPBOX_H)
- #include <ExtGroupBox.h>
- #endif
- #if (!defined __PROF_UIS_RES_2007_H)
- #include <Resources/Res2007/Res2007.h>
- #endif
- #if (!defined __PROF_UIS_RES_2010_OFFICE_H)
- #include <Resources/Res2010office/Res2010office.h>
- #endif
- #if (!defined __EXT_SCROLLWND_H)
- #include <ExtScrollWnd.h>
- #endif
- #if (!defined __EXT_MFC_NO_REPORTGRIDWND)
- #if (!defined __EXT_REPORT_GRID_WND_H)
- #include <ExtReportGridWnd.h>
- #endif
- #endif
- #if (!defined __EXT_MFC_NO_DATE_PICKER)
- #if (!defined __EXT_DATE_PICKER_H)
- #include <ExtDatePicker.h>
- #endif
- #endif
- #if (!defined __EXT_MFC_NO_TOOLBOX_CTRL)
- #if (!defined __EXTTOOLBOXWND_H)
- #include <ExtToolBoxWnd.h>
- #endif
- #endif
- #if (!defined __EXT_MFC_NO_RIBBON_BAR)
- #if (!defined __EXT_RIBBON_BAR_H)
- #include <ExtRibbonBar.h>
- #endif // (!defined __EXT_RIBBON_BAR_H)
- #endif
- #if (!defined __EXT_MFC_NO_BUILTIN_TEXTFIELD)
- #if (!defined __EXT_POPUP_CTRL_MENU_H)
- #include <ExtPopupCtrlMenu.h>
- #endif
- #endif
- #if (!defined __EXT_MFC_NO_GRIDWND)
- #if (!defined __EXT_GRIDWND_H)
- #include <ExtGridWnd.h>
- #endif
- #endif
- #if (!defined __EXT_TEMPL_H)
- #include <ExtTempl.h>
- #endif
- #if (!defined __EXT_SPIN_H)
- #include <ExtSpinWnd.h>
- #endif
- #if (!defined __EXT_MFC_NO_CUSTOMIZE)
- #if (!defined __EXTCUSTOMIZE_H)
- #include <ExtCustomize.h>
- #endif
- #endif // (!defined __EXT_MFC_NO_CUSTOMIZE)
- #if (!defined __EXT_MFC_NO_DURATIONWND)
- #if (!defined __EXT_DURATIONWND_H)
- #include "ExtDurationWnd.h"
- #endif
- #endif
- #if (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- #if (!defined __EXT_PAGECONTAINERWND_H)
- #include <ExtPageContainerWnd.h>
- #endif
- #endif
- #if (!defined __EXT_RESIZABLE_DIALOG_H)
- #include <ExtResizableDialog.h>
- #endif
- #if (!defined __EXT_EDIT_H)
- #include <ExtEdit.h>
- #endif
- #if (!defined __EXT_COMBO_BOX_H)
- #include <ExtComboBox.h>
- #endif
- #if (! defined __VSSYM32_H__)
- #include <vssym32/vssym32.h>
- #endif // (! defined __VSSYM32_H__)
- #include <math.h>
- #include <shlwapi.h>
- #include <Resources/Resource.h>
- #if (! defined CLEARTYPE_QUALITY )
- #define CLEARTYPE_QUALITY 5
- #endif
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- // VC+ 6.0 static builds specific: disable warnings 4305, 4309
- // warning C4305: 'initializing' : truncation from 'int' to 'short'
- // warning C4309: 'initializing' : truncation of constant value
- #if _MFC_VER < 0x700
- #ifdef __EXT_PROFUIS_STATIC_LINK
- #pragma warning( push )
- #pragma warning ( disable : 4305 )
- #pragma warning ( disable : 4309 )
- #endif
- #endif
- // win9x balloon-rect region fix constants
- #define __WIN9X_FIXED_BAR_ROUNDED_AREA_SHIFT_X 2
- #define __WIN9X_FIXED_BAR_ROUNDED_AREA_SHIFT_Y 2
- #define __WIN9X_FIXED_BAR_ROUNDED_AREA_ADJUST_X 3
- #define __WIN9X_FIXED_BAR_ROUNDED_AREA_ADJUST_Y 3
- //#define __TRACE_PAINT_SESSIONS
- CExtPaintManager::CExtPaintManager()
- : m_bUseTahomaFont( g_PaintManager.m_bIsWin2000orLater )
- , m_eStyle2005( CExtPaintManager::__ES2005_RC )
- , m_bCustomBackgroundInheritanceEnabled( false )
- , m_clrForceSplitterBk( COLORREF(-1L) )
- , m_bScrollBarsHaveHoverEffectIn2kStyle( false )
- #if (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- , m_bPageContainerUseButtonStyle( false )
- , m_bPageContainerUseGroupBoxStyle( false )
- , m_bPageContainerNoEmbossDisabledText( false )
- #endif // (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- #if (!defined __EXT_MFC_NO_SHORTCUTLIST_CTRL)
- , m_bShortcutListUseButtonStyleInScrollButtons( false )
- , m_bShortcutListUseDockerBkgnd( false )
- , m_bShortcutListItemUseButtonStyle( false )
- , m_clrShortcutListItemAlternativeText( COLORREF(-1L) )
- #endif // (!defined __EXT_MFC_NO_SHORTCUTLIST_CTRL)
- {
- ASSERT( this != NULL );
- m_DSS_DISABLED_style = DSS_DISABLED;
- #define __3D_COLOR_DEPTH_R 7
- #define __3D_COLOR_DEPTH_G 6
- #define __3D_COLOR_DEPTH_B 6
- struct
- {
- LOGPALETTE LogPalette;
- PALETTEENTRY PalEntry[ (__3D_COLOR_DEPTH_R*__3D_COLOR_DEPTH_G*__3D_COLOR_DEPTH_B) ];
- } pal;
- LOGPALETTE * pLogPalette = (LOGPALETTE*) &pal;
- pLogPalette->palVersion = 0x300;
- pLogPalette->palNumEntries = (WORD)(__3D_COLOR_DEPTH_R*__3D_COLOR_DEPTH_G*__3D_COLOR_DEPTH_B);
- int i = 0;
- for( int nX = 0; nX < __3D_COLOR_DEPTH_R; nX++ )
- {
- for( int nY = 0; nY < __3D_COLOR_DEPTH_G; nY++ )
- {
- for( int nZ = 0; nZ < __3D_COLOR_DEPTH_B; nZ++ )
- {
- pLogPalette->palPalEntry[i].peRed =
- BYTE( (nX*255)/(__3D_COLOR_DEPTH_R-1) );
- pLogPalette->palPalEntry[i].peGreen =
- BYTE( (nY*255)/(__3D_COLOR_DEPTH_G-1) );
- pLogPalette->palPalEntry[i].peBlue =
- BYTE( (nZ*255)/(__3D_COLOR_DEPTH_B-1) );
- pLogPalette->palPalEntry[i].peFlags = 0;
- i++;
- }
- }
- }
- VERIFY( m_PaletteWide.CreatePalette(pLogPalette) );
- VERIFY( m_bmpFilterApplied.LoadBMP_Resource( MAKEINTRESOURCE( IDB_EXT_BITMAP_FILTER_APPLIED ) ) );
- VERIFY( m_bmpFilterApplied.Make32() );
- m_bmpFilterApplied.AlphaColor( RGB(255,0,255), RGB(0,0,0), BYTE(0) );
- VERIFY( m_bmpFilterUnApplied.LoadBMP_Resource( MAKEINTRESOURCE( IDB_EXT_BITMAP_FILTER_UNAPPLIED ) ) );
- VERIFY( m_bmpFilterUnApplied.Make32() );
- m_bmpFilterUnApplied.AlphaColor( RGB(255,0,255), RGB(0,0,0), BYTE(0) );
- }
- CExtPaintManager::~CExtPaintManager()
- {
- ASSERT( this != NULL );
- m_colors.RemoveAll();
- m_brushes.RemoveAll();
- }
- void CExtPaintManager::SerializeSynchronizationData( CArchive & ar )
- {
- ASSERT_VALID( this );
- ar;
- }
- bool CExtPaintManager::UiScalingIsEnabled(
- CExtPaintManager::e_ui_scaling_type_t eUIST
- ) const
- {
- ASSERT_VALID( this );
- ASSERT( __EUIST_MIN_VALUE <= eUIST && eUIST <= __EUIST_MAX_VALUE );
- bool bEnaled = false;
- switch( eUIST )
- {
- case __EUIST_X:
- bEnaled = g_PaintManager.m_bEnableUiScalingX;
- break;
- case __EUIST_Y:
- bEnaled = g_PaintManager.m_bEnableUiScalingY;
- break;
- case __EUIST_Z:
- bEnaled = g_PaintManager.m_bEnableUiScalingZ;
- break;
- #ifdef _DEBUG
- default:
- ASSERT( FALSE );
- break;
- #endif // _DEBUG
- } // switch( eUIST )
- return bEnaled;
- }
- INT CExtPaintManager::UiScalingDo(
- INT nValue,
- CExtPaintManager::e_ui_scaling_type_t eUIST
- ) const
- {
- ASSERT_VALID( this );
- ASSERT( __EUIST_MIN_VALUE <= eUIST && eUIST <= __EUIST_MAX_VALUE );
- INT nNewValue = nValue;
- if( UiScalingIsEnabled( eUIST ) )
- {
- switch( eUIST )
- {
- case __EUIST_X:
- nNewValue = ::MulDiv( nNewValue, g_PaintManager.m_nLPX, 96 );
- break;
- case __EUIST_Y:
- nNewValue = ::MulDiv( nNewValue, g_PaintManager.m_nLPY, 96 );
- break;
- case __EUIST_Z:
- nNewValue = ::MulDiv( nNewValue, g_PaintManager.m_nLPZ, 96 );
- break;
- #ifdef _DEBUG
- default:
- ASSERT( FALSE );
- break;
- #endif // _DEBUG
- } // switch( eUIST )
- } // if( UiScalingIsEnabled( eUIST ) )
- return nNewValue;
- }
- CExtPaintManagerXP::CExtPaintManagerXP()
- : m_bEnabledHoverIconShadows( true )
- , m_bHelperXpStyle8BitBarRect( true )
- , m_bExpBtnSwapVGlyphs( false )
- , m_pGlyphTbEpBtnH0( &g_glyph_btn_expand_bottom )
- , m_pGlyphTbEpBtnH1( &g_glyph_btn_expand_right2 )
- , m_pGlyphTbEpBtnV0( &g_glyph_btn_expand_left )
- , m_pGlyphTbEpBtnV1( &g_glyph_btn_expand_bottom2 )
- , m_nIdxClrMlaNormLeft( -1 )
- , m_nIdxClrMlaNormMiddle( -1 )
- , m_nIdxClrMlaNormRight( -1 )
- , m_nIdxClrMlaRarelyLeft( -1 )
- , m_nIdxClrMlaRarelyMiddle( -1 )
- , m_nIdxClrMlaRarelyRight( -1 )
- , m_nIdxClrBtnHoverLeft( -1 )
- , m_nIdxClrBtnHoverRight( -1 )
- , m_nIdxClrBtnPressedLeft( -1 )
- , m_nIdxClrBtnPressedRight( -1 )
- , m_nIdxClrBtnHovPresLeft( -1 )
- , m_nIdxClrBtnHovPresRight( -1 )
- , m_clrCustomDropDownGlyphEnabled( COLORREF(-1L) )
- , m_clrCustomDropDownGlyphDisabled( COLORREF(-1L) )
- {
- #if (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- m_bPageContainerNoEmbossDisabledText = true;
- #endif // (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- }
- CExtPaintManagerXP::~CExtPaintManagerXP()
- {
- }
- //////////////////////////////////////////////////////////////////////////
- // CExtPaintManagerOffice2003
- //////////////////////////////////////////////////////////////////////////
- CExtPaintManagerOffice2003::CExtPaintManagerOffice2003()
- : m_nIdxClrTbFillMargin( -1 )
- {
- m_bEnabledHoverIconShadows = false;
- m_bHelperXpStyle8BitBarRect = false;
- m_bExpBtnSwapVGlyphs = true;
- m_pGlyphTbEpBtnH0 = &g_glyph_btn_expand_bottom_2003;
- m_pGlyphTbEpBtnH1 = &g_glyph_btn_expand_right2_2003;
- m_pGlyphTbEpBtnV0 = &g_glyph_btn_expand_right_2003;
- m_pGlyphTbEpBtnV1 = &g_glyph_btn_expand_bottom2_2003;
- m_nIdxClrMlaNormLeft = _2003CLR_MLA_NORM_LEFT;
- m_nIdxClrMlaNormMiddle = _2003CLR_MLA_NORM_MIDDLE;
- m_nIdxClrMlaNormRight = _2003CLR_MLA_NORM_RIGHT;
- m_nIdxClrMlaRarelyLeft = _2003CLR_MLA_RARELY_LEFT;
- m_nIdxClrMlaRarelyMiddle = _2003CLR_MLA_RARELY_MIDDLE;
- m_nIdxClrMlaRarelyRight = _2003CLR_MLA_RARELY_RIGHT;
- #if (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- m_bPageContainerUseButtonStyle = true;
- m_bPageContainerUseGroupBoxStyle = true;
- m_bPageContainerNoEmbossDisabledText = true;
- #endif // (!defined __EXT_MFC_NO_PAGECONTAINER_CTRL)
- #if (!defined __EXT_MFC_NO_SHORTCUTLIST_CTRL)
- m_bShortcutListUseButtonStyleInScrollButtons = true;
- // m_bShortcutListUseDockerBkgnd = true;
- m_bShortcutListItemUseButtonStyle = true;
- #endif // (!defined __EXT_MFC_NO_SHORTCUTLIST_CTRL)
- }
- CExtPaintManagerOffice2003::~CExtPaintManagerOffice2003()
- {
- }
- bool CExtPaintManager::ScrollBar_GetMetrics(
- INT * p_nHorzBarHeight, // = NULL
- INT * p_nVertBarWidth, // = NULL
- INT * p_nHorzButtonWidth, // = NULL
- INT * p_nVertButtonHeight, // = NULL
- INT * p_nHorzThumbMinWidth, // = NULL
- INT * p_nVertThumbMinHeight, // = NULL
- CObject * pHelperSrc, // = NULL
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- p_nHorzBarHeight;
- p_nVertBarWidth;
- p_nHorzButtonWidth;
- p_nVertButtonHeight;
- p_nHorzThumbMinWidth;
- p_nVertThumbMinHeight;
- pHelperSrc;
- lParam;
- return false;
- }
- void CExtPaintManager::ScrollBar_Paint(
- CDC & dc,
- CExtPaintManager::PAINTSCROLLBARDATA & _psbd
- ) const
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- _psbd.PaintDefault(
- dc,
- const_cast < CExtPaintManager * > ( this )
- );
- }
- CExtPaintManager::SCROLLBARSKINDATA * CExtPaintManager::ScrollBar_GetSkinData(
- bool bHorzBar,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bLightAccent // = true
- )
- {
- ASSERT_VALID( this );
- bHorzBar;
- pHelperSrc;
- lParam;
- bLightAccent;
- return NULL;
- }
- #ifndef __EXT_MFC_NO_GRIDWND
- bool CExtPaintManager::Grid_PaintButton(
- CDC & dc,
- const RECT & rcButton,
- INT nButtonType,
- bool bPressed,
- bool bHovered,
- bool bFocused,
- bool bEnabled,
- COLORREF clrFace,
- COLORREF clrLight,
- COLORREF clrShadow,
- COLORREF clrWindow,
- COLORREF clrText,
- DWORD dwHelperPaintFlags,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- lParam;
- if( pHelperSrc == NULL )
- return false;
- ASSERT_VALID( pHelperSrc );
- CWnd * pWnd = DYNAMIC_DOWNCAST( CWnd, pHelperSrc );
- ASSERT( pWnd != NULL );
- bool bPaintPushButton = true;
- if( ( nButtonType == INT(CExtGridCell::__EBTT_FILTER_APPLIED)
- || nButtonType == INT(CExtGridCell::__EBTT_FILTER_UNAPPLIED)
- )
- && ( (! bEnabled )
- || (! ( bFocused || bHovered || bPressed ) )
- )
- )
- bPaintPushButton = false;
- CRect rc( rcButton );
- if( bPaintPushButton )
- dc.FillSolidRect( &rc, clrWindow );
- bool bDefaultDrawing = true;
- CExtPaintManager::glyph_t * pGlyph = NULL;
- CExtBitmap * pBitmap = NULL;
- if( g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- INT nPartID = -1;
- INT nState = 0;
- __EXT_UX_LPCWSTR pszClassList = NULL;
- switch( nButtonType )
- {
- case INT(CExtGridCell::__EBTT_DROPDOWN):
- pszClassList = VSCLASS_COMBOBOX;
- nPartID = CP_DROPDOWNBUTTON;
- nState =
- (!bEnabled)
- ? CBXS_DISABLED
- : bPressed
- ? CBXS_PRESSED
- : bHovered
- ? CBXS_HOT
- : CBXS_NORMAL;
- break;
- case INT(CExtGridCell::__EBTT_ELLIPSIS):
- pszClassList = VSCLASS_BUTTON;
- nPartID = BP_PUSHBUTTON;
- nState =
- (!bEnabled)
- ? PBS_DISABLED
- : bPressed
- ? PBS_PRESSED
- : bHovered
- ? PBS_HOT
- : ( bFocused )
- ? PBS_DEFAULTED
- : PBS_NORMAL;
- if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_ELLIPSIS_DOTS) == 0 )
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ELLIPSIS
- ];
- break;
- case INT(CExtGridCell::__EBTT_UPDOWN_UP):
- pszClassList = VSCLASS_SPIN;
- nPartID = SPNP_UP;
- nState =
- (!bEnabled)
- ? UPS_DISABLED
- : bPressed
- ? UPS_PRESSED
- : bHovered
- ? UPS_HOT
- : UPS_NORMAL;
- break;
- case INT(CExtGridCell::__EBTT_UPDOWN_DOWN):
- pszClassList = VSCLASS_SPIN;
- nPartID = SPNP_DOWN;
- nState =
- (!bEnabled)
- ? DNS_DISABLED
- : bPressed
- ? DNS_PRESSED
- : bHovered
- ? DNS_HOT
- : DNS_NORMAL;
- break;
- case INT(CExtGridCell::__EBTT_FILTER_APPLIED):
- pBitmap = &m_bmpFilterApplied;
- break;
- case INT(CExtGridCell::__EBTT_FILTER_UNAPPLIED):
- pBitmap = &m_bmpFilterUnApplied;
- break;
- } // switch( nButtonType )
- if( bPaintPushButton
- && nPartID != -1
- && pszClassList != NULL
- && g_PaintManager.m_UxTheme.OpenThemeData( pWnd->GetSafeHwnd(), pszClassList ) != NULL
- )
- {
- if( g_PaintManager.m_UxTheme.DrawThemeBackground(
- dc.GetSafeHdc(),
- nPartID,
- nState,
- &rc,
- &rcButton
- ) == S_OK
- )
- bDefaultDrawing = false;
- g_PaintManager.m_UxTheme.CloseThemeData( true );
- }
- }
- if( bDefaultDrawing )
- {
- COLORREF clrOuterLT =
- bPressed ? clrShadow : clrLight;
- COLORREF clrOuterRB =
- bPressed ? clrLight : clrShadow;
- if( bPaintPushButton )
- dc.FillSolidRect( &rc, clrFace );
- rc.DeflateRect( 2, 2 );
- if( bPaintPushButton )
- dc.Draw3dRect(
- &rcButton,
- clrOuterLT,
- clrOuterRB
- );
- if( bPressed )
- rc.OffsetRect( 0, 1 );
- if( nButtonType == INT(CExtGridCell::__EBTT_DROPDOWN) )
- {
- if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_DROPDOWN_ARROW) == 0 )
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ARROW_DOWN
- ];
- }
- else if( nButtonType == INT(CExtGridCell::__EBTT_ELLIPSIS) )
- {
- if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_ELLIPSIS_DOTS) == 0 )
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ELLIPSIS
- ];
- }
- else if( nButtonType == INT(CExtGridCell::__EBTT_UPDOWN_UP) )
- {
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ARROW_SMALL_UP
- ];
- }
- else if( nButtonType == INT(CExtGridCell::__EBTT_UPDOWN_DOWN) )
- {
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ARROW_SMALL_DOWN
- ];
- }
- else if( nButtonType == INT(CExtGridCell::__EBTT_FILTER_APPLIED) )
- {
- pBitmap = &m_bmpFilterApplied;
- }
- else if( nButtonType == INT(CExtGridCell::__EBTT_FILTER_UNAPPLIED) )
- {
- pBitmap = &m_bmpFilterUnApplied;
- }
- } // if( bDefaultDrawing )
- if( pGlyph != NULL )
- {
- COLORREF ColorValues[2] =
- {
- RGB(0,0,0),
- RGB(0,0,0),
- };
- ColorValues[1] =
- bEnabled ? clrText : clrLight;
- if( ! bEnabled )
- rc.OffsetRect( 1, 1 );
- PaintGlyphCentered(
- dc,
- rc,
- *pGlyph,
- ColorValues
- );
- if( ! bEnabled )
- {
- rc.OffsetRect( -1, -1 );
- ColorValues[1] = clrShadow;
- PaintGlyphCentered(
- dc,
- rc,
- *pGlyph,
- ColorValues
- );
- } // if( ! bEnabled )
- } // if( pGlyph != NULL )
- if( pBitmap != NULL
- && (! pBitmap->IsEmpty() )
- )
- {
- CRect rcDst( rc.TopLeft(), pBitmap->GetSize() );
- rcDst.OffsetRect(
- ( rc.Width() - rcDst.Width() ) / 2,
- ( rc.Height() - rcDst.Height() ) / 2
- );
- pBitmap->AlphaBlend( dc.m_hDC, rcDst );
- } // if( pBitmap != NULL ...
- if( bFocused
- && nButtonType == INT(CExtGridCell::__EBTT_ELLIPSIS)
- )
- {
- CRect rcFocusRect( rcButton );
- if( bPressed )
- {
- CSize sizePushedOffset = GetPushedOffset();
- rcFocusRect.OffsetRect( -sizePushedOffset );
- }
- rcFocusRect.DeflateRect( 3, 3 );
- dc.DrawFocusRect( &rcFocusRect );
- }
- return true;
- }
- bool CExtPaintManagerOffice2007_Impl::Grid_PaintButton(
- CDC & dc,
- const RECT & rcButton,
- INT nButtonType,
- bool bPressed,
- bool bHovered,
- bool bFocused,
- bool bEnabled,
- COLORREF clrFace,
- COLORREF clrLight,
- COLORREF clrShadow,
- COLORREF clrWindow,
- COLORREF clrText,
- DWORD dwHelperPaintFlags,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( pHelperSrc == NULL )
- return false;
- ASSERT_VALID( pHelperSrc );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::Grid_PaintButton(
- dc,
- rcButton,
- nButtonType,
- bPressed,
- bHovered,
- bFocused,
- bEnabled,
- clrFace,
- clrLight,
- clrShadow,
- clrWindow,
- clrText,
- dwHelperPaintFlags,
- pHelperSrc,
- lParam
- );
- CWnd * pWnd =
- DYNAMIC_DOWNCAST( CWnd, pHelperSrc );
- ASSERT( pWnd != NULL );
-
- CRect rc( rcButton );
- // dc.FillSolidRect( &rc, clrWindow );
- bool bPaintPushButton = true;
- if( ( nButtonType == INT(CExtGridCell::__EBTT_FILTER_APPLIED)
- || nButtonType == INT(CExtGridCell::__EBTT_FILTER_UNAPPLIED)
- )
- && ( (! bEnabled )
- || (! ( bFocused || bHovered || bPressed ) )
- )
- )
- bPaintPushButton = false;
- if( bPaintPushButton )
- {
- CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd;
- _ppbd.m_pHelperSrc = pHelperSrc;
- _ppbd.m_rcClient = rc;
- _ppbd.m_bPushed = bPressed;
- _ppbd.m_bHover = bHovered;
- _ppbd.m_bDrawFocusRect =
- (nButtonType == INT(CExtGridCell::__EBTT_ELLIPSIS)) ? bFocused : false;
- _ppbd.m_bEnabled = bEnabled;
- _ppbd.m_bTransparentBackground = true;
- PaintPushButton( dc, _ppbd );
- }
- CExtPaintManager::glyph_t * pGlyph = NULL;
- CExtBitmap * pBitmap = NULL;
- switch( nButtonType )
- {
- case INT(CExtGridCell::__EBTT_DROPDOWN):
- if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_DROPDOWN_ARROW) == 0 )
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ARROW_DOWN
- ];
- break;
- case INT(CExtGridCell::__EBTT_ELLIPSIS):
- if( (dwHelperPaintFlags&__EGCPF_NO_BUTTON_ELLIPSIS_DOTS) == 0 )
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ELLIPSIS
- ];
- break;
- case INT(CExtGridCell::__EBTT_UPDOWN_UP):
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ARROW_SMALL_UP
- ];
- break;
- case INT(CExtGridCell::__EBTT_UPDOWN_DOWN):
- pGlyph =
- CExtPaintManager::g_DockingCaptionGlyphs[
- (INT) CExtPaintManager::__DCBT_ARROW_SMALL_DOWN
- ];
- break;
- case INT(CExtGridCell::__EBTT_FILTER_APPLIED):
- pBitmap = &m_bmpFilterApplied;
- break;
- case INT(CExtGridCell::__EBTT_FILTER_UNAPPLIED):
- pBitmap = &m_bmpFilterUnApplied;
- break;
- } // switch( nButtonType )
- if( pGlyph != NULL )
- {
- COLORREF ColorValues[2] =
- {
- RGB(0,0,0),
- RGB(0,0,0),
- };
- ColorValues[1] =
- bEnabled ? clrText : clrLight;
- if( ! bEnabled )
- rc.OffsetRect( 1, 1 );
- PaintGlyphCentered(
- dc,
- rc,
- *pGlyph,
- ColorValues
- );
- if( ! bEnabled )
- {
- rc.OffsetRect( -1, -1 );
- ColorValues[1] = clrShadow;
- PaintGlyphCentered(
- dc,
- rc,
- *pGlyph,
- ColorValues
- );
- } // if( ! bEnabled )
- } // if( pGlyph != NULL )
- if( pBitmap != NULL
- && (! pBitmap->IsEmpty() )
- )
- {
- CRect rcDst( rc.TopLeft(), pBitmap->GetSize() );
- rcDst.OffsetRect(
- ( rc.Width() - rcDst.Width() ) / 2,
- ( rc.Height() - rcDst.Height() ) / 2
- );
- pBitmap->AlphaBlend( dc.m_hDC, rcDst );
- } // if( pBitmap != NULL ...
- return true;
- }
- bool CExtPaintManager::Grid_PaintHeaderSortArrow(
- CDC & dc,
- const RECT & rcSortArrow,
- bool bHorz,
- bool bAscending,
- COLORREF * pColorValues,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- pHelperSrc;
- lParam;
- if( pColorValues == NULL )
- {
- ASSERT( FALSE );
- return false;
- }
- PaintGlyphCentered(
- dc,
- rcSortArrow,
- *( g_DockingCaptionGlyphs[
- bHorz
- ? ( bAscending
- ? __DCBT_ARROW_SORT_LEFT
- : __DCBT_ARROW_SORT_RIGHT )
- : ( bAscending
- ? __DCBT_ARROW_SORT_UP
- : __DCBT_ARROW_SORT_DOWN )
- ] ),
- pColorValues
- );
- return true;
- }
- bool CExtPaintManagerNativeXP::Grid_PaintHeaderSortArrow(
- CDC & dc,
- const RECT & rcSortArrow,
- bool bHorz,
- bool bAscending,
- COLORREF * pColorValues,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- pColorValues;
- pHelperSrc;
- lParam;
- COLORREF ColorValues[2] =
- {
- RGB(0,0,0),
- ::GetSysColor(COLOR_3DSHADOW),
- };
- PaintGlyphCentered(
- dc,
- rcSortArrow,
- *( g_DockingCaptionGlyphs[
- bHorz
- ? ( bAscending
- ? __DCBT_2007_ARROW_SORT_LEFT
- : __DCBT_2007_ARROW_SORT_RIGHT )
- : ( bAscending
- ? __DCBT_2007_ARROW_SORT_UP
- : __DCBT_2007_ARROW_SORT_DOWN )
- ] ),
- ColorValues
- );
- return true;
- }
- bool CExtPaintManagerOffice2007_Impl::Grid_PaintHeaderSortArrow(
- CDC & dc,
- const RECT & rcSortArrow,
- bool bHorz,
- bool bAscending,
- COLORREF * pColorValues,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::Grid_PaintHeaderSortArrow(
- dc,
- rcSortArrow,
- bHorz,
- bAscending,
- pColorValues,
- pHelperSrc,
- lParam
- );
- COLORREF ColorValues[2] =
- {
- RGB(0,0,0),
- m_clrGridHeaderSortArrow,
- };
- PaintGlyphCentered(
- dc,
- rcSortArrow,
- *( g_DockingCaptionGlyphs[
- bHorz
- ? ( bAscending
- ? __DCBT_2007_ARROW_SORT_LEFT
- : __DCBT_2007_ARROW_SORT_RIGHT )
- : ( bAscending
- ? __DCBT_2007_ARROW_SORT_UP
- : __DCBT_2007_ARROW_SORT_DOWN )
- ] ),
- ColorValues
- );
- return true;
- }
- COLORREF CExtPaintManager::Grid_OnQueryTextColor(
- const CExtGridCell & _cell,
- CDC & dc,
- LONG nVisibleColNo,
- LONG nVisibleRowNo,
- LONG nColNo,
- LONG nRowNo,
- INT nColType,
- INT nRowType,
- DWORD dwAreaFlags,
- DWORD dwHelperPaintFlags
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( (&_cell) );
- // if( (dwHelperPaintFlags&__EGCPF_PRINTING_TARGET_MASK) != 0 )
- // return COLORREF(-1L);
- _cell;
- dc;
- nVisibleColNo;
- nVisibleRowNo;
- nColNo;
- nRowNo;
- nColType;
- nRowType;
- dwAreaFlags;
- dwHelperPaintFlags;
- // used default cell' text color computed
- // by the CExtGridCell::OnQueryTextColor() virtual method
- return COLORREF(-1L);
- }
- bool CExtPaintManager::Grid_PaintHeaderBackground(
- CDC & dc,
- const RECT & rcArea,
- LONG nColNo,
- LONG nRowNo,
- INT nColType,
- INT nRowType,
- DWORD dwAreaFlags,
- DWORD dwHelperPaintFlags,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcArea;
- nColNo;
- nRowNo;
- nColType;
- nRowType;
- dwAreaFlags;
- dwHelperPaintFlags;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::Grid_PaintHeaderBackground(
- CDC & dc,
- const RECT & rcArea,
- LONG nColNo,
- LONG nRowNo,
- INT nColType,
- INT nRowType,
- DWORD dwAreaFlags,
- DWORD dwHelperPaintFlags,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcArea;
- nColNo;
- nRowNo;
- nColType;
- nRowType;
- dwAreaFlags;
- dwHelperPaintFlags;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerOffice2007_Impl::Grid_PaintHeaderBackground(
- CDC & dc,
- const RECT & rcArea,
- LONG nColNo,
- LONG nRowNo,
- INT nColType,
- INT nRowType,
- DWORD dwAreaFlags,
- DWORD dwHelperPaintFlags,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::Grid_PaintHeaderBackground(
- dc,
- rcArea,
- nColNo,
- nRowNo,
- nColType,
- nRowType,
- dwAreaFlags,
- dwHelperPaintFlags,
- pHelperSrc,
- lParam
- );
- CExtGridWnd * pGridWnd = ( pHelperSrc != NULL ) ? ( DYNAMIC_DOWNCAST( CExtGridWnd, pHelperSrc ) ) : NULL;
- if( pGridWnd == NULL )
- return false;
- bool bHoverByColumn = ( (dwHelperPaintFlags&__EGCPF_HOVER_BY_COLUMN) != 0 ) ? true : false;
- bool bHoverByRow = ( (dwHelperPaintFlags&__EGCPF_HOVER_BY_ROW) != 0 ) ? true : false;
- bool bHighlightedBySelectedColumn = ( (dwHelperPaintFlags&__EGCPF_HIGHLIGHTED_BY_SELECTED_COLUMN) != 0 ) ? true : false;
- bool bHighlightedBySelectedRow = ( (dwHelperPaintFlags&__EGCPF_HIGHLIGHTED_BY_SELECTED_ROW) != 0 ) ? true : false;
- bool bHighlightedByFocusedColumn = ( (dwHelperPaintFlags&__EGCPF_HIGHLIGHTED_BY_FOCUSED_COLUMN) != 0 ) ? true : false;
- bool bHighlightedByFocusedRow = ( (dwHelperPaintFlags&__EGCPF_HIGHLIGHTED_BY_FOCUSED_ROW) != 0 ) ? true : false;
- // bool bFocusedControl = ( (dwHelperPaintFlags&__EGCPF_FOCUSED_CONTROL) != 0 ) ? true : false;
- bool bHighlightPressing = ( (dwHelperPaintFlags&(__EGCPF_HIGHLIGHTED_BY_PRESSED_COLUMN|__EGCPF_HIGHLIGHTED_BY_PRESSED_ROW)) != 0 ) ? true : false;
- COLORREF clrBack = COLORREF( -1L );
- if( nColNo >= 0L && nRowNo >= 0L )
- clrBack =
- pGridWnd->OnGbwQueryBackColor(
- dc,
- 0L,
- 0L,
- nColNo,
- nRowNo,
- nColType,
- nRowType,
- dwAreaFlags,
- dwHelperPaintFlags
- );
- if( clrBack != COLORREF( -1L )
- && (! bHighlightPressing )
- )
- dc.FillSolidRect(
- &rcArea,
- clrBack
- );
- else
- stat_PaintGradientRect(
- dc,
- rcArea,
- m_clrGridHeaderBkBottom,
- m_clrGridHeaderBkTop,
- true
- );
- if( clrBack != COLORREF( -1L ) )
- {
- dc.FillSolidRect(
- &rcArea,
- clrBack
- );
- }
- else if( bHighlightPressing )
- {
- CRect rcHighlightPressing( rcArea );
- if( (dwHelperPaintFlags&__EGCPF_HIGHLIGHTED_BY_PRESSED_COLUMN) != 0 )
- rcHighlightPressing.DeflateRect( 0, 0, 1, 0 );
- if( (dwHelperPaintFlags&__EGCPF_HIGHLIGHTED_BY_PRESSED_ROW) != 0 )
- rcHighlightPressing.DeflateRect( 0, 0, 0, 1 );
- dc.FillSolidRect(
- &rcHighlightPressing, // &rcArea
- pGridWnd->OnSiwGetSysColor( COLOR_3DDKSHADOW )
- );
- } // if( bHighlightPressing )
- else if( bHighlightedByFocusedColumn || bHighlightedByFocusedRow )
- {
- dc.FillRect(
- &rcArea,
- &( pGridWnd->OnSiwGetLighterOrDarkerBrush( -3 ) )
- );
- }
- else if( bHighlightedBySelectedColumn || bHighlightedBySelectedRow )
- {
- dc.FillRect(
- &rcArea,
- &( pGridWnd->OnSiwGetLighterOrDarkerBrush( -2 ) )
- );
- }
- else if( bHoverByColumn || bHoverByRow )
- {
- if( nColType == 0 || nRowType == 0 )
- dc.FillRect(
- &rcArea,
- &( pGridWnd->OnSiwGetLighterOrDarkerBrush( -1 ) )
- );
- }
- bool bLineTop = false;
- bool bLineLeft = false;
- bool bLineRight = false;
- bool bLineBottom = false;
- bool bDrawBorder = false;
- bool bDrawSeparator = false;
- if( (dwHelperPaintFlags&__EGCPF_OUTER_DND) != 0 )
- {
- bDrawBorder = true;
- }
- else if( nColNo >= 0L && nRowNo >= 0L )
- {
- LONG nOuterColumnCountLeft = 0L;
- LONG nOuterColumnCountRight = 0L;
- if( pGridWnd != NULL )
- {
- nOuterColumnCountLeft = pGridWnd->OuterColumnCountLeftGet();
- nOuterColumnCountRight = pGridWnd->OuterColumnCountRightGet();
- }
- if( dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_FROZEN_AREA_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_FROZEN_AREA_RIGHT)
- )
- {
- if( nRowNo == 0L )
- bLineTop = true;
- bLineBottom = true;
- // LONG nColumnCount = pGridWnd->ColumnCountGet();
- // if( nColumnCount < 0L || nColNo != ( nColumnCount - 1L ) )
- bDrawSeparator = true;
- }
- else if( dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_FROZEN_AREA_TOP)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_FROZEN_AREA_BOTTOM)
- )
- {
- if( nColNo == 0L )
- bLineLeft = true;
- if( nColNo == nOuterColumnCountLeft - 1L )
- bLineRight = true;
- else
- bDrawSeparator = true;
- bLineBottom = true;
- }
- else if( dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_FROZEN_AREA_TOP)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_FROZEN_AREA_BOTTOM)
- )
- {
- if( nColNo == 0L )
- bLineLeft = true;
- if( nColNo == nOuterColumnCountRight - 1L )
- bLineRight = true;
- else
- bDrawSeparator = true;
- bLineBottom = true;
- }
- else if( dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_FROZEN_AREA_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_FROZEN_AREA_RIGHT)
- )
- {
- if( nRowNo == 0L )
- bLineTop = true;
- bLineBottom = true;
- // LONG nColumnCount = pGridWnd->ColumnCountGet();
- // if( nColumnCount < 0L || nColNo != ( nColumnCount - 1L ) )
- bDrawSeparator = true;
- }
- else if(
- dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_OUTER_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_OUTER_RIGHT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_OUTER_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_OUTER_RIGHT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_FROZEN_AREA_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_FROZEN_AREA_RIGHT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_FROZEN_AREA_LEFT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_FROZEN_AREA_RIGHT)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_FROZEN_AREA_TOP)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_FROZEN_AREA_BOTTOM)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_FROZEN_AREA_TOP)
- || dwAreaFlags == (__EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_FROZEN_AREA_BOTTOM)
- )
- {
- bLineLeft = bLineTop = bLineRight = bLineBottom = true;
- }
- }
- else if( nColNo < 0L && nRowNo < 0L )
- {
- switch( dwAreaFlags )
- {
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_FROZEN_AREA_LEFT:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_TOP|__EGBWA_FROZEN_AREA_RIGHT:
- bLineTop = true;
- bLineBottom = true;
- break;
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_FROZEN_AREA_LEFT:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_BOTTOM|__EGBWA_FROZEN_AREA_RIGHT:
- bLineTop = true;
- bLineBottom = true;
- break;
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_FROZEN_AREA_TOP:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_FROZEN_AREA_BOTTOM:
- bLineLeft = true;
- bLineRight = true;
- break;
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_FROZEN_AREA_TOP:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_FROZEN_AREA_BOTTOM:
- bLineLeft = true;
- bLineRight = true;
- break;
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_OUTER_TOP:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_LEFT|__EGBWA_OUTER_BOTTOM:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_OUTER_TOP:
- case __EGBWA_OUTER_CELLS|__EGBWA_OUTER_RIGHT|__EGBWA_OUTER_BOTTOM:
- bLineLeft = bLineTop = bLineRight = bLineBottom = true;
- break;
- } // switch( dwAreaFlags )
- }
- if( bDrawSeparator )
- {
- CRect rcSeparator(
- rcArea.right - 1,
- rcArea.top + 3,
- rcArea.right,
- rcArea.bottom - 3
- );
- if( (! rcSeparator.IsRectEmpty() )
- && dc.RectVisible( &rcSeparator )
- )
- dc.FillSolidRect( &rcSeparator, m_clrGridHeaderSeparator );
- }
- if( bDrawBorder )
- {
- dc.Draw3dRect(
- &rcArea,
- m_clrGridHeaderBorder,
- m_clrGridHeaderBorder
- );
- }
- if( bLineLeft )
- {
- CRect rcLine(
- rcArea.left,
- rcArea.top,
- rcArea.left + 1,
- rcArea.bottom
- );
- if( (! rcLine.IsRectEmpty() )
- && dc.RectVisible( &rcLine )
- )
- dc.FillSolidRect( &rcLine, m_clrGridHeaderBorder );
- }
- if( bLineTop )
- {
- CRect rcLine(
- rcArea.left,
- rcArea.top,
- rcArea.right,
- rcArea.top + 1
- );
- if( (! rcLine.IsRectEmpty() )
- && dc.RectVisible( &rcLine )
- )
- dc.FillSolidRect( &rcLine, m_clrGridHeaderBorder );
- }
- if( bLineRight )
- {
- CRect rcLine(
- rcArea.right - 1,
- rcArea.top,
- rcArea.right,
- rcArea.bottom
- );
- if( (! rcLine.IsRectEmpty() )
- && dc.RectVisible( &rcLine )
- )
- dc.FillSolidRect( &rcLine, m_clrGridHeaderBorder );
- }
- if( bLineBottom )
- {
- CRect rcLine(
- rcArea.left,
- rcArea.bottom - 1,
- rcArea.right,
- rcArea.bottom
- );
- if( (! rcLine.IsRectEmpty() )
- && dc.RectVisible( &rcLine )
- )
- dc.FillSolidRect( &rcLine, m_clrGridHeaderBorder );
- }
- return true;
- }
- #endif // #ifndef __EXT_MFC_NO_GRIDWND
-
- #if (!defined __EXT_MFC_NO_REPORTGRIDWND)
- bool CExtPaintManager::ReportGrid_PaintHeaderRowBackground(
- CDC & dc,
- const RECT & rcArea,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcArea;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerOffice2003::ReportGrid_PaintHeaderRowBackground(
- CDC & dc,
- const RECT & rcArea,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::ReportGrid_PaintHeaderRowBackground(
- dc,
- rcArea,
- pHelperSrc,
- lParam
- );
- if( ! CExtReportGridWnd::g_bmpHeaderAreaBk.IsEmpty() )
- {
- CExtReportGridWnd::g_bmpHeaderAreaBk.DrawSkinParts(
- dc,
- rcArea,
- CExtReportGridWnd::g_rcHeaderAreaPadding,
- CExtBitmap::__EDM_STRETCH
- );
- bool bDrawSeparator = false;
- if( pHelperSrc != NULL )
- {
- if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtReportGridColumn)) )
- {
- CExtReportGridWnd * pRGW = ((CExtReportGridColumn*)pHelperSrc)->GetReportGrid();
- ASSERT_VALID( pRGW );
- if( !( pRGW->m_bHelperRenderingGroupArea
- || pRGW->m_bHelperRenderingOuterDND
- )
- )
- bDrawSeparator = true;
- }
- }
- if( bDrawSeparator )
- {
- CRect rcSeparatorRight(
- rcArea.right - 1,
- rcArea.top + 2,
- rcArea.right,
- rcArea.bottom - 4
- );
- CRect rcSeparatorLeft(
- rcArea.left,
- rcArea.top + 2,
- rcArea.left + 1,
- rcArea.bottom - 4
- );
- dc.FillSolidRect(
- &rcSeparatorLeft,
- dc.GetNearestColor( RGB(255,255,255) )
- );
- dc.FillSolidRect(
- &rcSeparatorRight,
- dc.GetNearestColor( RGB(172,168,153) )
- );
- } // if( bDrawSeparator )
- return true;
- }
- return
- CExtPaintManagerXP::ReportGrid_PaintHeaderRowBackground(
- dc,
- rcArea,
- pHelperSrc,
- lParam
- );
- }
- bool CExtPaintManagerNativeXP::ReportGrid_PaintHeaderRowBackground(
- CDC & dc,
- const RECT & rcArea,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- bool bDefaultDrawing = true, bDrawCell = false;
- if( pHelperSrc != NULL )
- {
- if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtReportGridColumn)) )
- bDrawCell = true;
- }
- if( g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- HWND hWnd = NULL;
- if( pHelperSrc != NULL )
- {
- if( pHelperSrc->IsKindOf( RUNTIME_CLASS(CWnd) ) )
- hWnd = ((CWnd*)pHelperSrc)->GetSafeHwnd();
- if( hWnd == NULL )
- {
- if( pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtReportGridColumn) ) )
- hWnd = ((CExtReportGridColumn*)pHelperSrc)->GetReportGrid()->GetSafeHwnd();
- if( hWnd == NULL )
- hWnd = ::GetDesktopWindow();
- } // if( hWnd == NULL )
- } // if( pHelperSrc != NULL )
- if( hWnd != NULL
- && g_PaintManager.m_UxTheme.OpenThemeData( hWnd, VSCLASS_HEADER ) != NULL
- )
- {
- if( g_PaintManager.m_UxTheme.DrawThemeBackground(
- dc.GetSafeHdc(),
- HP_HEADERITEMRIGHT,
- HIRS_NORMAL,
- &rcArea,
- &rcArea
- ) == S_OK
- )
- bDefaultDrawing = false;
- g_PaintManager.m_UxTheme.CloseThemeData( true );
- }
- if( (! bDefaultDrawing ) && bDrawCell )
- {
- ASSERT( hWnd != NULL );
- if( g_PaintManager.m_UxTheme.OpenThemeData( hWnd, VSCLASS_HEADER ) != NULL )
- {
- INT nStateID = HIS_NORMAL;
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtReportGridColumn) )
- && ( (lParam&(__EGCPF_HOVER_BY_COLUMN|__EGCPF_OUTER_DND)) != 0
- || ((CExtReportGridColumn*)pHelperSrc)->GetReportGrid()->m_bHelperRenderingOuterDND
- )
- )
- nStateID = HIS_HOT;
- if( g_PaintManager.m_UxTheme.DrawThemeBackground(
- dc.GetSafeHdc(),
- HP_HEADERITEM,
- nStateID,
- &rcArea,
- &rcArea
- ) == S_OK
- )
- bDefaultDrawing = false;
- g_PaintManager.m_UxTheme.CloseThemeData( true );
- }
- } // if( (! bDefaultDrawing ) && bDrawCell )
- } // if( g_PaintManager.m_UxTheme.IsControlsThemed() )
- if( ! bDefaultDrawing )
- return true;
- return
- CExtPaintManager::ReportGrid_PaintHeaderRowBackground(
- dc,
- rcArea,
- pHelperSrc,
- lParam
- );
- }
- bool CExtPaintManagerOffice2007_Impl::ReportGrid_PaintHeaderRowBackground(
- CDC & dc,
- const RECT & rcArea,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::ReportGrid_PaintHeaderRowBackground(
- dc,
- rcArea,
- pHelperSrc,
- lParam
- );
- CRect rcAreaBk = rcArea;
- rcAreaBk.DeflateRect( 1, 1 );
- stat_PaintGradientRect(
- dc,
- rcAreaBk,
- m_clrRgHeaderBkBottom,
- m_clrRgHeaderBkTop,
- true
- );
- // bool bDrawBorder = false, bDrawSeparator = false;
- // if( pHelperSrc != NULL )
- // {
- // if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtReportGridWnd)) )
- // bDrawBorder = true;
- // else if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtReportGridColumn)) )
- // {
- // CExtReportGridWnd * pRGW = ((CExtReportGridColumn*)pHelperSrc)->GetReportGrid();
- // ASSERT_VALID( pRGW );
- // if( pRGW->m_bHelperRenderingGroupArea
- // || pRGW->m_bHelperRenderingOuterDND
- // )
- // bDrawBorder = true;
- // else
- // bDrawSeparator = true;
- // }
- // }
- // if( bDrawBorder )
- // dc.Draw3dRect(
- // &rcArea,
- // m_clrRgHeaderBorder,
- // m_clrRgHeaderBorder
- // );
- // if( bDrawSeparator )
- // {
- // CRect rcSeparator(
- // rcArea.right - 1,
- // rcArea.top + 3,
- // rcArea.right,
- // rcArea.bottom - 3
- // );
- // if( (! rcSeparator.IsRectEmpty() )
- // && dc.RectVisible( &rcSeparator )
- // )
- // dc.FillSolidRect( &rcSeparator, m_clrRgHeaderSeparator );
- // } // if( bDrawSeparator )
- bool bDrawSeparator = false, bDrawBorder = false;
- if( pHelperSrc != NULL )
- {
- if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtReportGridColumn)) )
- {
- CExtReportGridWnd * pRGW = ((CExtReportGridColumn*)pHelperSrc)->GetReportGrid();
- if( pRGW->m_bHelperRenderingGroupArea
- || pRGW->m_bHelperRenderingOuterDND
- )
- bDrawBorder = true;
- if( ( pRGW->BseGetStyleEx() & __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS ) == 0 )
- bDrawSeparator = true;
- else
- {
- LONG nColCount = pRGW->ColumnCountGet();
- if( nColCount > 0L )
- {
- CExtGridCell * pCell = pRGW->GridCellGetOuterAtTop( nColCount - 1L, 0L );
- ASSERT_VALID( pCell );
- if( LPVOID(pHelperSrc) != LPVOID(pCell) )
- bDrawSeparator = true;
- }
- }
- }
- else if( pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtReportGridWnd))
- && ( ((CExtReportGridWnd*)pHelperSrc)->m_bHelperRenderingGroupArea
- || ((CExtReportGridWnd*)pHelperSrc)->m_bHelperRenderingOuterDND
- )
- )
- bDrawBorder = true;
- } // if( pHelperSrc != NULL )
- if( bDrawSeparator )
- {
- CRect rcSeparator(
- rcArea.right - 1,
- rcArea.top + 3,
- rcArea.right,
- rcArea.bottom - 3
- );
- if( (! rcSeparator.IsRectEmpty() )
- && dc.RectVisible( &rcSeparator )
- )
- dc.FillSolidRect( &rcSeparator, m_clrRgHeaderSeparator );
- } // if( bDrawSeparator )
- if( bDrawBorder )
- dc.Draw3dRect(
- &rcArea,
- m_clrRgHeaderBorder,
- m_clrRgHeaderBorder
- );
- return true;
- }
- bool CExtPaintManager::ReportGrid_PaintHeaderSortArrow(
- CDC & dc,
- const RECT & rcSortArrow,
- bool bAscending,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcSortArrow;
- bAscending;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::ReportGrid_PaintHeaderSortArrow(
- CDC & dc,
- const RECT & rcSortArrow,
- bool bAscending,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- //bool bDefaultDrawing = true;
- // if( g_PaintManager.m_UxTheme.IsControlsThemed() )
- // {
- // HWND hWnd = NULL;
- // if( pHelperSrc != NULL )
- // {
- // if( pHelperSrc->IsKindOf( RUNTIME_CLASS(CWnd) ) )
- // hWnd = ((CWnd*)pHelperSrc)->GetSafeHwnd();
- // if( hWnd == NULL )
- // {
- // if( pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtReportGridColumn) ) )
- // hWnd = ((CExtReportGridColumn*)pHelperSrc)->GetReportGrid()->GetSafeHwnd();
- // if( hWnd == NULL )
- // hWnd = ::GetDesktopWindow();
- // } // if( hWnd == NULL )
- // } // if( pHelperSrc != NULL )
- // if( hWnd != NULL
- // && g_PaintManager.m_UxTheme.OpenThemeData( hWnd, VSCLASS_HEADER ) != NULL
- // )
- // {
- // if( g_PaintManager.m_UxTheme.DrawThemeBackground(
- // dc.GetSafeHdc(),
- // HP_HEADERSORTARROW,
- // bAscending ? HSAS_SORTEDUP : HSAS_SORTEDDOWN,
- // &rcSortArrow,
- // &rcSortArrow
- // ) == S_OK
- // )
- // bDefaultDrawing = false;
- // g_PaintManager.m_UxTheme.CloseThemeData( true );
- // }
- // } // if( g_PaintManager.m_UxTheme.IsControlsThemed() )
- // if( ! bDefaultDrawing )
- // return true;
- // return
- // CExtPaintManager::ReportGrid_PaintHeaderSortArrow(
- // dc,
- // rcSortArrow,
- // bAscending,
- // pHelperSrc,
- // lParam
- // );
- pHelperSrc;
- lParam;
- COLORREF ColorValues[2] =
- {
- RGB(0,0,0),
- ::GetSysColor(COLOR_3DSHADOW),
- };
- PaintGlyphCentered(
- dc,
- rcSortArrow,
- *( g_DockingCaptionGlyphs[
- bAscending
- ? __DCBT_2007_ARROW_SORT_UP
- : __DCBT_2007_ARROW_SORT_DOWN
- ] ),
- ColorValues
- );
- return true;
- }
- bool CExtPaintManagerOffice2007_Impl::ReportGrid_PaintHeaderSortArrow(
- CDC & dc,
- const RECT & rcSortArrow,
- bool bAscending,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::ReportGrid_PaintHeaderSortArrow(
- dc,
- rcSortArrow,
- bAscending,
- pHelperSrc,
- lParam
- );
-
- COLORREF ColorValues[2] =
- {
- RGB(0,0,0),
- m_clrRgHeaderSortArrow,
- };
- PaintGlyphCentered(
- dc,
- rcSortArrow,
- *( g_DockingCaptionGlyphs[
- bAscending
- ? __DCBT_2007_ARROW_SORT_UP
- : __DCBT_2007_ARROW_SORT_DOWN
- ] ),
- ColorValues
- );
- return true;
- }
- bool CExtPaintManager::ReportGrid_PaintGroupAreaBackground(
- CDC & dc,
- const RECT & rcArea,
- __EXT_MFC_SAFE_LPCTSTR strEmptyAreaCaption, // not NULL if area is empty
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcArea;
- strEmptyAreaCaption;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::ReportGrid_PaintGroupAreaBackground(
- CDC & dc,
- const RECT & rcArea,
- __EXT_MFC_SAFE_LPCTSTR strEmptyAreaCaption, // not NULL if area is empty
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcArea;
- strEmptyAreaCaption;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerOffice2007_Impl::ReportGrid_PaintGroupAreaBackground(
- CDC & dc,
- const RECT & rcArea,
- __EXT_MFC_SAFE_LPCTSTR strEmptyAreaCaption, // not NULL if area is empty
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::ReportGrid_PaintGroupAreaBackground(
- dc,
- rcArea,
- strEmptyAreaCaption,
- pHelperSrc,
- lParam
- );
- dc.FillSolidRect( &rcArea, m_clrRgGroupAreaBk );
- INT nTextLen = 0;
- if( strEmptyAreaCaption != NULL
- && ( nTextLen = INT( _tcslen( strEmptyAreaCaption ) ) ) > 0
- )
- {
- CRect rcCaption = rcArea;
- rcCaption.DeflateRect( 5, 5, 0, 5 );
- int nOldBkMode = dc.SetBkMode( TRANSPARENT );
- COLORREF clrOldTextColor = dc.SetTextColor( m_clrRgGroupAreaText );
- dc.DrawText(
- LPCTSTR(strEmptyAreaCaption),
- nTextLen,
- rcCaption,
- DT_SINGLELINE|DT_NOCLIP
- );
- dc.SetTextColor( clrOldTextColor );
- dc.SetBkMode( nOldBkMode );
- }
- return true;
- }
- bool CExtPaintManager::ReportGrid_PaintGroupAreaItemBackground(
- CDC & dc,
- const RECT & rcItem,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- dc;
- rcItem;
- pHelperSrc;
- lParam;
- return false;
- }
- COLORREF CExtPaintManager::ReportGrid_GetGroupConnectorColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- pHelperSrc;
- lParam;
- return COLORREF(-1L);
- }
- COLORREF CExtPaintManager::ReportGrid_GetHeaderTextColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtReportGridColumn) )
- )
- {
- if( (lParam&__EGCPF_HIGHLIGHTED_BY_PRESSED_COLUMN) != 0 )
- return GetColor( COLOR_HIGHLIGHTTEXT, pHelperSrc, lParam );
- else
- return GetColor( COLOR_BTNTEXT, pHelperSrc, lParam );
- }
- return COLORREF(-1L);
- }
- COLORREF CExtPaintManagerNativeXP::ReportGrid_GetHeaderTextColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtReportGridColumn) )
- )
- {
- if( (lParam&__EGCPF_HIGHLIGHTED_BY_PRESSED_COLUMN) != 0 )
- return ::GetSysColor( COLOR_HIGHLIGHTTEXT );
- else
- return ::GetSysColor( COLOR_BTNTEXT );
- }
- return COLORREF(-1L);
- }
- COLORREF CExtPaintManagerOffice2007_Impl::ReportGrid_GetHeaderTextColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::ReportGrid_GetHeaderTextColor(
- pHelperSrc,
- lParam
- );
- if( pHelperSrc != NULL
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtReportGridColumn) )
- )
- {
- if( (lParam&__EGCPF_HIGHLIGHTED_BY_PRESSED_COLUMN) != 0 )
- return GetColor( COLOR_HIGHLIGHTTEXT, pHelperSrc, lParam );
- else
- return m_clrRgHeaderText;
- }
- return COLORREF(-1L);
- }
- #endif // (!defined __EXT_MFC_NO_REPORTGRIDWND)
- CSize CExtPaintManager::GetTextSizes(
- bool bBold // = false
- )
- {
- ASSERT_VALID( this );
- CWindowDC dc( NULL );
- CFont * pOldFont =
- dc.SelectObject(
- bBold ? &m_FontBold : &m_FontNormal
- );
- ASSERT( pOldFont != NULL );
- TEXTMETRIC tm;
- dc.GetTextMetrics( &tm );
- int nTextHeightHorz = tm.tmHeight + 2;
- dc.SelectObject( &m_FontNormal );
- dc.GetTextMetrics( &tm );
- int nTextHeightVert = tm.tmHeight + 2;
- dc.SelectObject( pOldFont );
- return CSize(nTextHeightHorz,nTextHeightVert);
- }
- int CExtPaintManager::GetTextHeight(
- bool bHorz
- )
- {
- ASSERT_VALID( this );
- CSize _size = GetTextSizes();
- return bHorz ? _size.cx : _size.cy;
- }
- int CExtPaintManager::GetMenuExpandButtonHeight()
- {
- ASSERT_VALID( this );
- int nHeight = ::GetSystemMetrics(SM_CYMENUCHECK);
- ASSERT( nHeight > 0 );
- return nHeight;
- }
- int CExtPaintManagerXP::GetMenuExpandButtonHeight()
- {
- ASSERT_VALID( this );
- return CExtPaintManager::GetMenuExpandButtonHeight();
- }
- int CExtPaintManagerOffice2003::GetMenuExpandButtonHeight()
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return CExtPaintManagerXP::GetMenuExpandButtonHeight();
- int nHeightNormal = CExtPaintManager::GetMenuExpandButtonHeight();
- ASSERT( nHeightNormal > 0 );
- return max( nHeightNormal, 18 );
- }
- void CExtPaintManager::PaintMenuScrollButton(
- CDC & dc,
- bool bHover,
- bool bPushed,
- bool bTopButton,
- const RECT & rcScrollButton,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- bPushed = bPushed || bHover;
- CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- true,
- rcScrollButton,
- bTopButton ? _T("t") : _T("u"), // up arrow / down arrow
- NULL,
- true,
- false, // bHover,
- bPushed,
- false,
- true,true,false,false,
- __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
- (HFONT)m_FontMarlett.GetSafeHandle()
- );
- _ppbd.m_lParam = lParam;
- PaintPushButton( dc, _ppbd );
- }
- void CExtPaintManagerXP::PaintMenuScrollButton(
- CDC & dc,
- bool bHover,
- bool bPushed,
- bool bTopButton,
- const RECT & rcScrollButton,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- bool bTransparentBk = false;
- bool bDrawBorder = true;
- bPushed = bPushed || bHover;
- if( bPushed )
- {
- PAINTMENUITEMDATA _pmid; // fake
- _pmid.m_bSelected = true;
- if( PaintMenuItemBackgroundXP( dc, _pmid, rcScrollButton )
- || PaintMenuItemSelectionAreaXP( dc, _pmid, rcScrollButton )
- )
- {
- bTransparentBk = true;
- bDrawBorder = false;
- bPushed = bHover = false;
- }
- }
- CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- true, // bHorz
- rcScrollButton,
- bTopButton ? _T("t") : _T("u"), // up arrow / down arrow
- NULL, // pIcon
- true, // bFlat
- bHover,
- bPushed,
- false, // bIndeterminate
- true, // bEnabled
- bDrawBorder,
- false, // bDrawFocusRect
- false, // bDefaultPushButton
- __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
- (HFONT)m_FontMarlett.GetSafeHandle(),
- false, // bDropDown
- 0, // nHelperSysCmdID
- bTransparentBk
- );
- _ppbd.m_lParam = lParam;
- PaintPushButton( dc, _ppbd );
- }
- void CExtPaintManager::PaintMenuTearOffButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- bPushed;
- bHover;
- pHelperSrc;
- lParam;
- CRect rcGlyph( rectButton );
- rcGlyph.DeflateRect( 1, 0, 0, 1 );
- dc.FillSolidRect(
- &rcGlyph,
- GetColor( COLOR_HIGHLIGHT )
- );
- }
- void CExtPaintManagerXP::PaintMenuTearOffButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- pHelperSrc;
- lParam;
- CRect rcGlyph( rectButton );
- rcGlyph.DeflateRect( 0, 0, 0, 1 );
- dc.FillSolidRect( &rcGlyph, GetColor( ( bHover || bPushed ) ? CLR_3DFACE_IN : XPCLR_3DFACE_DARK ) );
- static const int g_nXpTearOffBtnLinesWidth = 33;
- CRect rcLines = rcGlyph;
- rcLines.OffsetRect( (rcLines.Width() - g_nXpTearOffBtnLinesWidth) / 2, 0 );
- rcLines.right = rcLines.left + g_nXpTearOffBtnLinesWidth;
- if( bHover || bPushed )
- {
- COLORREF clrBorder = GetColor( XPCLR_HILIGHT_BORDER );
- dc.Draw3dRect( &rcGlyph, clrBorder, clrBorder );
- rcLines.DeflateRect( 0, 2 );
- COLORREF clrLine = GetColor( COLOR_BTNTEXT );
- int yStep = rcLines.top;
- for( ; yStep < rcLines.bottom; yStep += 2 )
- dc.FillSolidRect( rcLines.left, yStep, rcLines.Width(), 1, clrLine );
- } // if( bHover || bPushed )
- else
- {
- rcLines.DeflateRect( 0, 1 );
- COLORREF clrLine = GetColor( COLOR_3DSHADOW );
- int yStep = rcLines.top;
- for( ; yStep < rcLines.bottom; yStep += 2 )
- dc.FillSolidRect( rcLines.left, yStep, rcLines.Width(), 1, clrLine );
- } // else from if( bHover || bPushed )
- }
- void CExtPaintManagerOffice2003::PaintMenuTearOffButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintMenuTearOffButton( dc, rectButton, bPushed, bHover, pHelperSrc, lParam );
- return;
- }
- CRect rcGlyph( rectButton );
- rcGlyph.DeflateRect( 0, 0, 0, 1 );
- dc.FillSolidRect( &rcGlyph, GetColor( ( bHover || bPushed ) ? CLR_3DFACE_IN : XPCLR_3DFACE_DARK ) );
- static const int g_n2003TearOffBtnSpaceNormal = 36;
- static const int g_n2003TearOffBtnSpaceSmall = 10;
- CRect rcBoxes = rcGlyph;
- rcBoxes.DeflateRect( g_n2003TearOffBtnSpaceNormal, 0 );
- if( rcBoxes.Width() < g_n2003TearOffBtnSpaceSmall )
- {
- rcBoxes = rcGlyph;
- rcBoxes.DeflateRect( g_n2003TearOffBtnSpaceSmall, 0 );
- }
- static const CSize g_sizeGripDot( 2, 2 );
- static const CSize g_sizeGripDist( 1, 1 );
- static const CSize g_sizeGripShadowOffset( 1, 1 );
- rcBoxes.DeflateRect( 0, ( rcBoxes.Height() - g_sizeGripDot.cy - g_sizeGripShadowOffset.cy ) / 2 );
- if( bHover || bPushed )
- {
- COLORREF clrBorder = GetColor( XPCLR_HILIGHT_BORDER );
- dc.Draw3dRect( &rcGlyph, clrBorder, clrBorder );
- } // if( bHover || bPushed )
- if( rcBoxes.left < rcBoxes.right )
- {
- COLORREF clrDotShadow = GetColor( _2003CLR_GRIPPER_DOT_LIGHT );
- COLORREF clrDotFace = GetColor( _2003CLR_GRIPPER_DOT_DARK );
- CRect rcDotFace( rcBoxes.TopLeft(), g_sizeGripDot );
- CRect rcDotShadow( rcDotFace );
- rcDotShadow.OffsetRect( g_sizeGripShadowOffset );
- int nStepH = g_sizeGripDot.cx + g_sizeGripDist.cx + g_sizeGripShadowOffset.cx;
- for( ; (rcDotShadow.right+g_sizeGripDist.cx) < rcBoxes.right; )
- {
- dc.FillSolidRect( &rcDotShadow, clrDotShadow );
- dc.FillSolidRect( &rcDotFace, clrDotFace );
- rcDotFace.OffsetRect( nStepH, 0 );
- rcDotShadow.OffsetRect( nStepH, 0 );
- }
- } // if( rcBoxes.left < rcBoxes.right )
- }
- void CExtPaintManager::PaintMenuExpandButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- bHover;
-
- CRect rcGlyph(rectButton);
- rcGlyph.DeflateRect(1,0);
- if( bPushed )
- {
- dc.FillRect(
- &rcGlyph,
- &m_brushLightDefault
- );
- dc.Draw3dRect(
- &rcGlyph,
- GetColor( CLR_3DHILIGHT_OUT, pHelperSrc, lParam ),
- GetColor( CLR_3DSHADOW_OUT, pHelperSrc, lParam )
- );
- }
- else
- {
- CExtPaintManager::PAINTMENUITEMDATA _pmid(
- pHelperSrc,
- rcGlyph, rectButton, 0, _T(""),
- _T(""), NULL,
- false, false, false,
- false, false, true, false, false, false,
- 0, NULL
- );
- PaintMenuItem( dc, _pmid );
- }
- COLORREF ColorValues[] =
- {
- RGB(0,0,0),
- GetColor( CLR_MENUTEXT_OUT, pHelperSrc, lParam )
- };
- PaintGlyphCentered(
- dc,
- rcGlyph,
- g_glyph_btn_expand_bottom2,
- ColorValues
- );
- }
- void CExtPaintManagerXP::PaintMenuExpandButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- bHover;
- bool bRTL = false;
- if( pHelperSrc != NULL )
- {
- ASSERT_VALID( pHelperSrc );
- CExtPopupMenuWnd * pPopup = DYNAMIC_DOWNCAST( CExtPopupMenuWnd, pHelperSrc );
- if( pPopup != NULL )
- bRTL = pPopup->OnQueryLayoutRTL();
- } // if( pHelperSrc != NULL )
- int nIconAreaWidth = 0;
- if( pHelperSrc != NULL // (+ 2.23)
- && pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPopupMenuWnd) )
- && ((CExtPopupMenuWnd*)pHelperSrc) ->
- ItemGetCount() > 0
- )
- {
- CExtPopupMenuWnd::MENUITEMDATA & _mii =
- ((CExtPopupMenuWnd*)pHelperSrc) ->
- ItemGetInfo(
- ((CExtPopupMenuWnd*)pHelperSrc) ->
- ItemGetCount()
- - 1
- );
- if( ! _mii.IsToolButton() )
- nIconAreaWidth = _mii.GetIconAreaWidth();
- }
- CRect rcGlyph(rectButton);
- rcGlyph.DeflateRect( 1, 0 );
- if( bPushed )
- {
- CExtPaintManager::PAINTMENUITEMDATA _pmid; // fake
- _pmid.m_bSelected = true;
- if( ! PaintMenuItemBackgroundXP( dc, _pmid, rcGlyph ) )
- {
- if( ! PaintMenuItemSelectionAreaXP( dc, _pmid, rcGlyph ) )
- {
- PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- true,rcGlyph,_T(""),NULL,
- true,false,bPushed,false,
- false,true,false,false,
- __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
- NULL,
- false
- );
- PaintPushButton( dc, _ppbd );
- rcGlyph.OffsetRect(
- GetPushedOffset()
- );
- }
- }
- }
- else
- {
- CExtPaintManager::PAINTMENUITEMDATA _pmid(
- pHelperSrc,
- rcGlyph, rectButton, nIconAreaWidth, _T(""),
- _T(""), NULL,
- false, false, false,
- false, false, true, false, false, false,
- 0, NULL
- );
- PaintMenuItem( dc, _pmid );
- }
- COLORREF ColorValues[] =
- {
- RGB(0,0,0),
- GetColor( CLR_MENUTEXT_OUT, pHelperSrc, lParam )
- };
- PaintGlyphCentered(
- dc,
- rcGlyph,
- g_glyph_btn_expand_bottom2,
- ColorValues
- );
- }
- void CExtPaintManagerOffice2003::PaintMenuExpandButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintMenuExpandButton(
- dc,
- rectButton,
- bPushed,
- bHover,
- pHelperSrc,
- lParam
- );
- return;
- }
- bool bRTL = false;
- CExtPopupMenuWnd * pPopup = NULL;
- if( pHelperSrc != NULL )
- {
- ASSERT_VALID( pHelperSrc );
- pPopup = DYNAMIC_DOWNCAST( CExtPopupMenuWnd, pHelperSrc );
- if( pPopup != NULL )
- bRTL = pPopup->OnQueryLayoutRTL();
- } // if( pHelperSrc != NULL )
- CRect rcButton( rectButton );
- if( ( rcButton.Width() & 0x01 ) != 0 )
- {
- if( bRTL )
- rcButton.left ++;
- else
- rcButton.right --;
- } // if( ( rcButton.Width() & 0x01 ) != 0 )
- int nIconAreaWidth = 0;
- if( pPopup != NULL
- && pPopup->ItemGetCount() > 0
- )
- {
- CExtPopupMenuWnd::MENUITEMDATA & _mii =
- pPopup->ItemGetInfo( pPopup->ItemGetCount() - 1 );
- if( ! _mii.IsToolButton() )
- nIconAreaWidth = _mii.GetIconAreaWidth();
- }
- if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8 )
- {
- CExtPaintManagerXP::PaintMenuExpandButton(
- dc,
- rectButton,
- bPushed,
- bHover,
- pHelperSrc,
- lParam
- );
- return;
- }
- CRect rcGlyph( rectButton );
- rcGlyph.DeflateRect( 1, 0 );
- if( bPushed )
- {
- CExtPaintManager::PAINTMENUITEMDATA _pmid; // fake
- _pmid.m_bSelected = true;
-
- if( ! PaintMenuItemBackgroundXP( dc, _pmid, rcGlyph ) )
- {
- if( ! PaintMenuItemSelectionAreaXP( dc, _pmid, rcGlyph ) )
- {
- PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- true,rcGlyph,_T(""),NULL,
- true,false,bPushed,false,
- false,true,false,false,
- __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
- NULL,
- false
- );
- PaintPushButton( dc, _ppbd );
- rcGlyph.OffsetRect(
- GetPushedOffset()
- );
- }
- }
- }
- else
- {
- CExtPaintManager::PAINTMENUITEMDATA _pmid(
- pHelperSrc,
- rcGlyph, rectButton, nIconAreaWidth, _T(""),
- _T(""), NULL,
- false, bHover, false,
- false, false, true, false, false, false,
- 0, NULL
- );
- PaintMenuItem( dc, _pmid );
- }
- // paint expand circle with gradient
- CRect rcCircle( rcButton );
- rcCircle.NormalizeRect();
- CPoint ptDest = rcCircle.TopLeft();
- ptDest.x +=
- (rcCircle.Width() - 16) / 2;
- ptDest.y +=
- (rcCircle.Height() - 16) / 2;
- const BYTE _CircleMask[16*16] =
- {
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0xC6, 0xB4, 0xB4, 0xB4, 0xC6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xEA, 0xEA, 0xEA, 0xEA, 0xC6, 0xB4, 0x90, 0x7E, 0x7E, 0xC6, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xEA, 0xFC, 0xFC, 0xEA, 0xEA, 0xC6, 0xB4, 0x90, 0x7E, 0x6C, 0x5A, 0x90, 0xFF, 0xFF,
- 0xFF, 0xEA, 0xFC, 0xFC, 0xFC, 0xEA, 0xEA, 0xC6, 0xB4, 0x90, 0x7E, 0x6C, 0x5A, 0x36, 0x7E, 0xFF,
- 0xFF, 0xFC, 0xFC, 0xFC, 0xFC, 0xEA, 0xEA, 0xC6, 0xB4, 0x90, 0x7E, 0x6C, 0x5A, 0x36, 0x24, 0xFF,
- 0xEA, 0xFC, 0xFC, 0xFC, 0xFC, 0xEA, 0xEA, 0xC6, 0xB4, 0x90, 0x7E, 0x6C, 0x48, 0x36, 0x24, 0x5A,
- 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xC6, 0xB4, 0x90, 0x90, 0x7E, 0x6C, 0x48, 0x24, 0x12, 0x24,
- 0xC6, 0xEA, 0xEA, 0xEA, 0xC6, 0xC6, 0xC6, 0xB4, 0x90, 0x7E, 0x7E, 0x48, 0x36, 0x24, 0x12, 0x12,
- 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xB4, 0xB4, 0x90, 0x7E, 0x7E, 0x6C, 0x48, 0x36, 0x12, 0x12, 0x00,
- 0xC6, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0x90, 0x7E, 0x7E, 0x6C, 0x5A, 0x36, 0x24, 0x12, 0x00, 0x00,
- 0xC6, 0x90, 0x90, 0x90, 0x90, 0x90, 0x7E, 0x7E, 0x6C, 0x6C, 0x48, 0x36, 0x24, 0x12, 0x00, 0x36,
- 0xFF, 0x90, 0x7E, 0x7E, 0x7E, 0x7E, 0x6C, 0x6C, 0x5A, 0x5A, 0x36, 0x24, 0x12, 0x00, 0x00, 0xFF,
- 0xFF, 0xC6, 0x6C, 0x6C, 0x6C, 0x6C, 0x5A, 0x5A, 0x5A, 0x48, 0x36, 0x24, 0x12, 0x00, 0x48, 0xFF,
- 0xFF, 0xFF, 0xB4, 0x6C, 0x5A, 0x5A, 0x5A, 0x48, 0x48, 0x36, 0x24, 0x12, 0x00, 0x36, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xC6, 0x5A, 0x48, 0x48, 0x48, 0x36, 0x24, 0x24, 0x12, 0x6C, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, 0x6C, 0x48, 0x36, 0x5A, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- };
-
- COLORREF clrLight =
- GetColor( CExtPaintManagerOffice2003::_2003CLR_EXPBTN_CIRCLE_LIGHT, pHelperSrc, lParam );
- COLORREF clrDark =
- GetColor( CExtPaintManagerOffice2003::_2003CLR_EXPBTN_CIRCLE_DARK, pHelperSrc, lParam );
- for( int i = 0; i < 16 * 16; i++ )
- {
- int nPixel = _CircleMask[i];
-
- int nRed =
- GetRValue(clrDark) -
- nPixel*(GetRValue(clrDark) -
- GetRValue(clrLight)) / 0xFF;
-
- int nGreen =
- GetGValue(clrDark) -
- nPixel*( GetGValue(clrDark) -
- GetGValue(clrLight)) / 0xFF;
-
- int nBlue =
- GetBValue(clrDark) -
- nPixel*( GetBValue(clrDark) -
- GetBValue(clrLight)) / 0xFF;
- if( nPixel != 0xFF )
- dc.SetPixel(
- ptDest.x + i / 16,
- ptDest.y + i % 16,
- RGB(nRed, nGreen, nBlue)
- );
- }
-
- COLORREF ColorValues[] =
- {
- RGB(0,0,0),
- GetColor( CLR_MENUTEXT_OUT, pHelperSrc, lParam )
- };
- PaintGlyphCentered(
- dc,
- rcButton,
- g_glyph_btn_expand_bottom2,
- ColorValues
- );
- }
- void CExtPaintManagerNativeXP::PaintMenuExpandButton(
- CDC & dc,
- const RECT & rectButton,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- CExtPaintManager::PaintMenuExpandButton(
- dc,
- rectButton,
- bPushed,
- bHover,
- pHelperSrc,
- lParam
- );
- return;
- } // if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- CWnd * pWnd = DYNAMIC_DOWNCAST( CWnd, pHelperSrc );
- ASSERT( pWnd != NULL );
- ASSERT_VALID( pWnd );
-
- CRect rcGlyph(rectButton);
- rcGlyph.DeflateRect(1,0);
-
- INT nPartID = TP_BUTTON;
- INT nStateID = bHover ? TS_HOT : ( bPushed ? TS_PRESSED : TS_NORMAL );
- if( g_PaintManager.m_UxTheme.OpenThemeData( pWnd->GetSafeHwnd(), VSCLASS_TOOLBAR ) != NULL )
- {
- VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pWnd->GetSafeHwnd(),
- dc.GetSafeHdc(),
- nPartID,
- nStateID,
- &rcGlyph,
- &rcGlyph
- ) == S_OK
- );
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- COLORREF ColorValues[] =
- {
- RGB(0,0,0),
- ::GetSysColor( COLOR_BTNTEXT )
- };
- PaintGlyphCentered(
- dc,
- rcGlyph,
- g_glyph_btn_expand_bottom2,
- ColorValues
- );
- }
- CSize CExtPaintManager::FixedBar_GetRoundedAreaMerics() const
- {
- ASSERT_VALID( this );
- return CSize( 0, 0 );
- }
- CSize CExtPaintManagerXP::FixedBar_GetRoundedAreaMerics() const
- {
- ASSERT_VALID( this );
- return CExtPaintManager::FixedBar_GetRoundedAreaMerics();
- }
- CSize CExtPaintManagerOffice2003::FixedBar_GetRoundedAreaMerics() const
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return CExtPaintManagerXP::FixedBar_GetRoundedAreaMerics();
- return CSize( 4, 4 );
- }
- void CExtPaintManager::PaintToolbarExpandButton(
- CDC & dc,
- const RECT & rcButtonArea,
- bool bHorz, // if false - down
- bool bBarIsCompletelyVisible,
- bool bEnabled,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bTransparentBackground // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CRect rect(rcButtonArea);
- rect.NormalizeRect();
- if( !dc.RectVisible( &rect ) )
- return;
- CRect rectButton(rect);
- const glyph_t * pGlyph = NULL, * pGlyph2 = NULL;
- if( bHorz )
- {
- pGlyph = &g_glyph_btn_expand_bottom;
- if( !bBarIsCompletelyVisible )
- pGlyph2 = &g_glyph_btn_expand_right2;
- }
- else
- {
- pGlyph = &g_glyph_btn_expand_left;
- if( !bBarIsCompletelyVisible )
- pGlyph2 = &g_glyph_btn_expand_bottom2;
- }
- ASSERT( pGlyph != NULL );
- PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- true,rect,_T(""),NULL,true,
- bHover,bPushed,false,bEnabled,
- true,false,false,
- __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
- NULL,false,0,bTransparentBackground
- );
- PaintPushButton( dc, _ppbd );
- COLORREF clr =
- GetColor(
- bEnabled ? CLR_TEXT_OUT : COLOR_3DHILIGHT, pHelperSrc, lParam
- );
- COLORREF ColorValues[] =
- {
- 0,
- clr
- };
- if( bPushed )
- rect.OffsetRect(
- GetPushedOffset()
- );
- CRect rectGlyph(rectButton.TopLeft(),pGlyph->Size());
- CRect rectGlyph2(rectGlyph);
- CSize sizePushedOffset = GetPushedOffset();
- if( bPushed )
- {
- rectGlyph.OffsetRect( sizePushedOffset );
- rectGlyph2.OffsetRect( sizePushedOffset );
- }
- if( bHorz )
- {
- int nGap = (max(sizePushedOffset.cy,1)) * 3;
- rectGlyph.OffsetRect(
- (rectButton.Size().cx - pGlyph->Size().cx) / 2,
- rectButton.Size().cy - pGlyph->Size().cy - nGap
- );
- if( !bBarIsCompletelyVisible )
- {
- ASSERT( pGlyph2 != NULL );
- rectGlyph2.OffsetRect(
- (rectButton.Size().cx - pGlyph2->Size().cx) / 2,
- nGap
- );
- }
- }
- else
- {
- int nGap = (max(sizePushedOffset.cx,1)) * 3;
- rectGlyph.OffsetRect(
- nGap,
- (rectButton.Size().cy - pGlyph->Size().cy)/2
- );
- if( !bBarIsCompletelyVisible )
- {
- ASSERT( pGlyph2 != NULL );
- rectGlyph2.OffsetRect(
- rectButton.Size().cx - pGlyph2->Size().cx - nGap,
- (rectButton.Size().cy - pGlyph2->Size().cy) / 2
- );
- }
- }
- if( bEnabled )
- {
- PaintGlyph(
- dc,rectGlyph.TopLeft(),*pGlyph,ColorValues
- );
- if( !bBarIsCompletelyVisible )
- {
- ASSERT( pGlyph2 != NULL );
- PaintGlyph(
- dc,rectGlyph2.TopLeft(),*pGlyph2,ColorValues
- );
- }
- } // if( bEnabled )
- else
- {
- // rect.OffsetRect(1,1);
- // PaintGlyphCentered(
- // dc,rect,*pGlyph,ColorValues
- // );
- // ColorValues[1] = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- // rect.OffsetRect(-1,-1);
- // PaintGlyphCentered(
- // dc,rect,*pGlyph,ColorValues
- // );
- rectGlyph.OffsetRect(1,1);
- PaintGlyph(
- dc,rectGlyph.TopLeft(),*pGlyph,ColorValues
- );
- rectGlyph.OffsetRect(-1,-1);
- ColorValues[1] = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- PaintGlyph(
- dc,rectGlyph.TopLeft(),*pGlyph,ColorValues
- );
- } // else from if( bEnabled )
- }
- void CExtPaintManagerXP::PaintToolbarExpandButton(
- CDC & dc,
- const RECT & rcButtonArea,
- bool bHorz, // if false - down
- bool bBarIsCompletelyVisible,
- bool bEnabled,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bTransparentBackground // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CRect rect(rcButtonArea);
- rect.NormalizeRect();
- if( !dc.RectVisible( &rect ) )
- return;
- CRect rectButton(rect);
- const glyph_t * pGlyph = NULL, * pGlyph2 = NULL;
- if( bHorz )
- {
- pGlyph = m_pGlyphTbEpBtnH0;
- pGlyph2 = m_pGlyphTbEpBtnH1;
- } // if( bHorz )
- else
- {
- pGlyph = m_pGlyphTbEpBtnV0;
- pGlyph2 = m_pGlyphTbEpBtnV1;
- } // else from if( bHorz )
- ASSERT( pGlyph != NULL );
- ASSERT( pGlyph2 != NULL );
- PAINTPUSHBUTTONDATA _ppbd(
- pHelperSrc,
- true,rect,_T(""),NULL,true,
- bHover,bPushed,false,bEnabled,
- true,false,false,
- __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
- NULL,false,0,bTransparentBackground
- );
- PaintPushButton( dc, _ppbd );
- COLORREF clr =
- GetColor(
- bEnabled ? CLR_TEXT_OUT : COLOR_3DHILIGHT, pHelperSrc, lParam
- );
- COLORREF ColorValues[] =
- {
- 0,
- clr
- };
- if( bPushed )
- rect.OffsetRect( GetPushedOffset() );
- CRect rectGlyph(rectButton.TopLeft(),pGlyph->Size());
- CRect rectGlyph2(rectGlyph);
- CSize sizePushedOffset = GetPushedOffset();
- if( bPushed )
- {
- rectGlyph.OffsetRect( sizePushedOffset );
- rectGlyph2.OffsetRect( sizePushedOffset );
- } // if( bPushed )
- if( bHorz )
- {
- int nGap = (max(sizePushedOffset.cy,1)) * 3;
- rectGlyph.OffsetRect(
- (rectButton.Size().cx - pGlyph->Size().cx) / 2, // + 1
- rectButton.Size().cy - pGlyph->Size().cy - nGap
- );
- rectGlyph2.OffsetRect(
- (rectButton.Size().cx - pGlyph2->Size().cx) / 2 + 1,
- nGap
- );
- } // if( bHorz )
- else
- {
- int nGap = (max(sizePushedOffset.cx,1)) * 3;
- rectGlyph.OffsetRect(
- nGap,
- (rectButton.Size().cy - pGlyph->Size().cy)/2 // + 1
- );
- rectGlyph2.OffsetRect(
- rectButton.Size().cx - pGlyph2->Size().cx - nGap,
- (rectButton.Size().cy - pGlyph2->Size().cy) / 2 + 1
- );
- if( m_bExpBtnSwapVGlyphs )
- {
- CRect rcTmp( rectGlyph );
- rectGlyph = rectGlyph2;
- rectGlyph2 = rcTmp;
- }
- } // else from if( bHorz )
- if( bEnabled )
- {
- // if( bHover && (!bPushed) )
- // {
- // COLORREF ColorValuesHover[] =
- // {
- // 0,
- // GetColor( COLOR_3DDKSHADOW, pHelperSrc, lParam )
- // };
- // rectGlyph.OffsetRect(-1,-1);
- // rectGlyph2.OffsetRect(-1,-1);
- // PaintGlyph(
- // dc,rectGlyph.TopLeft(),*pGlyph,ColorValuesHover
- // );
- // if( !bBarIsCompletelyVisible )
- // PaintGlyph(
- // dc,rectGlyph2.TopLeft(),*pGlyph2,ColorValuesHover
- // );
- // rectGlyph.OffsetRect(1,1);
- // rectGlyph2.OffsetRect(1,1);
- // }
- PaintGlyph(
- dc,rectGlyph.TopLeft(),*pGlyph,ColorValues
- );
- if( !bBarIsCompletelyVisible )
- PaintGlyph(
- dc,rectGlyph2.TopLeft(),*pGlyph2,ColorValues
- );
- } // if( bEnabled )
- else
- {
- ColorValues[1] = GetColor( COLOR_3DSHADOW, pHelperSrc, lParam );
- PaintGlyph(
- dc,rectGlyph.TopLeft(),*pGlyph,ColorValues
- );
- } // else from if( bEnabled )
- }
- void CExtPaintManagerOffice2003::PaintToolbarExpandButton(
- CDC & dc,
- const RECT & rcButtonArea,
- bool bHorz, // if false - down
- bool bBarIsCompletelyVisible,
- bool bEnabled,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bTransparentBackground // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::PaintToolbarExpandButton(
- dc,
- rcButtonArea,
- bHorz,
- bBarIsCompletelyVisible,
- bEnabled,
- bPushed,
- bHover,
- pHelperSrc,
- lParam,
- bTransparentBackground
- );
- return;
- }
- CRect rect(rcButtonArea);
- rect.NormalizeRect();
- if( !dc.RectVisible( &rect ) )
- return;
- CExtToolControlBar * pToolBar = NULL;
- bool bStyleOffice2003 = true;
- if( pHelperSrc == NULL
- || (! bEnabled)
- || (! pHelperSrc->IsKindOf(RUNTIME_CLASS(CExtBarContentExpandButton)) )
- || (! GetCb2DbTransparentMode(pHelperSrc) )
- || ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8
- )
- {
- bStyleOffice2003 = false;
- }
- else
- {
- pToolBar = ((CExtBarContentExpandButton*)pHelperSrc)->GetBar();
- ASSERT_VALID( pToolBar );
- if( pToolBar->m_bPaletteMode
- || pToolBar->IsFloating()
- || pToolBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar))
- || pToolBar->IsKindOf(RUNTIME_CLASS(CExtPanelControlBar))
- || (
- ( pToolBar->m_pDockSite == NULL || pToolBar->m_bPresubclassDialogMode )
- && !pToolBar->m_bForceBalloonGradientInDialogs
- )
- )
- bStyleOffice2003 = false;
- }
- if( !bStyleOffice2003 )
- {
- CExtPaintManagerXP::PaintToolbarExpandButton(
- dc,
- rcButtonArea,
- bHorz,
- bBarIsCompletelyVisible,
- bEnabled,
- bPushed,
- bHover,
- pHelperSrc,
- lParam,
- bTransparentBackground
- );
- return;
- }
- ASSERT_VALID( pToolBar );
- CRect rcToolbarClientArea;
- pToolBar->GetClientRect( &rcToolbarClientArea );
- CRect rectButton( rect );
- CRect rcBaloonExclude( rcToolbarClientArea );
- CSize _sizeRoundedAreaMerics =
- FixedBar_GetRoundedAreaMerics();
- CSize _sizeRoundedAreaShift( 0, 0 );
- if( g_PaintManager.m_bIsWin9x )
- { // region fix for Win9x
- if( _sizeRoundedAreaMerics.cx > 0
- && _sizeRoundedAreaMerics.cx <= 5
- )
- {
- if( bHorz )
- _sizeRoundedAreaShift.cx =
- __WIN9X_FIXED_BAR_ROUNDED_AREA_SHIFT_X;
- _sizeRoundedAreaMerics.cx +=
- __WIN9X_FIXED_BAR_ROUNDED_AREA_ADJUST_X;
- }
- if( _sizeRoundedAreaMerics.cy > 0
- && _sizeRoundedAreaMerics.cy <= 5
- )
- {
- if( ! bHorz )
- _sizeRoundedAreaShift.cy =
- __WIN9X_FIXED_BAR_ROUNDED_AREA_SHIFT_Y;
- _sizeRoundedAreaMerics.cy +=
- __WIN9X_FIXED_BAR_ROUNDED_AREA_ADJUST_Y;
- }
- } // region fix for Win9x
- if( bHorz )
- {
- rectButton.OffsetRect(
- rcToolbarClientArea.right - rectButton.right,
- 0
- );
- rectButton.InflateRect( 1, 0, 0, 0 );
- rectButton.top = rcToolbarClientArea.top;
- rectButton.bottom = rcToolbarClientArea.bottom - 1;
- rcBaloonExclude.right = rectButton.left + 1;
- rectButton.left -= _sizeRoundedAreaMerics.cx;
- } // if( bHorz )
- else
- {
- rectButton.OffsetRect(
- 0,
- rcToolbarClientArea.bottom - rectButton.bottom
- );
- rectButton.InflateRect( 0, 1, 0, 0 );
- rectButton.left = rcToolbarClientArea.left;
- rectButton.right = rcToolbarClientArea.right - 1;
- rcBaloonExclude.bottom = rectButton.top + 1;
- rectButton.top -= _sizeRoundedAreaMerics.cy;
- } // else from if( bHorz )
- CRgn rgnButton, rgnBE;
- if( (! rgnButton.CreateRoundRectRgn(
- rcToolbarClientArea.left, rcToolbarClientArea.top,
- rcToolbarClientArea.right, rcToolbarClientArea.bottom,
- _sizeRoundedAreaMerics.cx, _sizeRoundedAreaMerics.cy
- )
- )
- || (! rgnBE.CreateRoundRectRgn(
- rcBaloonExclude.left, rcBaloonExclude.top,
- rcBaloonExclude.right, rcBaloonExclude.bottom,
- _sizeRoundedAreaMerics.cx, _sizeRoundedAreaMerics.cy
- )
- )
- || rgnButton.CombineRgn(
- &rgnButton,
- &rgnBE,
- RGN_DIFF
- ) == ERROR
- )
- {
- ASSERT( FALSE );
- CExtPaintManagerXP::PaintToolbarExpandButton(
- dc,
- rcButtonArea,
- bHorz,
- bBarIsCompletelyVisible,
- bEnabled,
- bPushed,
- bHover,
- pHelperSrc,
- lParam,
- bTransparentBackground
- );
- return;
- }
- dc.SelectClipRgn( &rgnButton );
- if( bHover || bPushed )
- {
- CRect rcSolidFill( rectButton );
- rcSolidFill.InflateRect( 1, 1 );
- // dc.FillSolidRect(
- // &rcSolidFill,
- // GetColor(
- // bPushed
- // ? _2003CLR_EXPBTN_PRESSED
- // : _2003CLR_EXPBTN_HOVER,
- // pHelperSrc,
- // lParam
- // )
- // );
- stat_PaintGradientRect(
- dc,
- &rcSolidFill,
- GetColor(
- bPushed
- ? ( bHorz ? _2003CLR_EXPBTN_PRESSED_LIGHT : _2003CLR_EXPBTN_PRESSED_DARK )
- : ( bHorz ? _2003CLR_EXPBTN_HOVER_DARK : _2003CLR_EXPBTN_HOVER_LIGHT )
- ,
- pHelperSrc,
- lParam
- ),
- GetColor(
- bPushed
- ? ( bHorz ? _2003CLR_EXPBTN_PRESSED_DARK : _2003CLR_EXPBTN_PRESSED_LIGHT )
- : ( bHorz ? _2003CLR_EXPBTN_HOVER_LIGHT : _2003CLR_EXPBTN_HOVER_DARK )
- ,
- pHelperSrc,
- lParam
- ),
- bHorz
- );
- } // if( bHover || bPushed )
- else
- {
- if( OnQueryUseThemeColors() )
- {
- stat_PaintGradientRect(
- dc,
- rectButton,
- GetColor(
- bHorz
- ? _2003CLR_EXPBTN_DARK
- : _2003CLR_EXPBTN_LIGHT
- ,
- pHelperSrc,
- lParam
- ),
- GetColor(
- bHorz
- ? _2003CLR_EXPBTN_LIGHT
- : _2003CLR_EXPBTN_DARK
- ,
- pHelperSrc,
- lParam
- ),
- bHorz
- );
- }
- else
- {
- CRect rectButton1(rectButton), rectButton2(rectButton);
- if( bHorz )
- {
- rectButton1.bottom =
- rectButton1.top
- + MulDiv( rectButton1.Height(), 3, 5 );
- rectButton2.top = rectButton1.bottom;
- } // if( bHorz )
- else
- {
- rectButton1.right =
- rectButton1.left
- + MulDiv( rectButton1.Width(), 3, 5 );
- rectButton2.left = rectButton1.right;
- } // else from if( bHorz )
- dc.FillSolidRect(
- &rectButton2,
- GetColor( _2003CLR_EXPBTN_DARK, pHelperSrc, lParam )
- );
- stat_PaintGradientRect(
- dc,
- rectButton1,
- GetColor(
- bHorz
- ? _2003CLR_EXPBTN_DARK
- : _2003CLR_EXPBTN_LIGHT
- ,
- pHelperSrc,
- lParam
- ),
- GetColor(
- bHorz
- ? _2003CLR_EXPBTN_LIGHT
- : _2003CLR_EXPBTN_DARK
- ,
- pHelperSrc,
- lParam
- ),
- bHorz
- );
- }
- } // else from if( bHover || bPushed )
- const glyph_t * pGlyph = NULL, * pGlyph2 = NULL;
- if( bHorz )
- {
- pGlyph = m_pGlyphTbEpBtnH0;
- pGlyph2 = m_pGlyphTbEpBtnH1;
- } // if( bHorz )
- else
- {
- pGlyph = m_pGlyphTbEpBtnV0;
- pGlyph2 = m_pGlyphTbEpBtnV1;
- } // else from if( bHorz )
- ASSERT( pGlyph != NULL );
- ASSERT( pGlyph2 != NULL );
- COLORREF ColorValuesLight[] =
- {
- 0,
- GetColor( _2003CLR_EXPGLYPH_LIGHT, pHelperSrc, lParam )
- };
- COLORREF ColorValuesDark[] =
- {
- 0,
- GetColor( _2003CLR_EXPGLYPH_DARK, pHelperSrc, lParam )
- };
- CRect rectGlyph(rectButton.TopLeft(),pGlyph->Size());
- CRect rectGlyph2(rectGlyph);
- CSize sizePushedOffset = GetPushedOffset();
- if( bHorz )
- {
- int nGap = (max(sizePushedOffset.cy,1)) * 3;
- rectGlyph.OffsetRect(
- (rectButton.Size().cx - pGlyph->Size().cx) / 2 + 1,
- rectButton.Size().cy - pGlyph->Size().cy - nGap - 1
- );
- rectGlyph2.OffsetRect(
- (rectButton.Size().cx - pGlyph2->Size().cx) / 2 + 1,
- nGap + 1
- );
- } // if( bHorz )
- else
- {
- int nGap = (max(sizePushedOffset.cx,1)) * 3;
- rectGlyph.OffsetRect(
- nGap + 1,
- (rectButton.Size().cy - pGlyph->Size().cy)/2 + 1
- );
- rectGlyph2.OffsetRect(
- rectButton.Size().cx - pGlyph2->Size().cx - nGap - 1,
- (rectButton.Size().cy - pGlyph2->Size().cy) / 2 + 1
- );
- ASSERT( m_bExpBtnSwapVGlyphs );
- CRect rcTmp( rectGlyph );
- rectGlyph = rectGlyph2;
- rectGlyph2 = rcTmp;
- } // else from if( bHorz )
- rectGlyph.OffsetRect( _sizeRoundedAreaShift );
- rectGlyph2.OffsetRect( _sizeRoundedAreaShift );
- rectGlyph.OffsetRect( 1, 1 );
- rectGlyph2.OffsetRect( 1, 1 );
- PaintGlyph(
- dc,
- rectGlyph.TopLeft(),
- *pGlyph,
- ColorValuesLight
- );
- if( ! bBarIsCompletelyVisible )
- PaintGlyph(
- dc,
- rectGlyph2.TopLeft(),
- *pGlyph2,
- ColorValuesLight
- );
-
- rectGlyph.OffsetRect( -1, -1 );
- rectGlyph2.OffsetRect( -1, -1 );
- PaintGlyph(
- dc,
- rectGlyph.TopLeft(),
- *pGlyph,
- ColorValuesDark
- );
- if( ! bBarIsCompletelyVisible )
- PaintGlyph(
- dc,
- rectGlyph2.TopLeft(),
- *pGlyph2,
- ColorValuesDark
- );
- dc.SelectClipRgn( NULL );
- }
- void CExtPaintManagerNativeXP::PaintToolbarExpandButton(
- CDC & dc,
- const RECT & rcButtonArea,
- bool bHorz, // if false - down
- bool bBarIsCompletelyVisible,
- bool bEnabled,
- bool bPushed,
- bool bHover,
- CObject * pHelperSrc,
- LPARAM lParam, // = 0L
- bool bTransparentBackground // = false
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- CRect rect(rcButtonArea);
- rect.NormalizeRect();
- if( !dc.RectVisible( &rect ) )
- return;
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- {
- CExtPaintManager::PaintToolbarExpandButton(
- dc,
- rcButtonArea,
- bHorz,
- bBarIsCompletelyVisible,
- bEnabled,
- bPushed,
- bHover,
- pHelperSrc,
- lParam,
- bTransparentBackground
- );
- return;
- } // if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- //CExtBarContentExpandButton * pTBB =
- // DYNAMIC_DOWNCAST(
- // CExtBarContentExpandButton,
- // pHelperSrc
- // );
- // ASSERT( pTBB != NULL );
- // ASSERT_VALID( pTBB );
- CExtBarButton * pTBB =
- DYNAMIC_DOWNCAST(
- CExtBarButton,
- pHelperSrc
- );
- ASSERT( pTBB != NULL );
- ASSERT_VALID( pTBB );
- CExtToolControlBar * pBar = pTBB->GetSafeBar();
- ASSERT( pBar != NULL );
- ASSERT_VALID( pBar );
-
- if( g_PaintManager.m_UxTheme.OpenThemeData( pBar->GetSafeHwnd(), VSCLASS_TOOLBAR ) != NULL )
- {
- INT nStateID =
- bHover
- ? TS_HOT
- : bPushed
- ? TS_PRESSED
- : TS_NORMAL;
- //VERIFY(
- g_PaintManager.m_UxTheme.DrawBackground(
- pBar->GetSafeHwnd(),
- dc.GetSafeHdc(),
- TP_BUTTON,
- nStateID,
- &rcButtonArea,
- &rcButtonArea
- //) == S_OK
- );
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- CRect rcButton( rect );
- const glyph_t * pGlyph1 = NULL;
- const glyph_t * pGlyph2 = NULL;
- if( bHorz )
- {
- pGlyph1 = &g_glyph_btn_expand_bottom;
- if( !bBarIsCompletelyVisible )
- pGlyph2 = &g_glyph_btn_expand_right2;
- }
- else
- {
- pGlyph1 = &g_glyph_btn_expand_left;
- if( !bBarIsCompletelyVisible )
- pGlyph2 = &g_glyph_btn_expand_bottom2;
- }
- ASSERT( pGlyph1 != NULL );
- COLORREF ColorValues[] =
- { 0, ::GetSysColor( bEnabled ? COLOR_BTNTEXT : COLOR_GRAYTEXT ) };
- CRect rectGlyph1( rcButton.TopLeft(), pGlyph1->Size() );
- CRect rectGlyph2( rectGlyph1 );
- if( bHorz )
- {
- INT nGap = 3;
- rectGlyph1.OffsetRect(
- (rcButton.Size().cx - pGlyph1->Size().cx) / 2,
- rcButton.Size().cy - pGlyph1->Size().cy - nGap
- );
- if( pGlyph2 != NULL )
- rectGlyph2.OffsetRect(
- (rcButton.Size().cx - pGlyph2->Size().cx) / 2,
- nGap
- );
- }
- else
- {
- INT nGap = 3;
- rectGlyph1.OffsetRect(
- nGap,
- (rcButton.Size().cy - pGlyph1->Size().cy)/2
- );
- if( pGlyph2 != NULL )
- rectGlyph2.OffsetRect(
- rcButton.Size().cx - pGlyph2->Size().cx - nGap,
- (rcButton.Size().cy - pGlyph2->Size().cy) / 2
- );
- }
- PaintGlyph(
- dc,
- rectGlyph1.TopLeft(),
- *pGlyph1,
- ColorValues
- );
- if( pGlyph2 != NULL )
- PaintGlyph(
- dc,
- rectGlyph2.TopLeft(),
- *pGlyph2,
- ColorValues
- );
- }
- static int CALLBACK stat_FindFontByNameCallBack(
- ENUMLOGFONT * pEnumLogFont,
- NEWTEXTMETRIC * pNewTextMetric,
- DWORD dwFontType,
- LPARAM lParam // zero terminated string
- )
- {
- ASSERT( pEnumLogFont != NULL );
- pNewTextMetric;
- dwFontType;
- __EXT_MFC_SAFE_LPCTSTR sFontToFind =
- reinterpret_cast < const TCHAR * > ( lParam );
- ASSERT( sFontToFind != NULL );
- return
- _tcsicoll(
- pEnumLogFont->elfLogFont.lfFaceName,
- sFontToFind
- );
- }
- static HFONT stat_menu_HFONT_from_current_NONCLIENTMETRICS(
- bool bUseTahomaFont,
- bool bUseCaptionFont
- )
- {
- NONCLIENTMETRICS _ncNfo;
- memset( &_ncNfo, 0, sizeof(NONCLIENTMETRICS) );
- _ncNfo.cbSize = sizeof(NONCLIENTMETRICS);
- if( ! ::SystemParametersInfo( SPI_GETNONCLIENTMETRICS, sizeof(_ncNfo), &_ncNfo, 0 ) )
- {
- return NULL;
- }
- _ncNfo.lfSmCaptionFont.lfCharSet = _ncNfo.lfMenuFont.lfCharSet = (BYTE)GetTextCharset( NULL );
- LPCTSTR strDesiredFontFaceName = (LPCTSTR)g_ResourceManager->DesiredFont_GetFaceName();
- if( LPCTSTR(strDesiredFontFaceName) != NULL
- && INT(_tcslen(LPCTSTR(strDesiredFontFaceName))) > 0
- )
- {
- if( ! ::EnumFontFamilies( NULL, NULL, (FONTENUMPROC)stat_FindFontByNameCallBack, reinterpret_cast < LPARAM > ( strDesiredFontFaceName ) ) )
- {
- __EXT_MFC_STRCPY( _ncNfo.lfMenuFont.lfFaceName, LF_FACESIZE, strDesiredFontFaceName );
- bUseTahomaFont = false;
- }
- }
- if( bUseTahomaFont )
- {
- static __EXT_MFC_SAFE_LPCTSTR g_sTahoma = _T("Tahoma");
- if( ! ::EnumFontFamilies( NULL, NULL, (FONTENUMPROC)stat_FindFontByNameCallBack, reinterpret_cast < LPARAM > ( LPCTSTR( g_sTahoma ) ) ) )
- __EXT_MFC_STRCPY( _ncNfo.lfMenuFont.lfFaceName, LF_FACESIZE, g_sTahoma );
- } // else if( bUseTahomaFont )
- if( bUseCaptionFont )
- return CreateFontIndirect( &_ncNfo.lfSmCaptionFont );
- return CreateFontIndirect( &_ncNfo.lfMenuFont );
- }
- bool CExtPaintManager::NcFrame_IsSupported(
- const CWnd * pWnd,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- pWnd;
- lParam;
- return false;
- }
- HRGN CExtPaintManager::NcFrame_GenerateSkinFrameRGN(
- const RECT & rcWnd,
- const CWnd * pWnd,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pWnd );
- rcWnd;
- pWnd;
- lParam;
- return ( (HRGN)NULL );
- }
- INT CExtPaintManager::NcFrame_GetCaptionHeight(
- bool bActive,
- const CWnd * pWnd,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- bActive;
- pWnd;
- lParam;
- return 0;
- }
- INT CExtPaintManagerOffice2007_Impl::NcFrame_GetCaptionHeight(
- bool bActive,
- const CWnd * pWnd,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::NcFrame_GetCaptionHeight(
- bActive,
- pWnd,
- lParam
- );
- INT nCaptionHeight = bActive ? m_nCaptionHeightActive : m_nCaptionHeightInactive;
- nCaptionHeight = UiScalingDo( nCaptionHeight, __EUIST_Y );
- return nCaptionHeight;
- }
- void CExtPaintManager::NcFrame_GetMetrics(
- RECT & rcNcBorders,
- RECT & rcThemePadding,
- const CWnd * pWnd,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- pWnd;
- lParam;
- ::SetRectEmpty( &rcNcBorders );
- ::SetRectEmpty( &rcThemePadding );
- }
- CRect CExtPaintManager::NcFrame_GetHtRect(
- UINT nHT,
- bool bScreenMapping,
- bool bLayoutBordersH,
- bool bLayoutBordersV,
- const CExtCmdIcon * pIcon,
- const CWnd * pWnd,
- LPMINMAXINFO pMinMaxInfo, // = NULL
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- nHT;
- bScreenMapping;
- bLayoutBordersH,
- bLayoutBordersV,
- pIcon;
- pWnd;
- pMinMaxInfo,
- lParam;
- return CRect( 0, 0, 0, 0 );
- }
- void CExtPaintManager::NcFrame_Paint(
- CDC & dc,
- const CExtCmdIcon * pIcon,
- __EXT_MFC_SAFE_LPCTSTR strCaption,
- UINT nDrawTextAlignFlags,
- const RECT & rcFrame,
- const RECT & rcClient,
- const RECT & rcIcon,
- const RECT & rcText,
- const RECT & rcHelp,
- const RECT & rcMinimize,
- const RECT & rcMaximizeRestore,
- const RECT & rcClose,
- bool bFrameActive,
- bool bFrameEnabled,
- bool bFrameMaximized,
- CExtPaintManager::e_nc_button_state_t eStateButtonHelp,
- CExtPaintManager::e_nc_button_state_t eStateButtonMinimize,
- CExtPaintManager::e_nc_button_state_t eStateButtonMaximizeRestore,
- CExtPaintManager::e_nc_button_state_t eStateButtonClose,
- const CWnd * pWnd,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- pIcon;
- strCaption;
- nDrawTextAlignFlags;
- rcFrame;
- rcClient;
- rcIcon;
- rcText;
- rcHelp;
- rcMinimize;
- rcMaximizeRestore;
- rcClose;
- bFrameActive;
- bFrameEnabled;
- bFrameMaximized;
- eStateButtonHelp;
- eStateButtonMinimize;
- eStateButtonMaximizeRestore;
- eStateButtonClose;
- pWnd;
- lParam;
- }
- void CExtPaintManager::NcFrame_GetRects(
- CExtCmdIcon * pIcon,
- __EXT_MFC_SAFE_LPCTSTR strCaption,
- UINT nDrawTextAlignFlags,
- RECT & rcIcon,
- RECT & rcText,
- RECT & rcHelp,
- RECT & rcMinimize,
- RECT & rcMaximizeRestore,
- RECT & rcClose,
- const CWnd * pWnd,
- LPMINMAXINFO pMinMaxInfo, // = NULL
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- pIcon;
- strCaption;
- nDrawTextAlignFlags;
- pWnd;
- pMinMaxInfo;
- lParam;
- ::SetRectEmpty( &rcIcon );
- ::SetRectEmpty( &rcText );
- ::SetRectEmpty( &rcHelp );
- ::SetRectEmpty( &rcMinimize );
- ::SetRectEmpty( &rcMaximizeRestore );
- ::SetRectEmpty( &rcClose );
- }
- bool CExtPaintManager::Bar_MiniDockFrameNcCalcSize(
- RECT & rcAdjust,
- CExtMiniDockFrameWnd * pMiniFrameWnd,
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pMiniFrameWnd );
- rcAdjust;
- pMiniFrameWnd;
- pBar;
- lParam;
- return false;
- }
- bool CExtPaintManager::Bar_MiniDockFrameGetNcMetrics(
- INT & nResizingFrameDX,
- INT & nResizingFrameDY,
- INT & nCaptionDY,
- CExtMiniDockFrameWnd * pMiniFrameWnd,
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pMiniFrameWnd );
- pMiniFrameWnd;
- pBar;
- lParam;
- nResizingFrameDX = 3;
- nResizingFrameDY = 3;
- nCaptionDY = 17;
- return true;
- }
- bool CExtPaintManagerNativeXP::Bar_MiniDockFrameGetNcMetrics(
- INT & nResizingFrameDX,
- INT & nResizingFrameDY,
- INT & nCaptionDY,
- CExtMiniDockFrameWnd * pMiniFrameWnd,
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pMiniFrameWnd );
- pMiniFrameWnd;
- pBar;
- lParam;
- nResizingFrameDX = ::GetSystemMetrics( SM_CXSIZEFRAME );
- nResizingFrameDY = ::GetSystemMetrics( SM_CYSIZEFRAME );
- nCaptionDY = ::GetSystemMetrics( SM_CYSMCAPTION );
- return true;
- }
- bool CExtPaintManager::Bar_MiniDockFrameCaptionCalcRect(
- RECT & rcCaption,
- CExtMiniDockFrameWnd * pMiniFrameWnd,
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pMiniFrameWnd );
- if( pMiniFrameWnd == NULL )
- return false;
- INT nResizingFrameDX = 0;
- INT nResizingFrameDY = 0;
- INT nCaptionDY = 0;
- Bar_MiniDockFrameGetNcMetrics(
- nResizingFrameDX,
- nResizingFrameDY,
- nCaptionDY,
- pMiniFrameWnd,
- pBar,
- lParam
- );
-
- CRect rcFrameCaption;
- ::GetWindowRect( pMiniFrameWnd->GetSafeHwnd(), &rcFrameCaption );
- rcFrameCaption -= rcFrameCaption.TopLeft();
- rcFrameCaption.left += nResizingFrameDX;
- rcFrameCaption.right -= nResizingFrameDX;
- rcFrameCaption.top += nResizingFrameDY;
- // rcFrameCaption.bottom =
- // rcFrameCaption.top
- // + nSmallCaptionDY
- // - ::GetSystemMetrics( SM_CYSMSIZE );
- rcFrameCaption.bottom =
- rcFrameCaption.top
- + nCaptionDY;
- ::CopyRect( &rcCaption, &rcFrameCaption );
-
- return true;
- }
- void CExtPaintManager::PaintResizableBarSeparator(
- CDC & dc,
- const RECT & rc,
- bool bHorz,
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rc;
- bHorz;
- pBar;
- lParam;
- }
- bool CExtPaintManager::Bar_LayoutNcAreaButton(
- RECT & rcButton,
- const RECT & rcCaption,
- CExtBarNcAreaButton * pLayoutBtn,
- CExtBarNcAreaButton * pPrevBtn,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pLayoutBtn );
- rcButton;
- rcCaption;
- pLayoutBtn;
- pPrevBtn;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::Bar_LayoutNcAreaButton(
- RECT & rcButton,
- const RECT & rcCaption,
- CExtBarNcAreaButton * pLayoutBtn,
- CExtBarNcAreaButton * pPrevBtn,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pLayoutBtn );
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- return
- CExtPaintManager::Bar_LayoutNcAreaButton(
- rcButton,
- rcCaption,
- pLayoutBtn,
- pPrevBtn,
- pHelperSrc,
- lParam
- );
- CSize szPart(0,0);
- if( g_PaintManager.m_UxTheme.OpenThemeData( NULL, VSCLASS_WINDOW ) != NULL )
- {
- CWindowDC dc( NULL );
- VERIFY(
- g_PaintManager.m_UxTheme.GetThemePartSize(
- dc.GetSafeHdc(),
- WP_SMALLCLOSEBUTTON,
- CBS_NORMAL,
- NULL,
- CExtUxTheme::__EXT_UX_TS_TRUE,
- &szPart
- ) == S_OK
- );
- g_PaintManager.m_UxTheme.CloseThemeData();
- }
- const int _nGapToBordersH = 2;
- const int _nGapToBordersV = 3;
- const int _nGapBetweenButtons = 3;
- INT x = rcCaption.right - szPart.cx;
- INT y = rcCaption.top;
- CRect rc( x, y, x + szPart.cx, y + szPart.cy );
- rc.OffsetRect(
- -_nGapToBordersH,
- _nGapToBordersV
- );
- if( pPrevBtn != NULL )
- {
- const CRect & rcPrev = *pPrevBtn;
- rc.OffsetRect(
- rcPrev.left - rc.right - _nGapBetweenButtons,
- 0
- );
- }
- rcButton = rc;
- return true;
- }
- CRect CExtPaintManager::Bar_GetCaptionBordersForText(
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- pBar;
- lParam;
- return CRect( 0, 0, 0, 0 );
- }
- INT CExtPaintManager::Bar_SeparatorWidthGet(
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- pBar;
- lParam;
- return -1;
- }
- INT CExtPaintManager::Bar_SeparatorHeightGet(
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- pBar;
- lParam;
- return -1;
- }
- INT CExtPaintManager::Bar_GripperWidthAtLeftGet(
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- pBar;
- lParam;
- return -1;
- }
- INT CExtPaintManager::Bar_GripperHeightAtTopGet(
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- pBar;
- lParam;
- return -1;
- }
- HFONT CExtPaintManager::Bar_GetCaptionFont(
- bool bHorz,
- CExtToolControlBar * pBar,
- LPARAM lParam // = 0
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- bHorz;
- pBar;
- lParam;
- return NULL;
- }
- CSize CExtPaintManager::Toolbar_GetMinButtonSize(
- CObject * pHelperSrc,
- LPARAM lParam // = 0
- )
- {
- ASSERT_VALID( this );
- pHelperSrc;
- lParam;
- return CSize( 0, 0 );
- }
- void CExtPaintManager::Toolbar_AdjustButtonSize(
- CExtBarButton * pTBB,
- CSize & sizePreCalc
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pTBB );
- pTBB;
- sizePreCalc;
- }
- HFONT CExtPaintManager::Toolbar_GetFont(
- bool bHorz,
- CExtControlBar * pBar,
- LPARAM lParam // = 0
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- bHorz;
- pBar;
- lParam;
- return NULL;
- }
- bool CExtPaintManager::Toolbar_GetBGInfo(
- RECT & rcBorders,
- INT & nGripWidthAtLeft,
- INT & nGripHeightAtTop,
- CExtToolControlBar * pBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pBar );
- rcBorders;
- nGripWidthAtLeft;
- nGripHeightAtTop;
- pBar;
- lParam;
- return false;
- }
- bool CExtPaintManager::Toolbar_GetSizeOfCEB(
- SIZE & sizeReal,
- const SIZE & sizePreCalc,
- CDC & dc,
- BOOL bHorz,
- CExtBarContentExpandButton * pTBB,
- LPARAM lParam // = 0
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pTBB );
- sizeReal;
- sizePreCalc;
- dc;
- bHorz;
- pTBB;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::Toolbar_GetSizeOfCEB(
- SIZE & sizeReal,
- const SIZE & sizePreCalc,
- CDC & dc,
- BOOL bHorz,
- CExtBarContentExpandButton * pTBB,
- LPARAM lParam // = 0
- )
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pTBB );
- if( ! g_PaintManager.m_UxTheme.IsControlsThemed() )
- return
- CExtPaintManager::Toolbar_GetSizeOfCEB(
- sizeReal,
- sizePreCalc,
- dc,
- bHorz,
- pTBB,
- lParam
- );
-
- if( bHorz )
- {
- sizeReal.cx = 15;
- sizeReal.cy = sizePreCalc.cy;
- }
- else
- {
- sizeReal.cx = sizePreCalc.cx;
- sizeReal.cy = 15;
- }
-
- return true;
- }
- void CExtPaintManager::AdvTip_CalcRgn(
- HRGN hRgnPrecalc,
- const RECT & rcRectRgn,
- bool bDynamicShadowApplied,
- INT nSizeInnerShadowIncluded,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( hRgnPrecalc != NULL );
- ASSERT( nSizeInnerShadowIncluded >= 0 );
- hRgnPrecalc;
- rcRectRgn;
- bDynamicShadowApplied;
- nSizeInnerShadowIncluded;
- pHelperSrc;
- lParam;
- }
- void CExtPaintManagerNativeXP::AdvTip_CalcRgn(
- HRGN hRgnPrecalc,
- const RECT & rcRectRgn,
- bool bDynamicShadowApplied,
- INT nSizeInnerShadowIncluded,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( hRgnPrecalc != NULL );
- ASSERT( nSizeInnerShadowIncluded >= 0 );
- CExtPaintManager::AdvTip_CalcRgn(
- hRgnPrecalc,
- rcRectRgn,
- bDynamicShadowApplied,
- nSizeInnerShadowIncluded,
- pHelperSrc,
- lParam
- );
- }
- void CExtPaintManagerOffice2007_Impl::AdvTip_CalcRgn(
- HRGN hRgnPrecalc,
- const RECT & rcRectRgn,
- bool bDynamicShadowApplied,
- INT nSizeInnerShadowIncluded,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( hRgnPrecalc != NULL );
- ASSERT( nSizeInnerShadowIncluded >= 0 );
- if( IsHighContrast() )
- {
- CExtPaintManagerXP::AdvTip_CalcRgn(
- hRgnPrecalc,
- rcRectRgn,
- bDynamicShadowApplied,
- nSizeInnerShadowIncluded,
- pHelperSrc,
- lParam
- );
- return;
- }
-
- if( ! m_bAdvTipOnePxExcludeMode)
- return;
- CRect rc = rcRectRgn;
- rc.DeflateRect( 0, 0, nSizeInnerShadowIncluded, nSizeInnerShadowIncluded );
- //CRgn _arrRgnOnePx[12];
- // if( (! _arrRgnOnePx[0].CreateRectRgn( rc.left, rc.top, rc.left + 1, rc.top + 1 ) )
- // || (! _arrRgnOnePx[1].CreateRectRgn( rc.left + 1, rc.top, rc.left + 2, rc.top + 1 ) )
- // || (! _arrRgnOnePx[2].CreateRectRgn( rc.left, rc.top + 1, rc.left + 1, rc.top + 2 ) )
- // || (! _arrRgnOnePx[3].CreateRectRgn( rc.right - 1, rc.top, rc.right, rc.top + 1 ) )
- // || (! _arrRgnOnePx[4].CreateRectRgn( rc.right - 2, rc.top, rc.right - 1, rc.top + 1 ) )
- // || (! _arrRgnOnePx[5].CreateRectRgn( rc.right - 1, rc.top + 1, rc.right, rc.top + 2 ) )
- // || (! _arrRgnOnePx[6].CreateRectRgn( rc.left, rc.bottom - 1, rc.left + 1, rc.bottom ) )
- // || (! _arrRgnOnePx[7].CreateRectRgn( rc.left + 1, rc.bottom - 1, rc.left + 2, rc.bottom ) )
- // || (! _arrRgnOnePx[8].CreateRectRgn( rc.left, rc.bottom - 2, rc.left + 1, rc.bottom - 1 ) )
- // || (! _arrRgnOnePx[9].CreateRectRgn( rc.right - 1, rc.bottom - 1, rc.right, rc.bottom ) )
- // || (! _arrRgnOnePx[10].CreateRectRgn( rc.right - 2, rc.bottom - 1, rc.right - 1, rc.bottom ) )
- // || (! _arrRgnOnePx[11].CreateRectRgn( rc.right - 1, rc.bottom - 2, rc.right, rc.bottom - 1 ) )
- // )
- // return;
- CRgn _arrRgnOnePx[4];
- if( (! _arrRgnOnePx[0].CreateRectRgn( rc.left, rc.top, rc.left + 1, rc.top + 1 ) )
- || (! _arrRgnOnePx[1].CreateRectRgn( rc.right - 1, rc.top, rc.right, rc.top + 1 ) )
- || (! _arrRgnOnePx[2].CreateRectRgn( rc.left, rc.bottom - 1, rc.left + 1, rc.bottom ) )
- || (! _arrRgnOnePx[3].CreateRectRgn( rc.right - 1, rc.bottom - 1, rc.right, rc.bottom ) )
- )
- return;
- INT nRgnIndex, nRgnCount = sizeof(_arrRgnOnePx) / sizeof(_arrRgnOnePx[0]);
- if( nSizeInnerShadowIncluded > 0
- || bDynamicShadowApplied
- )
- nRgnCount --; // -= 3;
- for( nRgnIndex = 0; nRgnIndex < nRgnCount; nRgnIndex ++ )
- ::CombineRgn( hRgnPrecalc, hRgnPrecalc, HRGN(_arrRgnOnePx[nRgnIndex].GetSafeHandle()), RGN_DIFF );
- }
- bool CExtPaintManager::AdvTip_PaintBackground(
- CDC & dc,
- const RECT & rcClient,
- bool bAdvTipWithShadow,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- dc;
- rcClient;
- bAdvTipWithShadow;
- pHelperSrc;
- lParam;
- return false;
- }
- bool CExtPaintManagerNativeXP::AdvTip_PaintBackground(
- CDC & dc,
- const RECT & rcClient,
- bool bAdvTipWithShadow,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- return
- CExtPaintManager::AdvTip_PaintBackground(
- dc,
- rcClient,
- bAdvTipWithShadow,
- pHelperSrc,
- lParam
- );
- }
- bool CExtPaintManagerOffice2007_Impl::AdvTip_PaintBackground(
- CDC & dc,
- const RECT & rcClient,
- bool bAdvTipWithShadow,
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::AdvTip_PaintBackground(
- dc,
- rcClient,
- bAdvTipWithShadow,
- pHelperSrc,
- lParam
- );
-
- CRect rcGradient = rcClient;
- rcGradient.DeflateRect(
- m_rcAdvTipPaddingGradient.left,
- m_rcAdvTipPaddingGradient.top,
- m_rcAdvTipPaddingGradient.right,
- m_rcAdvTipPaddingGradient.bottom
- );
- stat_PaintGradientRect(
- dc,
- rcGradient,
- m_clrAdvTipGradientBottom,
- m_clrAdvTipGradientTop,
- true,
- 255
- );
- m_bmpAdvTipBorder.AlphaBlendSkinParts(
- dc,
- rcClient,
- m_rcAdvTipPaddingBorder,
- CExtBitmap::__EDM_STRETCH,
- true,
- true
- );
- return true;
- }
- CFont * CExtPaintManager::AdvTip_GetFont(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- pHelperSrc;
- lParam;
- return NULL;
- }
- CFont * CExtPaintManagerNativeXP::AdvTip_GetFont(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- return
- CExtPaintManager::AdvTip_GetFont(
- pHelperSrc,
- lParam
- );
- }
- CFont * CExtPaintManagerOffice2007_Impl::AdvTip_GetFont(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::AdvTip_GetFont(
- pHelperSrc,
- lParam
- );
- return NULL;
- }
- COLORREF CExtPaintManager::AdvTip_GetTextColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- pHelperSrc;
- lParam;
- return COLORREF(-1L);
- }
- COLORREF CExtPaintManagerNativeXP::AdvTip_GetTextColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- pHelperSrc;
- lParam;
- return
- CExtPaintManager::AdvTip_GetTextColor(
- pHelperSrc,
- lParam
- );
- }
- COLORREF CExtPaintManagerOffice2007_Impl::AdvTip_GetTextColor(
- CObject * pHelperSrc,
- LPARAM lParam // = 0L
- )
- {
- ASSERT_VALID( this );
- if( IsHighContrast() )
- return
- CExtPaintManagerXP::AdvTip_GetTextColor(
- pHelperSrc,
- lParam
- );
- return m_clrAdvTipText;
- }
- #ifndef __EXT_MFC_NO_STATUSBAR
- bool CExtPaintManager::StatusBar_QuerySkinSupport(
- const CExtStatusControlBar * pStatusBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT_VALID( pStatusBar );
- pStatusBar;
- lParam;
- return false;
- }
- bool CExtPaintManager::StatusBar_EraseBackground(
- CDC & dc,
- const RECT & rcClient,
- const CExtStatusControlBar * pStatusBar,
- LPARAM lParam // = 0
- ) const
- {
- ASSERT_VALID( this );
- ASSERT( dc.GetSafeHdc() != NULL );
- ASSERT_VALID( pStatusBar );
- dc;
- rcClient;