ExtPaintManager.cpp
上传用户:sesekoo
上传日期:2020-07-18
资源大小:21543k
文件大小:1653k
源码类别:

界面编程

开发平台:

Visual C++

  1. 0x55,
  2. };
  3. CBrush br;
  4. CBitmap bmp;
  5. bmp.CreateBitmap( 8, 8, 1, 1, hatchBits );
  6. br.CreatePatternBrush( &bmp );
  7. LOGBRUSH lbr;
  8. br.GetLogBrush( &lbr );
  9. HPEN hPenDesired =
  10. ::ExtCreatePen(
  11. PS_GEOMETRIC,
  12. 1,
  13. &lbr,
  14. 0,
  15. NULL
  16. );
  17. if( hPenDesired == NULL )
  18. {
  19. COLORREF clrDesiredSolidPen =
  20. GetColor( COLOR_3DSHADOW, _pdfd.m_pHelperSrc, _pdfd.m_lParam );
  21. hPenDesired =
  22. ::CreatePen(
  23. PS_SOLID,
  24. 1,
  25. clrDesiredSolidPen
  26. );
  27. if( hPenDesired == NULL )
  28. {
  29. hPenDesired = (HPEN)
  30. ::GetStockObject(BLACK_PEN);
  31. ASSERT( hPenDesired != NULL );
  32. } // if( hPenDesired == NULL )
  33. } // if( hPenDesired == NULL )
  34. // CPen pen( PS_GEOMETRIC, 1, &lbr );
  35. CPen pen;
  36. VERIFY( pen.Attach( hPenDesired ) );
  37. CPen * pOldPen = dc.SelectObject( &pen );
  38. if( m_bHelperXpStyle8BitBarRect )
  39. {
  40. dc.MoveTo( rcWnd.left, rcWnd.top );
  41. dc.LineTo( rcWnd.right-1, rcWnd.top );
  42. dc.LineTo( rcWnd.right-1, rcWnd.bottom-1 );
  43. dc.LineTo( rcWnd.left, rcWnd.bottom-1 );
  44. dc.LineTo( rcWnd.left, rcWnd.top );
  45. } // if( m_bHelperXpStyle8BitBarRect )
  46. else
  47. {
  48. static const SIZE g_sizeRO = { 2, 2 };
  49. dc.MoveTo( rcWnd.left+g_sizeRO.cx, rcWnd.top );
  50. dc.LineTo( rcWnd.right-1-g_sizeRO.cx, rcWnd.top );
  51. dc.LineTo( rcWnd.right-1, rcWnd.top+g_sizeRO.cy );
  52. dc.LineTo( rcWnd.right-1, rcWnd.bottom-1-g_sizeRO.cy );
  53. dc.LineTo( rcWnd.right-1-g_sizeRO.cx, rcWnd.bottom-1 );
  54. dc.LineTo( rcWnd.left+g_sizeRO.cx, rcWnd.bottom-1 );
  55. dc.LineTo( rcWnd.left, rcWnd.bottom-1-g_sizeRO.cy );
  56. dc.LineTo( rcWnd.left, rcWnd.top+g_sizeRO.cy );
  57. dc.LineTo( rcWnd.left+g_sizeRO.cx, rcWnd.top );
  58. } // else from if( m_bHelperXpStyle8BitBarRect )
  59. dc.SelectObject( pOldPen );
  60. } // if( !_pdfd.m_bSideBar && ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) < 8 )
  61. } // else from if( _pdfd.m_bFloating )
  62. dc.SetBkColor( clrBkOld );
  63. //dc.IntersectClipRect(rectWindow);
  64. dc.SelectClipRgn(NULL);
  65. }
  66. void CExtPaintManagerOffice2007_Impl::PaintDockingCaptionButton(
  67. CDC & dc,
  68. CExtPaintManager::PAINTDOCKINGCAPTIONBUTTONDATA & _pdcbd
  69. )
  70. {
  71. ASSERT_VALID( this );
  72. ASSERT( dc.GetSafeHdc() != NULL );
  73. ASSERT(
  74. __DCBT_VALUE_MIN <= _pdcbd.m_eType
  75. && _pdcbd.m_eType <= __DCBT_VALUE_MAX
  76. );
  77. if( _pdcbd.m_rcClient.IsRectEmpty() )
  78. return;
  79. if( IsHighContrast() )
  80. {
  81. CExtPaintManagerXP::PaintDockingCaptionButton(
  82. dc,
  83. _pdcbd
  84. );
  85. return;
  86. }
  87. if( _pdcbd.m_pHelperSrc == NULL
  88. || ( ! _pdcbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarNcAreaButton) ) )
  89. )
  90. {
  91. CExtPaintManagerOffice2003::PaintDockingCaptionButton( dc, _pdcbd );
  92. return;
  93. }
  94. CExtControlBar * pBar = ((CExtBarNcAreaButton*)_pdcbd.m_pHelperSrc)->GetBar();
  95. ASSERT_VALID( pBar );
  96. bool bFixedMode =
  97. ( pBar->IsFixedMode()
  98. //|| pBar->IsKindOf( RUNTIME_CLASS(CExtDynControlBar) )
  99. //|| pBar->IsFloating()
  100. )
  101. ;
  102. bool bHover = _pdcbd.m_bHover;
  103. if( !_pdcbd.m_bEnabled )
  104. bHover = false;
  105. COLORREF ColorValues[2] =
  106. {
  107. RGB(0,0,0),
  108. RGB(0,0,0),
  109. };
  110. if( _pdcbd.m_bEnabled )
  111. {
  112. if( _pdcbd.m_bPushed )
  113. ColorValues[1] =
  114. bFixedMode
  115. ? m_clrDockingCaptionShapeFixedPushed
  116. : m_clrDockingCaptionShapeResizablePushed
  117. ;
  118. else if( _pdcbd.m_bHover )
  119. ColorValues[1] =
  120. bFixedMode
  121. ? m_clrDockingCaptionShapeFixedHover
  122. : m_clrDockingCaptionShapeResizableHover
  123. ;
  124. else
  125. ColorValues[1] =
  126. bFixedMode
  127. ? m_clrDockingCaptionShapeFixedNormal
  128. : m_clrDockingCaptionShapeResizableNormal
  129. ;
  130. } // if( bEnabled )
  131. else
  132. {
  133. ColorValues[1] =
  134. bFixedMode
  135. ? m_clrDockingCaptionShapeFixedDisabled
  136. : m_clrDockingCaptionShapeResizableDisabled
  137. ;
  138. } // else from if( bEnabled )
  139. CRect rcGlyph( _pdcbd.m_rcClient );
  140. rcGlyph.NormalizeRect();
  141. if( bHover || _pdcbd.m_bPushed )
  142. {
  143. dc.FillSolidRect(
  144. &rcGlyph,
  145. GetColor(
  146. _pdcbd.m_bPushed
  147. ? XPCLR_HILIGHT
  148. : CLR_3DFACE_IN
  149. ,
  150. _pdcbd.m_pHelperSrc,
  151. _pdcbd.m_lParam
  152. )
  153. );
  154. CRect rcBtnBorder(rcGlyph);
  155. rcBtnBorder.InflateRect(1,1);
  156. COLORREF clrBtnBorder = GetColor( _pdcbd.m_bBarWndActive ? XPCLR_HILIGHT : XPCLR_HILIGHT_BORDER, _pdcbd.m_pHelperSrc, _pdcbd.m_lParam );
  157. dc.Draw3dRect( rcBtnBorder, clrBtnBorder, clrBtnBorder );
  158. }
  159. if( rcGlyph.Width() & 1 )
  160. rcGlyph.left++;
  161. if( rcGlyph.Height() & 1 )
  162. rcGlyph.top++;
  163. int eType = _pdcbd.m_eType;
  164. if( _pdcbd.m_bSideBar && !_pdcbd.m_bFloating && eType == __DCBT_CLOSE )
  165. eType = __DCBT_XP_THIN_CLOSE;
  166. #ifdef __FREIWALD_ORIGINAL__
  167. if( _pdcbd.m_bSideBar && !_pdcbd.m_bFloating && eType == __DCBT_CLOSE )
  168. eType = __DCBT_XP_THIN_CLOSE;
  169. #else
  170. #endif
  171. glyph_t * pGlyph = g_DockingCaptionGlyphs[eType];
  172. ASSERT( pGlyph != NULL );
  173. PaintGlyphCentered(
  174. dc,
  175. rcGlyph,
  176. *pGlyph,
  177. ColorValues
  178. );
  179. }
  180. bool CExtPaintManagerOffice2007_Impl::IsMenuMustCombineExcludeArea(
  181. const CObject * pMenuTrackerObject // = NULL
  182. ) const
  183. {
  184. ASSERT_VALID( this );
  185. if( IsHighContrast() )
  186. return 
  187. CExtPaintManagerXP::IsMenuMustCombineExcludeArea(
  188. pMenuTrackerObject
  189. );
  190. if( pMenuTrackerObject != NULL )
  191. {
  192. if( pMenuTrackerObject->IsKindOf( RUNTIME_CLASS( CExtToolControlBar ) )
  193. || pMenuTrackerObject->IsKindOf( RUNTIME_CLASS( CExtBarNcAreaButton ) )
  194. || pMenuTrackerObject->IsKindOf( RUNTIME_CLASS( CExtBarButton ) )
  195. || pMenuTrackerObject->IsKindOf( RUNTIME_CLASS( CExtMiniDockFrameWnd ) )
  196. || pMenuTrackerObject->IsKindOf( RUNTIME_CLASS( CExtPopupMenuWnd ) )
  197. )
  198. return true;
  199. } // if( pMenuTrackerObject != NULL )
  200. return false;
  201. }
  202. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  203. CRect CExtPaintManager::Ribbon_CalcLargeDropDownRect(
  204. const CExtBarButton * pTBB,
  205. LPARAM lParam // = 0L
  206. )
  207. {
  208. ASSERT_VALID( this );
  209. ASSERT_VALID( pTBB );
  210. lParam;
  211. INT nAdvance = UiScalingDo( 39, __EUIST_Y );
  212. CRect rc = *pTBB;
  213. rc.top += nAdvance;
  214. return rc;
  215. }
  216. CRect CExtPaintManagerOffice2007_Impl::Ribbon_CalcLargeDropDownRect(
  217. const CExtBarButton * pTBB,
  218. LPARAM lParam // = 0L
  219. )
  220. {
  221. ASSERT_VALID( this );
  222. ASSERT_VALID( pTBB );
  223. if( IsHighContrast() )
  224. return 
  225. CExtPaintManagerXP::Ribbon_CalcLargeDropDownRect(
  226. pTBB,
  227. lParam
  228. );
  229. return
  230. CExtPaintManager::Ribbon_CalcLargeDropDownRect(
  231. pTBB,
  232. lParam
  233. );
  234. }
  235. void CExtPaintManager::Ribbon_PaintPushButton(
  236. CDC & dc,
  237. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  238. )
  239. {
  240. ASSERT_VALID( this );
  241. ASSERT( dc.GetSafeHdc() != NULL );
  242. if( _ppbd.m_rcClient.IsRectEmpty() )
  243. return;
  244. if( ! dc.RectVisible( &_ppbd.m_rcClient ) )
  245. return;
  246. ASSERT_VALID( _ppbd.m_pHelperSrc );
  247. CExtBarButton * pTBB = DYNAMIC_DOWNCAST( CExtBarButton, _ppbd.m_pHelperSrc );
  248. ASSERT( pTBB != NULL );
  249. CExtBarButton * pParentTBB = pTBB->ParentButtonGet();
  250. CExtRibbonButton * pRibbonTBB = DYNAMIC_DOWNCAST( CExtRibbonButton, _ppbd.m_pHelperSrc );
  251. CExtSafeString strText = pTBB->GetText();
  252. INT nTextLength = strText.GetLength();
  253. enum e_layout_case_t
  254. {
  255. __ELC_TOOL,
  256. __ELC_SMALL,
  257. __ELC_LARGE,
  258. };
  259. e_layout_case_t eLC = __ELC_TOOL;
  260. if( pRibbonTBB != NULL )
  261. {
  262. if( pParentTBB == NULL
  263. || pParentTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonToolGroup ) )
  264. )
  265. {
  266. if( pParentTBB == NULL )
  267. {
  268. const CExtRibbonNode * pRibbonNode = pTBB->Ribbon_GetNode();
  269. if( pRibbonNode != NULL )
  270. {
  271. const CExtCustomizeCmdTreeNode * pParentNode = pRibbonNode->GetParentNode();
  272. if( pParentNode != NULL
  273. && ( pParentNode->IsKindOf( RUNTIME_CLASS( CExtRibbonNodeRightButtonsCollection ) )
  274. || pParentNode->IsKindOf( RUNTIME_CLASS( CExtRibbonNodeQuickAccessButtonsCollection ) )
  275. )
  276. )
  277. eLC = __ELC_SMALL;
  278. } // if( pRibbonNode != NULL )
  279. } // if( pParentTBB == NULL )
  280. }
  281. else
  282. {
  283. if( pRibbonTBB->RibbonILV_Get() == __EXT_RIBBON_ILV_SIMPLE_LARGE )
  284. eLC = __ELC_LARGE;
  285. else
  286. eLC = __ELC_SMALL;
  287. }
  288. } // if( pRibbonTBB != NULL )
  289. else
  290. {
  291. if( pParentTBB == NULL
  292. || ( ! pParentTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonToolGroup ) ) )
  293. )
  294. eLC = __ELC_SMALL;
  295. } // if( pRibbonTBB != NULL )
  296. INT nILV = pTBB->RibbonILV_Get();
  297. CRect rcCP = pTBB->OnRibbonGetContentPadding();
  298. CRect rcIcon = _ppbd.m_rcClient;
  299. rcIcon.DeflateRect( rcCP.left, rcCP.top, rcCP.right, rcCP.bottom );
  300. INT nTextToIconDistance = 0;
  301. CRect rcText =  rcIcon;
  302. CSize _sizeIcon( 0, 0 );
  303. CExtCmdIcon * pCmdIcon = pTBB->GetIconPtr();
  304. if( pCmdIcon != NULL && (! pCmdIcon->IsEmpty() ) )
  305. {
  306. _sizeIcon = Ribbon_GetIconSize( pTBB, nILV, _ppbd.m_lParam );
  307. if( nTextLength >= 0 )
  308. nTextToIconDistance = Ribbon_GetTextToIconDistance( dc, nILV, pTBB, _ppbd.m_lParam );
  309. if( eLC == __ELC_LARGE )
  310. {
  311. rcIcon.bottom = rcIcon.top + _sizeIcon.cy;
  312. rcIcon.OffsetRect( ( rcIcon.Width() - _sizeIcon.cx ) / 2, 4 );
  313. if( nTextLength > 0 )
  314. {
  315. rcText.top = rcIcon.bottom;
  316. rcText.top += nTextToIconDistance;
  317. };
  318. } // if( eLC == __ELC_LARGE )
  319. else
  320. {
  321. if( nTextLength > 0 )
  322. {
  323. rcIcon.right = rcText.left = rcIcon.left + _sizeIcon.cx;
  324. rcText.left += nTextToIconDistance;
  325. }
  326. else
  327. {
  328. rcIcon = _ppbd.m_rcClient;
  329. if( pTBB->IsAbleToTrackMenu()
  330. //&& _ppbd.m_bSeparatedDropDown
  331. && (! pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonGroup ) ) )
  332. )
  333. rcIcon.right -= GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  334. rcIcon.OffsetRect( ( rcIcon.Width() - _sizeIcon.cx ) / 2 + 1, 0 );
  335. }
  336. rcIcon.OffsetRect( 0, ( rcIcon.Height() - _sizeIcon.cy ) / 2 );
  337. } // else from if( eLC == __ELC_LARGE )
  338. } // if( pCmdIcon != NULL && (! pCmdIcon->IsEmpty() ) )
  339. else
  340. pCmdIcon = NULL;
  341. bool bDrawDropDownWithText = _ppbd.m_bDropDown;
  342. switch( eLC )
  343. {
  344. case __ELC_TOOL:
  345. {
  346. bDrawDropDownWithText = false;
  347. PAINTPUSHBUTTONDATA _ppbd2 = _ppbd;
  348. _ppbd2.m_pHelperSrc = NULL;
  349. _ppbd2.m_pIcon = NULL;
  350. _ppbd2.m_sText = _T("");
  351. _ppbd2.m_bTransparentBackground = false;
  352. // _ppbd2.m_bDropDown = false;
  353. // _ppbd2.m_bSeparatedDropDown = false;
  354. // _ppbd2.m_bPushedDropDown = false;
  355. _ppbd2.m_bFlat = false;
  356. if( ! ( _ppbd2.m_bHover || _ppbd2.m_bPushed || _ppbd2.m_bIndeterminate ) )
  357. _ppbd2.m_clrForceBk = GetColor( CLR_3DFACE_OUT, _ppbd2.m_pHelperSrc, _ppbd2.m_lParam );
  358. PaintPushButton( dc, _ppbd2 );
  359. if( _ppbd2.m_bDropDown )
  360. rcIcon.OffsetRect( _ppbd.m_rcClient.left - rcIcon.left + 5, 0 );
  361. }
  362. break; // case __ELC_TOOL
  363. case __ELC_LARGE:
  364. ASSERT_VALID( pTBB );
  365. rcText = Ribbon_CalcLargeDropDownRect( pTBB );
  366. if( ! pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButton ) ) )
  367. bDrawDropDownWithText = false;
  368. case __ELC_SMALL:
  369. {
  370. if( _ppbd.m_bEnabled && ( _ppbd.m_bHover || _ppbd.m_bPushed || _ppbd.m_bIndeterminate )  )
  371. {
  372. PAINTPUSHBUTTONDATA _ppbd2 = _ppbd;
  373. _ppbd2.m_pHelperSrc = NULL;
  374. _ppbd2.m_pIcon = NULL;
  375. _ppbd2.m_sText = _T("");
  376. _ppbd2.m_bTransparentBackground = false;
  377. _ppbd2.m_bNoDropDownArrow = true;
  378. bool bDrawSepH = false;
  379. if( eLC == __ELC_LARGE )
  380. {
  381. _ppbd2.m_bDropDown = false;
  382. _ppbd2.m_bSeparatedDropDown = false;
  383. _ppbd2.m_bPushedDropDown = false;
  384. bDrawSepH = _ppbd.m_bDropDown && _ppbd.m_bSeparatedDropDown;
  385. }
  386. _ppbd2.m_bFlat = true;
  387. PaintPushButton( dc, _ppbd2 );
  388. if( bDrawSepH )
  389. {
  390. CRect rcSepH = rcText;
  391. rcSepH.bottom = rcSepH.top + 3;
  392. rcSepH.DeflateRect( 3, 0, 2, 0 );
  393. //  if( g_PaintManager.m_nLPY > 96 )
  394. //  {
  395. //  INT nAdvace = UiScalingDo( 4, __EUIST_Y );
  396. //  rcSepH.OffsetRect( 0, nAdvace );
  397. //  }
  398. PaintSeparator( dc, rcSepH, false, true, NULL );
  399. } // if( bDrawSepH )
  400. } // if( _ppbd.m_bEnabled && ( _ppbd.m_bHover || _ppbd.m_bPushed || _ppbd.m_bIndeterminate )  )
  401. }
  402. break; // cases __ELC_LARGE and __ELC_SMALL
  403. } // switch( eLC )
  404. if( pCmdIcon != NULL )
  405. {
  406. ASSERT( ! pCmdIcon->IsEmpty() );
  407. CSize _sizeRealIcon = pCmdIcon->GetSize();
  408. if( _sizeRealIcon != _sizeIcon )
  409. rcIcon.OffsetRect(
  410. ( _sizeIcon.cx - _sizeRealIcon.cx ) / 2,
  411. ( _sizeIcon.cy - _sizeRealIcon.cy) / 2
  412. );
  413. rcIcon.right = rcIcon.left + _sizeRealIcon.cx;
  414. rcIcon.bottom = rcIcon.top + _sizeRealIcon.cy;
  415. bool bCenterBigIconVerticallyMode = ( eLC == __ELC_LARGE && nTextLength == 0 && ( ! _ppbd.m_bDropDown ) ) ? true : false;
  416. if( bCenterBigIconVerticallyMode)
  417. rcIcon.OffsetRect(
  418. 0,
  419. _ppbd.m_rcClient.top - rcIcon.top + ( _ppbd.m_rcClient.Height() - rcIcon.Height() ) / 2
  420. );
  421. CExtCmdIcon::e_paint_type_t ePT = CExtCmdIcon::__PAINT_DISABLED;
  422. if( _ppbd.m_bEnabled )
  423. {
  424. if( _ppbd.m_bPushed )
  425. ePT = CExtCmdIcon::__PAINT_PRESSED;
  426. else if( _ppbd.m_bHover )
  427. ePT = CExtCmdIcon::__PAINT_HOVER;
  428. else
  429. ePT = CExtCmdIcon::__PAINT_NORMAL;
  430. } // if( _ppbd.m_bEnabled )
  431. pCmdIcon->Paint(
  432. this,
  433. dc.m_hDC,
  434. rcIcon,
  435. ePT
  436. );
  437. } // if( pCmdIcon != NULL )
  438. if( nTextLength > 0 || _ppbd.m_bDropDown )
  439. {
  440. UINT nDT = 0;
  441. if( eLC != __ELC_LARGE )
  442. {
  443. strText.Replace( _T("r"), _T(" ") );
  444. strText.Replace( _T("n"), _T(" ") );
  445. strText.Replace( _T("t"), _T(" ") );
  446. strText.Replace( _T("  "), _T(" ") );
  447. strText.TrimLeft( _T(" ") );
  448. strText.TrimRight( _T(" ") );
  449. nTextLength = INT( strText.GetLength() );
  450. nDT = DT_CENTER|DT_VCENTER|DT_SINGLELINE;
  451. } // if( eLC != __ELC_LARGE )
  452. else
  453. nDT = DT_CENTER|DT_TOP;
  454. if( nTextLength > 0 || _ppbd.m_bDropDown )
  455. {
  456. CFont * pFont = pTBB->GetBar()->OnGetToolbarFont( false, false );
  457. ASSERT( pFont->GetSafeHandle() != NULL );
  458. CFont * pOldFont = dc.SelectObject( pFont );
  459. int nOldBkMode = dc.SetBkMode( TRANSPARENT );
  460. COLORREF clrText = GetColor( _ppbd.m_bEnabled ? COLOR_BTNTEXT : CLR_TEXT_DISABLED );
  461. COLORREF clrOldText = dc.SetTextColor( clrText );
  462. // if( eLC == __ELC_LARGE )
  463. Ribbon_PaintText(
  464. dc,
  465. ( nTextLength > 0 ) ? LPCTSTR(strText) : _T(""),
  466. rcText,
  467. nDT,
  468. bDrawDropDownWithText,
  469. NULL,
  470. _ppbd.m_pHelperSrc,
  471. _ppbd.m_lParam
  472. );
  473. // else
  474. // dc.DrawText(
  475. // LPCTSTR(strText),
  476. // nTextLength,
  477. // rcText,
  478. // nDT
  479. // );
  480. dc.SetTextColor( clrOldText );
  481. dc.SetBkMode( nOldBkMode );
  482. dc.SelectObject( pOldFont );
  483. } // if( nTextLength > 0 || _ppbd.m_bDropDown )
  484. } // if( nTextLength > 0 || _ppbd.m_bDropDown )
  485. }
  486. void CExtPaintManagerOffice2007_Impl::Ribbon_PaintPushButton(
  487. CDC & dc,
  488. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  489. )
  490. {
  491. ASSERT_VALID( this );
  492. ASSERT( dc.GetSafeHdc() != NULL );
  493. if( _ppbd.m_rcClient.IsRectEmpty() )
  494. return;
  495. if( ! dc.RectVisible( &_ppbd.m_rcClient ) )
  496. return;
  497. ASSERT_VALID( _ppbd.m_pHelperSrc );
  498. if( IsHighContrast() )
  499. {
  500. CExtPaintManagerXP::Ribbon_PaintPushButton( dc, _ppbd );
  501. return;
  502. }
  503. CExtBarButton * pTBB = DYNAMIC_DOWNCAST( CExtBarButton, _ppbd.m_pHelperSrc );
  504. ASSERT( pTBB != NULL );
  505. CExtBarButton * pParentTBB = pTBB->ParentButtonGet();
  506. CExtRibbonButton * pRibbonTBB = DYNAMIC_DOWNCAST( CExtRibbonButton, _ppbd.m_pHelperSrc );
  507. enum e_layout_case_t
  508. {
  509. __ELC_TOOL,
  510. __ELC_SMALL,
  511. __ELC_LARGE,
  512. };
  513. bool bF = false;
  514. e_layout_case_t eLC = __ELC_TOOL;
  515. e_button_tool_style_arr_t eBTS1 = __EBTSA_SOLID; //, eBTS2 = __EBTSA_SOLID;
  516. if( pRibbonTBB != NULL )
  517. {
  518. if( pParentTBB == NULL
  519. || pParentTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonToolGroup ) )
  520. )
  521. {
  522. if( pParentTBB == NULL )
  523. {
  524. const CExtRibbonNode * pRibbonNode = pTBB->Ribbon_GetNode();
  525. if( pRibbonNode != NULL )
  526. {
  527. const CExtCustomizeCmdTreeNode * pParentNode = pRibbonNode->GetParentNode();
  528. if( pParentNode != NULL
  529. && ( pParentNode->IsKindOf( RUNTIME_CLASS( CExtRibbonNodeRightButtonsCollection ) )
  530. || pParentNode->IsKindOf( RUNTIME_CLASS( CExtRibbonNodeQuickAccessButtonsCollection ) )
  531. )
  532. )
  533. eLC = __ELC_SMALL;
  534. } // if( pRibbonNode != NULL )
  535. } // if( pParentTBB == NULL )
  536. }
  537. else
  538. {
  539. if( pRibbonTBB->RibbonILV_Get() == __EXT_RIBBON_ILV_SIMPLE_LARGE )
  540. eLC = __ELC_LARGE;
  541. else
  542. eLC = __ELC_SMALL;
  543. }
  544. } // if( pRibbonTBB != NULL )
  545. else
  546. {
  547. if( pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonFile ) )
  548. || pTBB->IsKindOf( RUNTIME_CLASS( CExtBarCheckBoxButton ) )
  549. || pTBB->IsKindOf( RUNTIME_CLASS( CExtBarRadioBoxButton ) )
  550. || pParentTBB == NULL
  551. || ( ! pParentTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonToolGroup ) ) )
  552. )
  553. {
  554. eLC = __ELC_SMALL;
  555. bF = true;
  556. }
  557. } // if( pRibbonTBB != NULL )
  558. CExtBitmap * pBmp1 = NULL, * pBmp2 = NULL, * pBmp3 = NULL, * pBmp4 = NULL;
  559. CRect rcSrc1( 0, 0, 0, 0 ), rcDst1( 0, 0, 0, 0 ), rcPadding1( 0, 0, 0, 0 );
  560. CRect rcSrc2( 0, 0, 0, 0 ), rcDst2( 0, 0, 0, 0 ), rcPadding2( 0, 0, 0, 0 );
  561. CRect rcSrc3( 0, 0, 0, 0 ), rcDst3( 0, 0, 0, 0 ), rcPadding3( 0, 0, 0, 0 );
  562. CRect rcSrc4( 0, 0, 0, 0 ), rcDst4( 0, 0, 0, 0 ), rcPadding4( 0, 0, 0, 0 );
  563. CExtSafeString strText = pTBB->GetText();
  564. INT nTextLength = strText.GetLength();
  565. INT nILV = pTBB->RibbonILV_Get();
  566. CRect rcCP = pTBB->OnRibbonGetContentPadding();
  567. CRect rcIcon = _ppbd.m_rcClient;
  568. rcIcon.DeflateRect( rcCP.left, rcCP.top, rcCP.right, rcCP.bottom );
  569. INT nTextToIconDistance = 0;
  570. CRect rcText =  rcIcon;
  571. //  if( pTBB->IsAbleToTrackMenu()
  572. //  && eLC != __ELC_LARGE
  573. //  )
  574. //  {
  575. //  INT nDropDownButtonWidth = GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  576. //  rcIcon.right -= nDropDownButtonWidth + 3;
  577. //  }
  578. CSize _sizeIcon( 0, 0 );
  579. CExtCmdIcon * pCmdIcon = pTBB->GetIconPtr();
  580. if( pCmdIcon != NULL && (! pCmdIcon->IsEmpty() ) )
  581. {
  582. _sizeIcon = Ribbon_GetIconSize( pTBB, nILV, _ppbd.m_lParam );
  583. if( nTextLength >= 0 )
  584. nTextToIconDistance = Ribbon_GetTextToIconDistance( dc, nILV, pTBB, _ppbd.m_lParam );
  585. if( eLC == __ELC_LARGE )
  586. {
  587. rcIcon.bottom = rcIcon.top + _sizeIcon.cy;
  588. rcIcon.OffsetRect( ( rcIcon.Width() - _sizeIcon.cx ) / 2, 4 );
  589. if( nTextLength > 0 )
  590. {
  591. rcText.top = rcIcon.bottom;
  592. rcText.top += nTextToIconDistance;
  593. };
  594. } // if( eLC == __ELC_LARGE )
  595. else
  596. {
  597. if( nTextLength > 0 )
  598. {
  599. rcIcon.right = rcText.left = rcIcon.left + _sizeIcon.cx;
  600. rcText.left += nTextToIconDistance;
  601. }
  602. else
  603. {
  604. rcIcon = _ppbd.m_rcClient;
  605. if( pTBB->IsAbleToTrackMenu()
  606. //&& _ppbd.m_bSeparatedDropDown
  607. && (! pTBB->IsKindOf( RUNTIME_CLASS( CExtRibbonButtonGroup ) ) )
  608. )
  609. rcIcon.right -= GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  610. rcIcon.OffsetRect( ( rcIcon.Width() - _sizeIcon.cx ) / 2 + 1, 0 );
  611. }
  612. rcIcon.OffsetRect( 0, ( rcIcon.Height() - _sizeIcon.cy ) / 2 );
  613. } // else from if( eLC == __ELC_LARGE )
  614. } // if( pCmdIcon != NULL && (! pCmdIcon->IsEmpty() ) )
  615. else
  616. pCmdIcon = NULL;
  617. CExtToolControlBar * pToolBar = pTBB->GetBar();
  618. ASSERT_VALID( pToolBar );
  619. CExtMenuControlBar * pMenuBar = DYNAMIC_DOWNCAST( CExtMenuControlBar, pToolBar );
  620. bool bSelTrackingMode = false;
  621. if( pMenuBar != NULL
  622. && pMenuBar->IsMenuBarTracking()
  623. && pMenuBar->_FlatTrackingIndexGet() == pMenuBar->_GetIndexOf( pTBB )
  624. )
  625. bSelTrackingMode = true;
  626. bool bDrawDropDownWithText = _ppbd.m_bDropDown;
  627. switch( eLC )
  628. {
  629. case __ELC_TOOL:
  630. {
  631. bDrawDropDownWithText = false;
  632. if( pTBB->IsAbleToTrackMenu()
  633. //&& _ppbd.m_bSeparatedDropDown
  634. )
  635. rcIcon.OffsetRect( _ppbd.m_rcClient.left - rcIcon.left + 3, 0 );
  636. if( pParentTBB != NULL )
  637. {
  638. ASSERT_KINDOF( CExtRibbonButtonToolGroup, pParentTBB );
  639. INT nSiblingCount = pParentTBB->ChildButtonGetCount();
  640. ASSERT( nSiblingCount > 0 );
  641. CExtBarButton * pFirstTBB = pParentTBB->ChildButtonGetAt( 0 );
  642. ASSERT_VALID( pFirstTBB );
  643. CExtBarButton * pLastTBB = pParentTBB->ChildButtonGetAt( nSiblingCount - 1 );
  644. ASSERT_VALID( pLastTBB );
  645. if( LPVOID(pTBB) == LPVOID(pFirstTBB) )
  646. {
  647. if( LPVOID(pTBB) == LPVOID(pLastTBB) )
  648. {
  649. // if( ! _ppbd.m_bSeparatedDropDown )
  650. eBTS1 = __EBTSA_SOLID;
  651. // else
  652. // {
  653. // eBTS1 = __EBTSA_LEFT;
  654. // eBTS2 = __EBTSA_RIGHT;
  655. // }
  656. }
  657. else
  658. {
  659. eBTS1 = __EBTSA_LEFT;
  660. // if( _ppbd.m_bSeparatedDropDown )
  661. // eBTS2 = __EBTSA_MIDDLE;
  662. }
  663. } // if( LPVOID(pTBB) == LPVOID(pFirstTBB) )
  664. else if( LPVOID(pTBB) == LPVOID(pLastTBB) )
  665. {
  666. // if( ! _ppbd.m_bSeparatedDropDown )
  667. eBTS1 = __EBTSA_RIGHT;
  668. // else
  669. // {
  670. // eBTS1 = __EBTSA_MIDDLE;
  671. // eBTS2 = __EBTSA_RIGHT;
  672. // }
  673. }
  674. else
  675. eBTS1 = __EBTSA_MIDDLE; // eBTS1 = eBTS2 = __EBTSA_MIDDLE;
  676. if( Ribbon_HaveSeparatorsBetweenToolGroups() )
  677. {
  678. CExtBarButton * pParentParentTBB = pParentTBB->ParentButtonGet();
  679. if( pParentParentTBB != NULL )
  680. {
  681. ASSERT_VALID( pParentParentTBB );
  682. CExtBarButton * pParentParentFirstTBB = pParentParentTBB->ChildButtonGetAt( 0 );
  683. ASSERT_VALID( pParentParentFirstTBB );
  684. if( LPVOID(pParentTBB) != LPVOID(pParentParentFirstTBB) )
  685. {
  686. INT nPPCount = pParentParentTBB->ChildButtonGetCount();
  687. ASSERT( nPPCount > 0 );
  688. CExtBarButton * pParentParentLastTBB = pParentParentTBB->ChildButtonGetAt( nPPCount - 1 );
  689. ASSERT_VALID( pParentParentLastTBB );
  690. if( LPVOID(pParentTBB) != LPVOID(pParentParentLastTBB) )
  691. {
  692. INT nTGI = pParentParentTBB->ChildButtonGetIndexOf( pParentTBB );
  693. ASSERT( nTGI < ( nPPCount - 1 ) );
  694. CExtBarButton * pNextTGTBB = pParentParentTBB->ChildButtonGetAt( nTGI + 1 );
  695. ASSERT_VALID( pNextTGTBB );
  696. //ASSERT_KINDOF( CExtRibbonButtonToolGroup, pNextTGTBB );
  697. CRect rcNextTG = pNextTGTBB->Rect();
  698. CRect rcThisTG = pParentTBB->Rect();
  699. if( rcThisTG.top == rcNextTG.top && rcThisTG.bottom == rcNextTG.bottom )
  700. {
  701. CRect rcSepTG( rcThisTG.right, rcThisTG.top, rcNextTG.left, rcThisTG.bottom );
  702. if( rcSepTG.left < rcSepTG.right )
  703. {
  704. //dc.FillSolidRect( &rcSepTG, 255 );
  705. Ribbon_PaintSeparator( dc, rcSepTG, NULL );
  706. }
  707. }
  708. }
  709. }
  710. }
  711. }
  712. } // if( pParentTBB != NULL )
  713. INT nImgIndex1 = INT(__E07BI_NORMAL);
  714. INT nImgIndex2 = INT(__E07BI_NORMAL);
  715. if( bSelTrackingMode )
  716. nImgIndex1 = nImgIndex2 = INT(__E07BI_SEL_T);
  717. else if( _ppbd.m_bEnabled )
  718. {
  719. if( _ppbd.m_bPushed || ( _ppbd.m_bIndeterminate && ( ! _ppbd.m_bHover ) ) )
  720. {
  721. nImgIndex1 = nImgIndex2 = INT(__E07BI_PRESSED);
  722. if( _ppbd.m_bSeparatedDropDown )
  723. {
  724. if( _ppbd.m_bPushedDropDown )
  725. nImgIndex1 = INT(__E07BI_SEL_T);
  726. else
  727. nImgIndex2 = INT(__E07BI_SEL_T);
  728. }
  729. }
  730. else if( _ppbd.m_bHover )
  731. {
  732. nImgIndex1 = nImgIndex2 = INT(__E07BI_HOVER);
  733. if( _ppbd.m_bSeparatedDropDown )
  734. {
  735. if( _ppbd.m_bHoverDropDown )
  736. nImgIndex1 = INT(__E07BI_SEL_T);
  737. else
  738. nImgIndex2 = INT(__E07BI_SEL_T);
  739. }
  740. }
  741. else if( _ppbd.m_bIndeterminate )
  742. nImgIndex1 = nImgIndex2 = INT(__E07BIX_INDETERMINATE);
  743. } // else if( _ppbd.m_bEnabled )
  744. nImgIndex1 = m_arrIndicesButtonTS[nImgIndex1];
  745. nImgIndex2 = m_arrIndicesButtonTS[nImgIndex2];
  746. if( nImgIndex1 >= 0 )
  747. {
  748. pBmp1 = &( m_bmpArrButtonTS[ INT(eBTS1) ] );
  749. rcPadding1 = m_rcPaddingOfButtonTS;
  750. CSize _sizeBmp = pBmp1->GetSize();
  751. rcSrc1.SetRect( 0, 0, _sizeBmp.cx, m_nHeightOfButtonTS );
  752. rcSrc1.OffsetRect( 0, m_nHeightOfButtonTS*nImgIndex1 );
  753. } // if( nImgIndex1 >= 0 )
  754. rcDst1 = rcDst2 = _ppbd.m_rcClient;
  755. if( _ppbd.m_bSeparatedDropDown
  756. && ( _ppbd.m_bHover || _ppbd.m_bPushed || _ppbd.m_bIndeterminate )
  757. && _ppbd.m_bEnabled
  758. )
  759. {
  760.   pBmp3 = &( m_bmpToolBtnSeparator[ ( _ppbd.m_bPushed || ( _ppbd.m_bIndeterminate && ( ! _ppbd.m_bHover ) ) ) ? INT(__ETBS_PRESSED) : INT(__ETBS_HOVER) ] );
  761.   rcPadding3 = m_rcPaddingOfToolButtonSeparator;
  762.   CSize _sizeBmp = pBmp3->GetSize();
  763.   rcSrc3.SetRect( 0, 0, _sizeBmp.cx, _sizeBmp.cy );
  764. INT nDropDownButtonWidth = GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  765.   rcDst3 = _ppbd.m_rcClient;
  766. rcDst3.right -= nDropDownButtonWidth;
  767. rcDst3.left = rcDst3.right - _sizeBmp.cx;
  768. } // if( _ppbd.m_bSeparatedDropDown ...
  769. if( _ppbd.m_bDropDown )
  770. {
  771. pBmp4 = &m_bmpRibbonDDA;
  772.   CSize _sizeBmp = pBmp4->GetSize();
  773.   rcSrc4.SetRect( 0, 0, _sizeBmp.cx, _sizeBmp.cy );
  774. INT nDropDownButtonWidth = GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  775.   rcDst4 = _ppbd.m_rcClient;
  776. rcDst4.left = rcDst4.right - nDropDownButtonWidth;
  777. rcDst4.left += ( rcDst4.Width() - _sizeBmp.cx ) / 2;
  778. rcDst4.top += ( rcDst4.Height() - _sizeBmp.cy ) / 2;
  779. rcDst4.right = rcDst4.left + _sizeBmp.cx;
  780. rcDst4.bottom = rcDst4.top + _sizeBmp.cy;
  781. } // if( _ppbd.m_bDropDown )
  782. if( _ppbd.m_bSeparatedDropDown && nImgIndex2 >= 0 )
  783. {
  784. pBmp2 = &( m_bmpArrButtonTS[ INT(eBTS1) ] );
  785. rcPadding2 = m_rcPaddingOfButtonTS;
  786. CSize _sizeBmp = pBmp2->GetSize();
  787. rcSrc2.SetRect( 0, 0, _sizeBmp.cx, m_nHeightOfButtonTS );
  788. rcSrc2.OffsetRect( 0, m_nHeightOfButtonTS*nImgIndex2 );
  789. INT nDropDownButtonWidth = GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  790. rcDst1.right = rcDst2.left = rcDst2.right - nDropDownButtonWidth;
  791. rcSrc1.right -= rcPadding1.right;
  792. rcSrc2.left += rcPadding2.left;
  793. rcPadding1.right = rcPadding2.left = 0;
  794. } // if( _ppbd.m_bSeparatedDropDown && nImgIndex2 >= 0 )
  795. }
  796. break; // case __ELC_TOOL
  797. case __ELC_SMALL:
  798. {
  799. INT nImgIndex1 = INT(__E07BI_NORMAL);
  800. INT nImgIndex2 = INT(__E07BI_NORMAL);
  801. if( bSelTrackingMode )
  802. {
  803. nImgIndex1 = nImgIndex2 = INT(__E07BI_SEL_T);
  804. }
  805. else if( _ppbd.m_bEnabled )
  806. {
  807. if( _ppbd.m_bPushed || ( _ppbd.m_bIndeterminate && ( ! _ppbd.m_bHover ) ) )
  808. {
  809. nImgIndex1 = nImgIndex2 = INT(__E07BI_PRESSED);
  810. if( _ppbd.m_bSeparatedDropDown )
  811. {
  812. if( _ppbd.m_bPushedDropDown )
  813. nImgIndex1 = INT(__E07BI_SEL_T);
  814. else
  815. nImgIndex2 = INT(__E07BI_SEL_T);
  816. }
  817. }
  818. else if( _ppbd.m_bHover )
  819. {
  820. nImgIndex1 = nImgIndex2 = INT(__E07BI_HOVER);
  821. if( _ppbd.m_bSeparatedDropDown )
  822. {
  823. if( _ppbd.m_bHoverDropDown )
  824. nImgIndex1 = INT(__E07BI_SEL_T);
  825. else
  826. nImgIndex2 = INT(__E07BI_SEL_T);
  827. }
  828. }
  829. else if( _ppbd.m_bIndeterminate )
  830. nImgIndex1 = nImgIndex2 = INT(__E07BIX_INDETERMINATE);
  831. } // else if( _ppbd.m_bEnabled )
  832. nImgIndex1 = m_arrIndicesButtonSS_Left[nImgIndex1];
  833. nImgIndex2 = m_arrIndicesButtonSS_Right[nImgIndex2];
  834. if( nImgIndex1 >= 0 )
  835. {
  836. if( _ppbd.m_bSeparatedDropDown )
  837. {
  838. ASSERT( nImgIndex2 >= 0 );
  839. pBmp1 = &( m_bmpArrButtonSS_DD[INT(__EBSSA_LEFT)] );
  840. pBmp2 = &( m_bmpArrButtonSS_DD[INT(__EBSSA_RIGHT)] );
  841. rcPadding1 = rcPadding2 = m_rcPaddingOfButtonSS;
  842. CSize _sizeBmp1 = pBmp1->GetSize();
  843. CSize _sizeBmp2 = pBmp2->GetSize();
  844. rcSrc1.SetRect( 0, 0, _sizeBmp1.cx, m_nHeightOfButtonSS );
  845. rcSrc2.SetRect( 0, 0, _sizeBmp2.cx, m_nHeightOfButtonSS );
  846. rcSrc1.OffsetRect( 0, m_nHeightOfButtonSS*nImgIndex1 );
  847. rcSrc2.OffsetRect( 0, m_nHeightOfButtonSS*nImgIndex2 );
  848. rcDst1 = rcDst2 = _ppbd.m_rcClient;
  849. INT nDropDownButtonWidth = GetDropDownButtonWidth( _ppbd.m_pHelperSrc, _ppbd.m_lParam );
  850. nDropDownButtonWidth -= rcPadding1.right + 1;
  851. rcDst1.right -= nDropDownButtonWidth;
  852. rcDst2.left = rcDst2.right - nDropDownButtonWidth;
  853. } // if( _ppbd.m_bSeparatedDropDown )
  854. else
  855. {
  856. pBmp1 = &( m_bmpArrButtonSS_simple );
  857. rcPadding1 = m_rcPaddingOfButtonSS;
  858. CSize _sizeBmp = pBmp1->GetSize();
  859. rcSrc1.SetRect( 0, 0, _sizeBmp.cx, m_nHeightOfButtonSS );
  860. rcSrc1.OffsetRect( 0, m_nHeightOfButtonSS*nImgIndex1 );
  861. rcDst1 = _ppbd.m_rcClient;
  862. } // else from if( _ppbd.m_bSeparatedDropDown )
  863. } // if( nImgIndex1 >= 0 )
  864. }
  865. break; // case __ELC_SMALL
  866. case __ELC_LARGE:
  867. {
  868. ASSERT_VALID( pTBB );
  869. rcText = Ribbon_CalcLargeDropDownRect( pTBB );
  870. INT nImgIndex1 = INT(__E07BIX_NORMAL);
  871. INT nImgIndex2 = INT(__E07BIX_NORMAL);
  872. if( bSelTrackingMode )
  873. nImgIndex1 = nImgIndex2 = INT(__E07BIX_SELECTED);
  874. else if( _ppbd.m_bEnabled )
  875. {
  876. if( _ppbd.m_bPushed )
  877. {
  878. nImgIndex1 = nImgIndex2 = INT(__E07BIX_PRESSED);
  879. if( _ppbd.m_bSeparatedDropDown )
  880. {
  881. if( _ppbd.m_bPushedDropDown )
  882. nImgIndex1 = INT(__E07BIX_HOVER2);
  883. else
  884. nImgIndex2 = INT(__E07BIX_HOVER2);
  885. }
  886. } // if( _ppbd.m_bPushed )
  887. else if( _ppbd.m_bHover )
  888. {
  889. nImgIndex1 = nImgIndex2 = INT(__E07BIX_HOVER);
  890. if( _ppbd.m_bSeparatedDropDown )
  891. {
  892. if( _ppbd.m_bHoverDropDown )
  893. nImgIndex1 = INT(__E07BIX_HOVER2);
  894. else
  895. nImgIndex2 = INT(__E07BIX_HOVER2);
  896. }
  897. } // else if( _ppbd.m_bHover )
  898. else if( _ppbd.m_bIndeterminate )
  899. nImgIndex1 = nImgIndex2 = INT(__E07BIX_INDETERMINATE);
  900. } // else if( _ppbd.m_bEnabled )
  901. nImgIndex1 = m_arrIndicesButtonLSXM[nImgIndex1];
  902. nImgIndex2 = m_arrIndicesButtonLSXB[nImgIndex2];
  903. if( nImgIndex1 >= 0 && nImgIndex2 >= 0 )
  904. {
  905. pBmp1 = &m_bmpArrButtonLSXM;
  906. pBmp2 = &m_bmpArrButtonLSXB;
  907. rcPadding1 = m_rcPaddingOfButtonLSXM;
  908. rcPadding2 = m_rcPaddingOfButtonLSXB;
  909. CSize _sizeBmp = pBmp1->GetSize();
  910. rcSrc1.SetRect( 0, 0, _sizeBmp.cx, m_nHeightOfButtonLSXM );
  911. rcSrc1.OffsetRect( 0, m_nHeightOfButtonLSXM*nImgIndex1 );
  912. _sizeBmp = pBmp2->GetSize();
  913. rcSrc2.SetRect( 0, 0, _sizeBmp.cx, m_nHeightOfButtonLSXB );
  914. rcSrc2.OffsetRect( 0, m_nHeightOfButtonLSXB*nImgIndex2 );
  915. if( ! _ppbd.m_bSeparatedDropDown )
  916. {
  917. rcSrc1.bottom -= rcPadding1.bottom;
  918. rcSrc2.top += rcPadding1.top;
  919. }
  920. rcDst1 = rcDst2 = _ppbd.m_rcClient;
  921. rcDst1.bottom = rcDst2.top = rcText.top;
  922. } // if( nImgIndex1 >= 0 && nImgIndex2 >= 0 )
  923. }
  924. break; // case __ELC_LARGE
  925. } // switch( eLC )
  926. // DWORD dwDcLayout = dc.GetLayout();
  927. //  if( dwDcLayout&LAYOUT_RTL )
  928. //  dc.SetLayout( LAYOUT_LTR );
  929. BYTE nButtonIndeterminateSCA = BYTE(0x0FF);
  930. if( _ppbd.m_bIndeterminate
  931. && _ppbd.m_bEnabled
  932. && ( ! _ppbd.m_bHover )
  933. && ( ! _ppbd.m_bPushed )
  934. && ( ! _ppbd.m_bPushedDropDown )
  935. )
  936. nButtonIndeterminateSCA = BYTE(0x060);
  937. if( pBmp1 != NULL
  938. && (! pBmp1->IsEmpty() )
  939. && (! rcSrc1.IsRectEmpty() )
  940. && (! rcDst1.IsRectEmpty() )
  941. && dc.RectVisible( &rcDst1 )
  942. )
  943. pBmp1->AlphaBlendSkinParts(
  944. dc.m_hDC,
  945. rcDst1,
  946. rcSrc1,
  947. rcPadding1,
  948. CExtBitmap::__EDM_STRETCH,
  949. true,
  950. true,
  951. nButtonIndeterminateSCA
  952. );
  953. if( pBmp2 != NULL
  954. && (! pBmp2->IsEmpty() )
  955. && (! rcSrc2.IsRectEmpty() )
  956. && (! rcDst2.IsRectEmpty() )
  957. && dc.RectVisible( &rcDst2 )
  958. )
  959. pBmp2->AlphaBlendSkinParts(
  960. dc.m_hDC,
  961. rcDst2,
  962. rcSrc2,
  963. rcPadding2,
  964. CExtBitmap::__EDM_STRETCH,
  965. true,
  966. true,
  967. nButtonIndeterminateSCA
  968. );
  969. if( pBmp3 != NULL
  970. && (! pBmp3->IsEmpty() )
  971. && (! rcSrc3.IsRectEmpty() )
  972. && (! rcDst3.IsRectEmpty() )
  973. && dc.RectVisible( &rcDst3 )
  974. )
  975. pBmp3->AlphaBlendSkinParts(
  976. dc.m_hDC,
  977. rcDst3,
  978. rcSrc3,
  979. rcPadding3,
  980. CExtBitmap::__EDM_STRETCH,
  981. true,
  982. true,
  983. nButtonIndeterminateSCA
  984. );
  985. if( pBmp4 != NULL
  986. && (! pBmp4->IsEmpty() )
  987. && (! rcSrc4.IsRectEmpty() )
  988. && (! rcDst4.IsRectEmpty() )
  989. && dc.RectVisible( &rcDst4 )
  990. )
  991. pBmp4->AlphaBlendSkinParts(
  992. dc.m_hDC,
  993. rcDst4,
  994. rcSrc4,
  995. rcPadding4,
  996. CExtBitmap::__EDM_STRETCH,
  997. true,
  998. true,
  999. nButtonIndeterminateSCA
  1000. );
  1001. if( pCmdIcon != NULL )
  1002. {
  1003. ASSERT( ! pCmdIcon->IsEmpty() );
  1004. CSize _sizeRealIcon = pCmdIcon->GetSize();
  1005. if( _sizeRealIcon != _sizeIcon )
  1006. rcIcon.OffsetRect(
  1007. ( _sizeIcon.cx - _sizeRealIcon.cx ) / 2,
  1008. ( _sizeIcon.cy - _sizeRealIcon.cy) / 2
  1009. );
  1010. rcIcon.right = rcIcon.left + _sizeRealIcon.cx;
  1011. rcIcon.bottom = rcIcon.top + _sizeRealIcon.cy;
  1012. //  CSize _sizeAdjust = rcIcon.Size() - _sizeIcon;
  1013. //  //  if( _sizeAdjust.cx > 1 || _sizeAdjust.cy > 1 )
  1014. //  //  rcIcon.OffsetRect( _sizeAdjust.cx/2, _sizeAdjust.cy/2 );
  1015. //  rcIcon.right = rcIcon.left + _sizeIcon.cx;
  1016. //  rcIcon.bottom = rcIcon.top + _sizeIcon.cy;
  1017. bool bCenterBigIconVerticallyMode = ( eLC == __ELC_LARGE && nTextLength == 0 && ( ! _ppbd.m_bDropDown ) ) ? true : false;
  1018. if( bCenterBigIconVerticallyMode)
  1019. rcIcon.OffsetRect(
  1020. 0,
  1021. _ppbd.m_rcClient.top - rcIcon.top + ( _ppbd.m_rcClient.Height() - rcIcon.Height() ) / 2
  1022. );
  1023. CExtCmdIcon::e_paint_type_t ePT = CExtCmdIcon::__PAINT_DISABLED;
  1024. if( _ppbd.m_bEnabled )
  1025. {
  1026. if( _ppbd.m_bPushed )
  1027. ePT = CExtCmdIcon::__PAINT_PRESSED;
  1028. else if( _ppbd.m_bHover )
  1029. ePT = CExtCmdIcon::__PAINT_HOVER;
  1030. else
  1031. ePT = CExtCmdIcon::__PAINT_NORMAL;
  1032. } // if( _ppbd.m_bEnabled )
  1033. pCmdIcon->Paint( this, dc.m_hDC, rcIcon, ePT );
  1034. } // if( pCmdIcon != NULL )
  1035. //  dc.SetLayout( dwDcLayout );
  1036. if( nTextLength > 0 || _ppbd.m_bDropDown )
  1037. {
  1038. UINT nDT = 0;
  1039. if( eLC != __ELC_LARGE )
  1040. {
  1041. strText.Replace( _T("r"), _T(" ") );
  1042. strText.Replace( _T("n"), _T(" ") );
  1043. strText.Replace( _T("t"), _T(" ") );
  1044. strText.Replace( _T("  "), _T(" ") );
  1045. strText.TrimLeft( _T(" ") );
  1046. strText.TrimRight( _T(" ") );
  1047. nTextLength = INT( strText.GetLength() );
  1048. nDT = ( bF ? DT_LEFT : DT_CENTER ) | DT_VCENTER | DT_SINGLELINE;
  1049. } // if( eLC != __ELC_LARGE )
  1050. else
  1051. nDT = DT_CENTER|DT_TOP;
  1052. if( nTextLength > 0 || _ppbd.m_bDropDown )
  1053. {
  1054. CFont * pFont = pTBB->GetBar()->OnGetToolbarFont( false, false );
  1055. ASSERT( pFont->GetSafeHandle() != NULL );
  1056. CFont * pOldFont = dc.SelectObject( pFont );
  1057. int nOldBkMode = dc.SetBkMode( TRANSPARENT );
  1058. COLORREF clrText = _ppbd.m_bEnabled ? m_clrRibbonButtonNormal : m_clrRibbonButtonDisabled;
  1059. if( ( ! ( _ppbd.m_bHover || _ppbd.m_bPushed ) )
  1060. && IsKindOf( RUNTIME_CLASS(CExtPaintManagerOffice2007_R2_Obsidian) )
  1061. )
  1062. {
  1063. CExtCustomizeCmdTreeNode * pNode = pTBB->GetCmdNode();
  1064. if( pNode != NULL )
  1065. {
  1066. pNode = pNode->GetParentNode();
  1067. if( pNode != NULL
  1068. && pNode->IsKindOf( RUNTIME_CLASS(CExtRibbonNodeRightButtonsCollection) )
  1069. )
  1070. clrText = _ppbd.m_bEnabled ? m_clrNcFrameTextActive : m_clrNcFrameTextInactive;
  1071. }
  1072. }
  1073. // if( bF
  1074. // && _ppbd.m_bEnabled
  1075. // && (! ( _ppbd.m_bPushed || _ppbd.m_bHover ) )
  1076. // && OnQueryPaintManagerName() == Office2007_R2_Obsidian
  1077. // )
  1078. // clrText = RGB(255,255,255);
  1079. COLORREF clrOldText = dc.SetTextColor( clrText );
  1080. // if( eLC == __ELC_LARGE )
  1081. Ribbon_PaintText(
  1082. dc,
  1083. ( nTextLength > 0 ) ? LPCTSTR(strText) : _T(""),
  1084. rcText,
  1085. nDT,
  1086. bDrawDropDownWithText,
  1087. &m_bmpRibbonDDA,
  1088. _ppbd.m_pHelperSrc,
  1089. _ppbd.m_lParam
  1090. );
  1091. // else
  1092. // dc.DrawText(
  1093. // LPCTSTR(strText),
  1094. // nTextLength,
  1095. // rcText,
  1096. // nDT
  1097. // );
  1098. dc.SetTextColor( clrOldText );
  1099. dc.SetBkMode( nOldBkMode );
  1100. dc.SelectObject( pOldFont );
  1101. } // if( nTextLength > 0 || _ppbd.m_bDropDown )
  1102. } // if( nTextLength > 0 || _ppbd.m_bDropDown )
  1103. }
  1104. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  1105. void CExtPaintManagerOffice2007_Impl::PaintPushButton(
  1106. CDC & dc,
  1107. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  1108. )
  1109. {
  1110. ASSERT_VALID( this );
  1111. ASSERT( dc.GetSafeHdc() != NULL );
  1112. if( _ppbd.m_rcClient.IsRectEmpty() )
  1113. return;
  1114. if( IsHighContrast() )
  1115. {
  1116. CExtPaintManagerXP::PaintPushButton( dc, _ppbd );
  1117. return;
  1118. }
  1119. if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) <= 8
  1120. || _ppbd.m_pHelperSrc == NULL
  1121. )
  1122. {
  1123. CExtPaintManagerOffice2003::PaintPushButton( dc, _ppbd );
  1124. return;
  1125. }
  1126. if( _ppbd.m_pHelperSrc != NULL
  1127. && _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPopupMenuWnd) )
  1128. && ( ((CExtPopupMenuWnd*)_ppbd.m_pHelperSrc)->TrackFlagsGet() & TPMX_RIBBON_MODE ) == 0
  1129. )
  1130. {
  1131. CExtPaintManagerOffice2003::PaintPushButton( dc, _ppbd );
  1132. return;
  1133. }
  1134. CExtBarButton * pTBB = DYNAMIC_DOWNCAST( CExtBarButton, _ppbd.m_pHelperSrc );
  1135. if( pTBB != NULL )
  1136. {
  1137. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  1138. if( pTBB->IsRibbonPaintingMode() )
  1139. {
  1140. Ribbon_PaintPushButton( dc, _ppbd );
  1141. return;
  1142. }
  1143. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  1144. CExtToolControlBar * pBar = pTBB->GetBar();
  1145. if( pBar == NULL )
  1146. {
  1147. CExtPaintManagerOffice2003::PaintPushButton( dc, _ppbd );
  1148. return;
  1149. }
  1150. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  1151. if( pBar->IsKindOf( RUNTIME_CLASS( CExtRibbonPage ) )
  1152. && (! pTBB->IsNoRibbonLayout() )
  1153. && (! pTBB->IsKindOf( RUNTIME_CLASS( CExtBarMdiRightButton ) ) )
  1154. )
  1155. {
  1156. Ribbon_PaintPushButton( dc, _ppbd );
  1157. return;
  1158. }
  1159. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  1160. CExtPaintManagerOffice2003::PaintPushButton( dc, _ppbd );
  1161. return;
  1162. } // if( pTBB != NULL )
  1163. enum ButtonDrawingMode
  1164. {
  1165. eModeControl,
  1166. eModeToolBar,
  1167. eModeMenuBar,
  1168. eModePopupMenu,
  1169. eModeDatePicker,
  1170. eModeToolBox,
  1171. };
  1172. bool bHorizontal = true;
  1173. ButtonDrawingMode aDrawingMode = eModeControl;
  1174. if( _ppbd.m_pHelperSrc != NULL  )
  1175. {
  1176. if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtBarButton ) ) )
  1177. {
  1178. CExtBarButton * pBarButton = (CExtBarButton*)_ppbd.m_pHelperSrc;
  1179. CExtToolControlBar * pToolBar = DYNAMIC_DOWNCAST( CExtToolControlBar, pBarButton->GetBar() );
  1180. ASSERT( pToolBar != NULL );
  1181. if( pToolBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar)) )
  1182. aDrawingMode = eModeMenuBar;
  1183. else
  1184. aDrawingMode = eModeToolBar;
  1185. if( ! pBarButton->GetNoRotateVerticalLayout() )
  1186. {
  1187. if( pToolBar->IsDockedVertically() )
  1188. bHorizontal = false;
  1189. }
  1190. }
  1191. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtPopupMenuWnd ) ) )
  1192. {
  1193. aDrawingMode = eModePopupMenu;
  1194. }
  1195. #ifndef __EXT_MFC_NO_DATE_PICKER
  1196. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtDatePickerWnd ) ) )
  1197. {
  1198. aDrawingMode = eModeDatePicker;
  1199. }
  1200. #endif // #ifndef __EXT_MFC_NO_DATE_PICKER
  1201. #ifndef __EXT_MFC_NO_TOOLBOX_CTRL
  1202. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtToolBoxWnd ) ) )
  1203. {
  1204. aDrawingMode = eModeToolBox;
  1205. }
  1206. #endif // #ifndef __EXT_MFC_NO_TOOLBOX_CTRL
  1207. else if(
  1208. _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS( CWnd ) )
  1209. && CExtPopupMenuWnd::g_pCombinedHelper == NULL
  1210. && (!_ppbd.m_bTransparentBackground)
  1211. )
  1212. {
  1213. CExtPaintManagerOffice2003::PaintDockerBkgnd( true, dc, (CWnd*)_ppbd.m_pHelperSrc );
  1214. }
  1215. }
  1216. if( aDrawingMode != eModeControl 
  1217. && aDrawingMode != eModeDatePicker
  1218. && aDrawingMode != eModeToolBox
  1219. && aDrawingMode != eModeToolBar
  1220. )
  1221. {
  1222. CExtPaintManagerOffice2003::PaintPushButton( dc, _ppbd );
  1223. return;
  1224. }
  1225. CExtBitmap * pBmpSimple =
  1226. _ppbd.m_bSeparatedDropDown
  1227. ? ( bHorizontal ? (&m_arrBmpPushBtnSDDLeftH) : (&m_arrBmpPushBtnSDDLeftV) )
  1228. : ( bHorizontal ? (&m_arrBmpPushBtnSimpleH) : (&m_arrBmpPushBtnSimpleV) )
  1229. ;
  1230. CExtBitmap * pBmpRP =
  1231. _ppbd.m_bSeparatedDropDown
  1232. ? ( bHorizontal ? (&m_arrBmpPushBtnSDDRightH) : (&m_arrBmpPushBtnSDDRightV) )
  1233. : NULL
  1234. ;
  1235. INT nGlyphHeightSimple =
  1236. _ppbd.m_bSeparatedDropDown
  1237. ? ( bHorizontal ? m_nPushBtnSDDLeftGlyphHeightH : m_nPushBtnSDDLeftGlyphHeightV )
  1238. : ( bHorizontal ? m_nPushBtnSimpleGlyphHeightH : m_nPushBtnSimpleGlyphHeightV )
  1239. ;
  1240. INT nGlyphHeightRP =
  1241. _ppbd.m_bSeparatedDropDown
  1242. ? ( bHorizontal ? m_nPushBtnSDDRightGlyphHeightH : m_nPushBtnSDDRightGlyphHeightV )
  1243. : ( 0 )
  1244. ;
  1245. CRect * pRectPaddingSimple =
  1246. _ppbd.m_bSeparatedDropDown
  1247. ? ( bHorizontal ? (&m_rcPushBtnSDDLeftPaddingH) : (&m_rcPushBtnSDDLeftPaddingV) )
  1248. : ( bHorizontal ? (&m_rcPushBtnSimplePaddingH) : (&m_rcPushBtnSimplePaddingV) )
  1249. ;
  1250. CRect * pRectPaddingRP =
  1251. _ppbd.m_bSeparatedDropDown
  1252. ? ( bHorizontal ? (&m_rcPushBtnSDDRightPaddingH) : (&m_rcPushBtnSDDRightPaddingV) )
  1253. : NULL
  1254. ;
  1255. if( ! _ppbd.m_bEnabled )
  1256. {
  1257. _ppbd.m_bHover = false;
  1258. _ppbd.m_bDrawFocusRect = false;
  1259. _ppbd.m_bIndeterminate = false;
  1260. }
  1261. e_push_button_glyph_type_t ePBGT_Simple = __EPBGT_NORMAL;
  1262. if( ! _ppbd.m_bEnabled )
  1263. ePBGT_Simple = __EPBGT_DISABLED;
  1264. else if( _ppbd.m_bPushed )
  1265. ePBGT_Simple = __EPBGT_PRESSED;
  1266. else if( _ppbd.m_bHover /*|| _ppbd.m_bDrawFocusRect*/ )
  1267. ePBGT_Simple = __EPBGT_HOVER;
  1268. else if( _ppbd.m_bDefaultPushButton )
  1269. ePBGT_Simple = __EPBGT_DEFAULT;
  1270. e_push_button_glyph_type_t ePBGT_RP = ePBGT_Simple;
  1271. CRect rcSrcSimple( 0, 0, pBmpSimple->GetSize().cx, nGlyphHeightSimple );
  1272. CRect rcSrcRP( 0, 0, 0, 0 );
  1273. if( _ppbd.m_bSeparatedDropDown )
  1274. {
  1275. if( ePBGT_Simple == __EPBGT_HOVER || ePBGT_Simple == __EPBGT_PRESSED )
  1276. {
  1277. if( _ppbd.m_bPushedDropDown )
  1278. ePBGT_Simple = __EPBGT_HH;
  1279. else
  1280. ePBGT_RP = __EPBGT_HH;
  1281. }
  1282. ASSERT( pBmpRP != NULL );
  1283. rcSrcRP.right = pBmpRP->GetSize().cx;
  1284. rcSrcRP.bottom = nGlyphHeightRP;
  1285. rcSrcRP.OffsetRect(
  1286. 0,
  1287. nGlyphHeightRP * INT(ePBGT_RP)
  1288. );
  1289. }
  1290. rcSrcSimple.OffsetRect(
  1291. 0,
  1292. nGlyphHeightSimple * INT(ePBGT_Simple)
  1293. );
  1294. bool bRTL = _ppbd.IsRTL();
  1295. CRect rectClient( _ppbd.m_rcClient );
  1296. CRect rectCaption( &rectClient );
  1297. INT nDDW = g_glyph_btn_expand_bottom.Size().cx;
  1298. if( aDrawingMode == eModeControl )
  1299. nDDW += __DROPDOWN_ARROW_GAP*2;
  1300. else
  1301. nDDW += 4;
  1302. CRect rcDstSimple = rectClient;
  1303. CRect rcPaintSimpleDst = rcDstSimple;
  1304. CRect rcDstRP = rectClient;
  1305. if( _ppbd.m_bDropDown )
  1306. {
  1307. if( bHorizontal )
  1308. {
  1309. rcDstRP.left = rcDstRP.right - nDDW;
  1310. rcDstSimple.right = rcDstRP.left;
  1311. } // if( bHorizontal )
  1312. else
  1313. {
  1314. rcDstRP.top = rcDstRP.bottom - nDDW;
  1315. rcDstSimple.bottom = rcDstRP.top;
  1316. } // else from if( bHorizontal )
  1317. } // if( _ppbd.m_bDropDown )
  1318. if( _ppbd.m_bSeparatedDropDown )
  1319. {
  1320. ASSERT( pBmpRP != NULL );
  1321. pBmpRP->AlphaBlendSkinParts(
  1322. dc.m_hDC,
  1323. rcDstRP,
  1324. rcSrcRP,
  1325. *pRectPaddingRP,
  1326. CExtBitmap::__EDM_STRETCH,
  1327. true,
  1328. true
  1329. );
  1330. rcPaintSimpleDst = rcDstSimple;
  1331. } // if( _ppbd.m_bSeparatedDropDown )
  1332. rectCaption = rcDstSimple;
  1333. pBmpSimple->AlphaBlendSkinParts(
  1334. dc.m_hDC,
  1335. rcPaintSimpleDst,
  1336. rcSrcSimple,
  1337. *pRectPaddingSimple,
  1338. CExtBitmap::__EDM_STRETCH,
  1339. true,
  1340. true
  1341. );
  1342. if( _ppbd.m_bDropDown )
  1343. {
  1344. CRect rectGlyph = rcDstRP;
  1345. if( _ppbd.m_bPushedDropDown )
  1346. rectGlyph.OffsetRect( GetPushedOffset() );
  1347. COLORREF ColorValues[2] =
  1348. {
  1349. RGB(0,0,0),
  1350. RGB(0,0,0),
  1351. };
  1352. bool bSetDefaultColorForDD = true;
  1353. if( _ppbd.m_bEnabled )
  1354. {
  1355. if( m_clrCustomDropDownGlyphEnabled != COLORREF(-1L) )
  1356. {
  1357. ColorValues[1] = m_clrCustomDropDownGlyphEnabled;
  1358. bSetDefaultColorForDD = false;
  1359. }
  1360. }
  1361. else
  1362. {
  1363. if( m_clrCustomDropDownGlyphDisabled != COLORREF(-1L) )
  1364. {
  1365. ColorValues[1] = m_clrCustomDropDownGlyphDisabled;
  1366. bSetDefaultColorForDD = false;
  1367. }
  1368. }
  1369. if( bSetDefaultColorForDD )
  1370. ColorValues[1] = GetColor( _ppbd.m_bEnabled ? COLOR_BTNTEXT : CLR_TEXT_DISABLED, _ppbd.m_pHelperSrc, _ppbd.m_lParam  );
  1371. if( bRTL && (rectGlyph.Width()&1) == 0 )
  1372. rectGlyph.right++;
  1373. PaintGlyphCentered( dc, rectGlyph, _ppbd.m_bHorz ? g_glyph_btn_expand_bottom : g_glyph_btn_expand_right, ColorValues );
  1374. } // if( _ppbd.m_bDropDown )
  1375. COLORREF clrOldText = dc.GetTextColor();
  1376. COLORREF clrOldBk = dc.GetBkColor();
  1377. int nOldBkMode = dc.SetBkMode( TRANSPARENT );
  1378. rectCaption.DeflateRect( _ppbd.m_rcBorderSizes );
  1379. rectClient = rectCaption;
  1380. CRect rcFocus( rectCaption );
  1381. // Draw icon
  1382. if( rectClient.bottom > rectClient.top
  1383. && rectClient.right > rectClient.left
  1384. )
  1385. PaintPushButtonIcon( dc, rectClient, rectCaption, rcFocus, _ppbd );
  1386. CExtSafeString sTitle( _T("") );
  1387. if( _ppbd.m_sText != NULL )
  1388. sTitle = _ppbd.m_sText;
  1389. // Draw text
  1390. if( rectCaption.bottom > rectCaption.top
  1391. && rectCaption.right > rectCaption.left
  1392. && (!sTitle.IsEmpty())
  1393. )
  1394. PaintPushButtonText( dc, rectCaption, _ppbd );
  1395. // Draw focus rectangle
  1396. if( _ppbd.m_bDrawFocusRect 
  1397. && ( ( !sTitle.IsEmpty() ) || _ppbd.m_nFocusMode == __EBFM_CLIENT_AREA )
  1398. && rcFocus.bottom > rcFocus.top 
  1399. && rcFocus.right > rcFocus.left
  1400. )
  1401. {
  1402. rcFocus.DeflateRect( 2, 2 );
  1403. // dc.DrawFocusRect( &rcFocus );
  1404. stat_DrawDotLineH( dc, rcFocus.left,  rcFocus.right, rcFocus.top,    RGB(0,0,0) );
  1405. stat_DrawDotLineH( dc, rcFocus.left,  rcFocus.right, rcFocus.bottom, RGB(0,0,0) );
  1406. stat_DrawDotLineV( dc, rcFocus.left,  rcFocus.top,   rcFocus.bottom, RGB(0,0,0) );
  1407. stat_DrawDotLineV( dc, rcFocus.right, rcFocus.top,   rcFocus.bottom, RGB(0,0,0) );
  1408. }
  1409. dc.SetBkMode( nOldBkMode );
  1410. dc.SetBkColor( clrOldBk );
  1411. dc.SetTextColor( clrOldText );
  1412. }
  1413. void CExtPaintManagerOffice2007_R1::PaintPushButton(
  1414. CDC & dc,
  1415. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  1416. )
  1417. {
  1418. ASSERT_VALID( this );
  1419. ASSERT( dc.GetSafeHdc() != NULL );
  1420. if( _ppbd.m_clrForceTextDisabled == COLORREF(-1L) )
  1421. _ppbd.m_clrForceTextDisabled = RGB(141,141,141);
  1422. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1423. }
  1424. void CExtPaintManagerOffice2007_R2_LunaBlue::PaintPushButton(
  1425. CDC & dc,
  1426. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  1427. )
  1428. {
  1429. ASSERT_VALID( this );
  1430. ASSERT( dc.GetSafeHdc() != NULL );
  1431. if( _ppbd.m_clrForceTextDisabled == COLORREF(-1L) )
  1432. _ppbd.m_clrForceTextDisabled = RGB(141,141,141);
  1433. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1434. }
  1435. void CExtPaintManagerOffice2007_R2_Silver::PaintPushButton(
  1436. CDC & dc,
  1437. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  1438. )
  1439. {
  1440. ASSERT_VALID( this );
  1441. ASSERT( dc.GetSafeHdc() != NULL );
  1442. if( _ppbd.m_clrForceTextDisabled == COLORREF(-1L) )
  1443. _ppbd.m_clrForceTextDisabled = RGB(141,141,141);
  1444. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1445. }
  1446. void CExtPaintManagerOffice2007_R2_Obsidian::PaintPushButton(
  1447. CDC & dc,
  1448. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  1449. )
  1450. {
  1451. ASSERT_VALID( this );
  1452. ASSERT( dc.GetSafeHdc() != NULL );
  1453. if( IsHighContrast() )
  1454. {
  1455. CExtPaintManagerXP::PaintPushButton( dc, _ppbd );
  1456. return;
  1457. }
  1458. if( _ppbd.m_pHelperSrc != NULL
  1459. && _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CButton) )
  1460. )
  1461. {
  1462. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1463. return;
  1464. }
  1465. bool bInvertNormalTextColor = true;
  1466. if( _ppbd.m_bHover || _ppbd.m_bPushed || _ppbd.m_bPushedDropDown )
  1467. bInvertNormalTextColor = false;
  1468. else if( _ppbd.m_clrForceTextNormal == COLORREF(-1L) && _ppbd.m_pHelperSrc != NULL )
  1469. {
  1470. if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarButton) )
  1471. && ( ! _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarMdiRightButton) ) )
  1472. )
  1473. {
  1474. if( LPVOID(CExtPopupMenuWnd::g_pCombinedHelper) == LPVOID(_ppbd.m_pHelperSrc) )
  1475. bInvertNormalTextColor = false;
  1476. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarButton) ) )
  1477. {
  1478. CExtToolControlBar * pToolBar = ((CExtBarButton*)_ppbd.m_pHelperSrc)->GetBar();
  1479. ASSERT_VALID( pToolBar );
  1480. if( ! pToolBar->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) ) )
  1481. {
  1482. if( pToolBar->m_pDockSite == NULL )
  1483. {
  1484. if( pToolBar->m_bForceBalloonGradientInDialogs )
  1485. bInvertNormalTextColor = false;
  1486. }
  1487. else
  1488. {
  1489. if( ! pToolBar->m_bForceNoBalloonWhenRedockable )
  1490. bInvertNormalTextColor = false;
  1491. }
  1492. }
  1493. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  1494. else if( pToolBar->IsKindOf( RUNTIME_CLASS(CExtRibbonPage) ) )
  1495. bInvertNormalTextColor = false;
  1496. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  1497. }
  1498. }
  1499. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPopupBaseWnd) )
  1500. || _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) )
  1501. #if (!defined __EXT_MFC_NO_DATE_PICKER)
  1502. || _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtDatePickerWnd) )
  1503. #endif // (!defined __EXT_MFC_NO_DATE_PICKER)
  1504. )
  1505. bInvertNormalTextColor = false;
  1506. }
  1507. if( bInvertNormalTextColor 
  1508. && _ppbd.m_clrForceTextNormal == COLORREF(-1L)
  1509. )
  1510. _ppbd.m_clrForceTextNormal = RGB(255,255,255);
  1511. if( _ppbd.m_clrForceTextDisabled == COLORREF(-1L) )
  1512. _ppbd.m_clrForceTextDisabled = RGB(141,141,141);
  1513. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1514. }
  1515. void CExtPaintManagerOffice2010_R2_Black::PaintPushButton(
  1516. CDC & dc,
  1517. CExtPaintManager::PAINTPUSHBUTTONDATA & _ppbd
  1518. )
  1519. {
  1520. ASSERT_VALID( this );
  1521. ASSERT( dc.GetSafeHdc() != NULL );
  1522. if( IsHighContrast() )
  1523. {
  1524. CExtPaintManagerXP::PaintPushButton( dc, _ppbd );
  1525. return;
  1526. }
  1527. if( _ppbd.m_pHelperSrc != NULL
  1528. && _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CButton) )
  1529. )
  1530. {
  1531. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1532. return;
  1533. }
  1534. bool bInvertNormalTextColor = true;
  1535. if( _ppbd.m_bHover || _ppbd.m_bPushed || _ppbd.m_bPushedDropDown )
  1536. bInvertNormalTextColor = false;
  1537. else if( _ppbd.m_clrForceTextNormal == COLORREF(-1L) && _ppbd.m_pHelperSrc != NULL )
  1538. {
  1539. if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarButton) )
  1540. && ( ! _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarMdiRightButton) ) )
  1541. )
  1542. {
  1543. if( LPVOID(CExtPopupMenuWnd::g_pCombinedHelper) == LPVOID(_ppbd.m_pHelperSrc) )
  1544. bInvertNormalTextColor = false;
  1545. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtBarButton) ) )
  1546. {
  1547. CExtToolControlBar * pToolBar = ((CExtBarButton*)_ppbd.m_pHelperSrc)->GetBar();
  1548. ASSERT_VALID( pToolBar );
  1549. if( ! pToolBar->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) ) )
  1550. {
  1551. if( pToolBar->m_pDockSite == NULL )
  1552. {
  1553. if( pToolBar->m_bForceBalloonGradientInDialogs )
  1554. bInvertNormalTextColor = false;
  1555. }
  1556. else
  1557. {
  1558. if( ! pToolBar->m_bForceNoBalloonWhenRedockable )
  1559. bInvertNormalTextColor = false;
  1560. }
  1561. }
  1562. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  1563. else if( pToolBar->IsKindOf( RUNTIME_CLASS(CExtRibbonPage) ) )
  1564. bInvertNormalTextColor = false;
  1565. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  1566. }
  1567. }
  1568. else if( _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtPopupBaseWnd) )
  1569. || _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMenuControlBar) )
  1570. #if (!defined __EXT_MFC_NO_DATE_PICKER)
  1571. || _ppbd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtDatePickerWnd) )
  1572. #endif // (!defined __EXT_MFC_NO_DATE_PICKER)
  1573. )
  1574. bInvertNormalTextColor = false;
  1575. }
  1576. if( bInvertNormalTextColor 
  1577. && _ppbd.m_clrForceTextNormal == COLORREF(-1L)
  1578. )
  1579. _ppbd.m_clrForceTextNormal = RGB(220,220,220);
  1580. if( _ppbd.m_clrForceTextDisabled == COLORREF(-1L) )
  1581. _ppbd.m_clrForceTextDisabled = RGB(141,141,141);
  1582. CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
  1583. }
  1584. CSize CExtPaintManagerOffice2007_Impl::GetCheckButtonBoxSize(
  1585. CDC & dc,
  1586. CExtPaintManager::PAINTCHECKRADIOBUTTONDATA & _pcbd
  1587. ) const
  1588. {
  1589. ASSERT_VALID( this );
  1590. if( IsHighContrast() )
  1591. return CExtPaintManagerXP::GetCheckButtonBoxSize( dc, _pcbd );
  1592. CSize _sizeBox( 13, 13 );
  1593. _sizeBox.cx = UiScalingDo( _sizeBox.cx, __EUIST_X );
  1594. _sizeBox.cy = UiScalingDo( _sizeBox.cy, __EUIST_Y );
  1595. return _sizeBox;
  1596. }
  1597. CSize CExtPaintManagerOffice2007_Impl::GetRadioButtonBoxSize(
  1598. CDC & dc,
  1599. CExtPaintManager::PAINTCHECKRADIOBUTTONDATA & _pcbd
  1600. ) const
  1601. {
  1602. ASSERT_VALID( this );
  1603. if( IsHighContrast() )
  1604. return CExtPaintManagerXP::GetRadioButtonBoxSize( dc, _pcbd );
  1605. return GetCheckButtonBoxSize( dc, _pcbd );
  1606. }
  1607. void CExtPaintManagerOffice2007_Impl::PaintCheckButtonBox(
  1608. CDC & dc,
  1609. CExtPaintManager::PAINTCHECKRADIOBUTTONDATA & _pcrbd
  1610. )
  1611. {
  1612. ASSERT_VALID( this );
  1613. ASSERT( dc.GetSafeHdc() != NULL );
  1614. if( _pcrbd.m_rcClient.IsRectEmpty() )
  1615. return;
  1616. if( _pcrbd.m_pHelperSrc == NULL )
  1617. return;
  1618. if( IsHighContrast() )
  1619. {
  1620. CExtPaintManagerXP::PaintCheckButtonBox( dc, _pcrbd );
  1621. return;
  1622. }
  1623. if( m_bmpArrStatesCheckBox.IsEmpty() )
  1624. {
  1625. CExtPaintManagerOffice2003::PaintCheckButtonBox( dc, _pcrbd );
  1626. return;
  1627. }
  1628. INT nIndex = 0;
  1629. switch( _pcrbd.m_eState ) 
  1630. {
  1631. case CExtPaintManager::BOX_UNCHECKED:
  1632. nIndex = 0;
  1633. break;
  1634. case CExtPaintManager::BOX_MOUSE_HOVER_UNCHECKED:
  1635. nIndex = 1;
  1636. break;
  1637. case CExtPaintManager::BOX_LDOWN_UNCHECKED:
  1638. nIndex = 2;
  1639. break;
  1640. case CExtPaintManager::BOX_DISABLED_UNCHECKED:
  1641. nIndex = 3;
  1642. break;
  1643. case CExtPaintManager::BOX_CHECKED:
  1644. nIndex = 0 + 4;
  1645. break;
  1646. case CExtPaintManager::BOX_MOUSE_HOVER_CHECKED:
  1647. nIndex = 1 + 4;
  1648. break;
  1649. case CExtPaintManager::BOX_LDOWN_CHECKED:
  1650. nIndex = 2 + 4;
  1651. break;
  1652. case CExtPaintManager::BOX_DISABLED_CHECKED:
  1653. nIndex = 3 + 4;
  1654. break;
  1655. case CExtPaintManager::BOX_INDETERMINATE:
  1656. nIndex = 0 + 8;
  1657. break;
  1658. case CExtPaintManager::BOX_MOUSE_HOVER_INDETERMINATE:
  1659. nIndex = 1 + 8;
  1660. break;
  1661. case CExtPaintManager::BOX_LDOWN_INDETERMINATE:
  1662. nIndex = 2 + 8;
  1663. break;
  1664. case CExtPaintManager::BOX_DISABLED_INDETERMINATE:
  1665. nIndex = 3 + 8;
  1666. break;
  1667. } // switch( _pcrbd.m_eState ) 
  1668. CSize _sizeImgPart( 13, 13 ); // = GetCheckButtonBoxSize( dc, _pcrbd );
  1669. CRect rcSrc( 0, 0, _sizeImgPart.cx, _sizeImgPart.cy );
  1670. rcSrc.OffsetRect( 0, _sizeImgPart.cx * nIndex );
  1671. int nOldStretchBltMode = ::GetStretchBltMode( dc.m_hDC );
  1672. ::SetStretchBltMode( dc.m_hDC, ( g_PaintManager.m_bIsWinNT ) ? HALFTONE : COLORONCOLOR );
  1673. m_bmpArrStatesCheckBox.AlphaBlend(
  1674. dc.m_hDC,
  1675. _pcrbd.m_rcBox.left, _pcrbd.m_rcBox.top, _pcrbd.m_rcBox.Width(), _pcrbd.m_rcBox.Height(),
  1676. rcSrc.left, rcSrc.top, rcSrc.Width(), rcSrc.Height()
  1677. );
  1678. ::SetStretchBltMode( dc.m_hDC, nOldStretchBltMode );
  1679. }
  1680. void CExtPaintManagerOffice2007_Impl::PaintRadioButtonBox(
  1681. CDC & dc,
  1682. CExtPaintManager::PAINTCHECKRADIOBUTTONDATA & _pcrbd
  1683. )
  1684. {
  1685. ASSERT_VALID( this );
  1686. ASSERT( dc.GetSafeHdc() != NULL );
  1687. if( _pcrbd.m_rcClient.IsRectEmpty() )
  1688. return;
  1689. if( _pcrbd.m_pHelperSrc == NULL )
  1690. return;
  1691. if( IsHighContrast() )
  1692. {
  1693. CExtPaintManagerXP::PaintRadioButtonBox( dc, _pcrbd );
  1694. return;
  1695. }
  1696. if( m_bmpArrStatesRadioButton.IsEmpty() )
  1697. {
  1698. CExtPaintManagerOffice2003::PaintRadioButtonBox( dc, _pcrbd );
  1699. return;
  1700. }
  1701. INT nIndex = 0;
  1702. switch( _pcrbd.m_eState ) 
  1703. {
  1704. case CExtPaintManager::BOX_UNCHECKED:
  1705. nIndex = 0;
  1706. break;
  1707. case CExtPaintManager::BOX_MOUSE_HOVER_UNCHECKED:
  1708. nIndex = 1;
  1709. break;
  1710. case CExtPaintManager::BOX_LDOWN_UNCHECKED:
  1711. nIndex = 2;
  1712. break;
  1713. case CExtPaintManager::BOX_DISABLED_UNCHECKED:
  1714. nIndex = 3;
  1715. break;
  1716. case CExtPaintManager::BOX_CHECKED:
  1717. nIndex = 0 + 4;
  1718. break;
  1719. case CExtPaintManager::BOX_MOUSE_HOVER_CHECKED:
  1720. nIndex = 1 + 4;
  1721. break;
  1722. case CExtPaintManager::BOX_LDOWN_CHECKED:
  1723. nIndex = 2 + 4;
  1724. break;
  1725. case CExtPaintManager::BOX_DISABLED_CHECKED:
  1726. nIndex = 3 + 4;
  1727. break;
  1728. } // switch( _pcrbd.m_eState ) 
  1729. CSize _sizeImgPart( 13, 13 ); // = GetRadioButtonBoxSize( dc, _pcrbd );
  1730. CRect rcSrc( 0, 0, _sizeImgPart.cx, _sizeImgPart.cy );
  1731. rcSrc.OffsetRect( 0, _sizeImgPart.cx * nIndex );
  1732. int nOldStretchBltMode = ::GetStretchBltMode( dc.m_hDC );
  1733. ::SetStretchBltMode( dc.m_hDC, ( g_PaintManager.m_bIsWinNT ) ? HALFTONE : COLORONCOLOR );
  1734. m_bmpArrStatesRadioButton.AlphaBlend(
  1735. dc.m_hDC,
  1736. _pcrbd.m_rcBox.left, _pcrbd.m_rcBox.top, _pcrbd.m_rcBox.Width(), _pcrbd.m_rcBox.Height(),
  1737. rcSrc.left, rcSrc.top, rcSrc.Width(), rcSrc.Height()
  1738. );
  1739. ::SetStretchBltMode( dc.m_hDC, nOldStretchBltMode );
  1740. }
  1741. void CExtPaintManagerOffice2007_Impl::PaintMenuItemLeftAreaMarginXP(
  1742. CDC & dc,
  1743. CExtPaintManager::PAINTMENUITEMDATA & _pmid,
  1744. const RECT & rcFillLeftPart,
  1745. const RECT & rcFillRightPart
  1746. )
  1747. {
  1748. ASSERT_VALID( this );
  1749. if( _pmid.m_bForceNoLeftGradient )
  1750. return;
  1751. if( IsHighContrast() )
  1752. {
  1753. CExtPaintManagerXP::PaintMenuItemLeftAreaMarginXP( dc, _pmid, rcFillLeftPart, rcFillRightPart );
  1754. return;
  1755. }
  1756. if( m_clrMenuItemLeftAreaMarginL != COLORREF(-1L) )
  1757. dc.FillSolidRect(
  1758. rcFillLeftPart.right - 1,
  1759. rcFillLeftPart.top,
  1760. 1,
  1761. rcFillLeftPart.bottom - rcFillLeftPart.top,
  1762. m_clrMenuItemLeftAreaMarginL
  1763. );
  1764. if( m_clrMenuItemLeftAreaMarginR != COLORREF(-1L) )
  1765. dc.FillSolidRect(
  1766. rcFillLeftPart.right,
  1767. rcFillLeftPart.top,
  1768. 1,
  1769. rcFillLeftPart.bottom - rcFillLeftPart.top,
  1770. m_clrMenuItemLeftAreaMarginR
  1771. );
  1772. }
  1773. bool CExtPaintManagerOffice2007_Impl::PaintMenuItemBackgroundXP(
  1774. CDC & dc,
  1775. CExtPaintManager::PAINTMENUITEMDATA & _pmid,
  1776. const RECT & rcSelectionArea
  1777. )
  1778. {
  1779. ASSERT_VALID( this );
  1780. if( IsHighContrast() )
  1781. return CExtPaintManagerXP::PaintMenuItemBackgroundXP( dc, _pmid, rcSelectionArea );
  1782. bool bRTL = false;
  1783. CExtPopupMenuWnd * pPopup = NULL;
  1784. if( _pmid.m_pHelperSrc != NULL )
  1785. {
  1786. ASSERT_VALID( _pmid.m_pHelperSrc );
  1787. pPopup = DYNAMIC_DOWNCAST( CExtPopupMenuWnd, _pmid.m_pHelperSrc );
  1788. if( pPopup != NULL )
  1789. bRTL = pPopup->OnQueryLayoutRTL();
  1790. }
  1791. if( (! m_bThemedMenuItemsEverywhere )
  1792. && pPopup != NULL
  1793. && ( pPopup->TrackFlagsGet() & TPMX_RIBBON_MODE ) == 0 
  1794. )
  1795. return false;
  1796. if( m_bmpMenuItemLargeLeft.IsEmpty()
  1797. || m_bmpMenuItemLargeRight.IsEmpty()
  1798. || m_bmpMenuItemSmallLeft.IsEmpty()
  1799. || m_bmpMenuItemSmallRight.IsEmpty()
  1800. || m_bmpMenuArrow.IsEmpty()
  1801. )
  1802. return CExtPaintManagerOffice2003::PaintMenuItemBackgroundXP( dc, _pmid, rcSelectionArea );
  1803. bool bSmall = ( ! _pmid.m_bBigAccent );
  1804. INT nMenuGlyphItemHeight = bSmall ? m_nMenuGlyphItemHeightSmall : m_nMenuGlyphItemHeightLarge;
  1805. CExtBitmap & _bmpLeft = bSmall ? m_bmpMenuItemSmallLeft : m_bmpMenuItemLargeLeft;
  1806. CExtBitmap & _bmpRight = bSmall ? m_bmpMenuItemSmallRight : m_bmpMenuItemLargeRight;
  1807. CRect rcPaddingLeft = bSmall ? m_rcMenuItemPaddingSmallLeft : m_rcMenuItemPaddingLargeLeft;
  1808. CRect rcPaddingRight = bSmall ? m_rcMenuItemPaddingSmallRight : m_rcMenuItemPaddingLargeRight;
  1809. CSize _sizeSrcLeft = _bmpLeft.GetSize(), _sizeSrcRight = _bmpRight.GetSize();
  1810. CRect rcSrcLeft( 0, 0, _sizeSrcLeft.cx, nMenuGlyphItemHeight ), rcSrcRight( 0, 0, _sizeSrcRight.cx, nMenuGlyphItemHeight );
  1811. CRect rcDstLeft = rcSelectionArea, rcDstRight = rcSelectionArea;
  1812. if( bRTL )
  1813. rcDstLeft.right = rcDstRight.left = rcDstRight.left + __EXT_MENU_POPUP_ARROW_AREA_DX;
  1814. else
  1815. rcDstLeft.right = rcDstRight.left = rcDstRight.right - __EXT_MENU_POPUP_ARROW_AREA_DX;
  1816. bool bR1 = IsKindOf( RUNTIME_CLASS( CExtPaintManagerOffice2007_R1 ) ) ? true : false;
  1817. INT nImageIndexLeft = ( _pmid.m_bSelected ) ? ( bR1 ? 2 : 1 ) : 0;
  1818. INT nImageIndexRight = nImageIndexLeft;
  1819. if( ! _pmid.m_bSeparatedDropDown )
  1820. {
  1821. rcSrcLeft.right -= rcPaddingLeft.right;
  1822. rcPaddingLeft.right = 0;
  1823. rcSrcRight.left += rcPaddingRight.left;
  1824. rcPaddingRight.left = 0;
  1825. }
  1826. else
  1827. {
  1828. if( _pmid.m_bSelected )
  1829. {
  1830. if( bR1 )
  1831. {
  1832. if( _pmid.m_bHelperPopupDropped )
  1833. nImageIndexRight = 1;
  1834. }
  1835. else
  1836. {
  1837. if( _pmid.m_bHelperPopupDropped )
  1838. nImageIndexLeft = 2;
  1839. else
  1840. nImageIndexRight = 2;
  1841. }
  1842. }
  1843. }
  1844. rcSrcLeft.OffsetRect( 0, nImageIndexLeft*nMenuGlyphItemHeight );
  1845. rcSrcRight.OffsetRect( 0, nImageIndexRight*nMenuGlyphItemHeight );
  1846. _bmpLeft.AlphaBlendSkinParts(
  1847. dc.m_hDC,
  1848. rcDstLeft,
  1849. rcSrcLeft,
  1850. rcPaddingLeft,
  1851. CExtBitmap::__EDM_STRETCH,
  1852. true,
  1853. false
  1854. );
  1855. _bmpRight.AlphaBlendSkinParts(
  1856. dc.m_hDC,
  1857. rcDstRight,
  1858. rcSrcRight,
  1859. rcPaddingRight,
  1860. CExtBitmap::__EDM_STRETCH,
  1861. true,
  1862. false
  1863. );
  1864. if( _pmid.m_bPopup )
  1865. {
  1866. CExtBitmap _bmpBufferRTL;
  1867. if( bRTL )
  1868. {
  1869. _bmpBufferRTL = m_bmpMenuArrow;
  1870. _bmpBufferRTL.FlipHorizontal();
  1871. }
  1872. CExtBitmap * pBmpTarget = bRTL ? (&_bmpBufferRTL) : (&m_bmpMenuArrow);
  1873. CSize _sizeBmpArrow = pBmpTarget->GetSize();
  1874. CRect rcTarget = bRTL ? rcDstLeft : rcDstRight;
  1875. CRect rcDstArrow( rcTarget.TopLeft(), _sizeBmpArrow );
  1876. rcDstArrow.OffsetRect(
  1877. ( rcTarget.Width() - _sizeBmpArrow.cx ) / 2,
  1878. ( rcTarget.Height() - _sizeBmpArrow.cy ) / 2
  1879. );
  1880. pBmpTarget->CExtBitmap::AlphaBlend(
  1881. dc.m_hDC,
  1882. rcDstArrow
  1883. );
  1884. }
  1885. return true;
  1886. }
  1887. bool CExtPaintManagerOffice2007_Impl::PaintMenuItemCheckMarkAreaXP(
  1888. CDC & dc,
  1889. CExtPaintManager::PAINTMENUITEMDATA & _pmid,
  1890. const RECT & rcCheckMarkArea,
  1891. CExtPaintManagerXP::e_CheckMarkAreaTypeXP eCMATXP
  1892. )
  1893. {
  1894. ASSERT_VALID( this );
  1895. if( IsHighContrast() )
  1896. return CExtPaintManagerXP::PaintMenuItemCheckMarkAreaXP( dc, _pmid, rcCheckMarkArea, eCMATXP );
  1897. if( m_bmpMenuCheckAreaChecked.IsEmpty()
  1898. || m_bmpMenuCheckAreaUnchecked.IsEmpty()
  1899. )
  1900. return CExtPaintManagerOffice2003::PaintMenuItemCheckMarkAreaXP( dc, _pmid, rcCheckMarkArea, eCMATXP );
  1901. int nIndex = _pmid.m_bEnabled ? 0 : 1;
  1902. bool bChecked = ( eCMATXP == __ECMATXP_EXTRA_MARK_CHECKED ) ? true : false;
  1903. CExtBitmap & bmp =  bChecked ? m_bmpMenuCheckAreaChecked : m_bmpMenuCheckAreaUnchecked;
  1904. CSize _size = bChecked ? m_sizeMenuCheckAreaChecked : m_sizeMenuCheckAreaUnchecked;
  1905. CRect rcSrc( 0, 0, _size.cx, _size.cy );
  1906. rcSrc.OffsetRect( 0, _size.cy * nIndex );
  1907. bmp.AlphaBlendSkinParts(
  1908. dc.m_hDC,
  1909. rcCheckMarkArea,
  1910. rcSrc,
  1911. bChecked ? m_arrRectMenuCheckAreaCheckedPadding[nIndex] : m_arrRectMenuCheckAreaUncheckedPadding[nIndex],
  1912. CExtBitmap::__EDM_CENTER,
  1913. true,
  1914. true,
  1915. BYTE( _pmid.m_bIndeterminate ? 0x040 : 0x0FF )
  1916. );
  1917. return true;
  1918. }
  1919. void CExtPaintManagerOffice2007_Impl::PaintMenuScrollButton(
  1920. CDC & dc,
  1921. bool bHover,
  1922. bool bPushed,
  1923. bool bTopButton,
  1924. const RECT & rcScrollButton,
  1925. CObject * pHelperSrc,
  1926. LPARAM lParam // = 0L
  1927. )
  1928. {
  1929. ASSERT_VALID( this );
  1930. if( IsHighContrast() )
  1931. {
  1932. CExtPaintManagerXP::PaintMenuScrollButton( dc, bHover, bPushed, bTopButton, rcScrollButton, pHelperSrc, lParam );
  1933. return;
  1934. }
  1935. //bool bTransparentBk = false;
  1936. bPushed = bPushed || bHover;
  1937. if( bPushed )
  1938. {
  1939. PAINTMENUITEMDATA _pmid; // fake
  1940. if( PaintMenuItemSelectionAreaXP( dc, _pmid, rcScrollButton ) )
  1941. {
  1942. bPushed = bHover = false;
  1943. //bTransparentBk = true;
  1944. }
  1945. }
  1946. // CExtPaintManagerOffice2003::PaintMenuScrollButton(
  1947. // dc,
  1948. // bHover,
  1949. // bPushed,
  1950. // bTopButton,
  1951. // rcScrollButton,
  1952. // pHelperSrc,
  1953. // lParam
  1954. // );
  1955. CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
  1956. pHelperSrc,
  1957. true,
  1958. rcScrollButton,
  1959. bTopButton ? _T("t") : _T("u"), // up arrow / down arrow
  1960. NULL,
  1961. true,
  1962. false, // bHover,
  1963. bPushed,
  1964. false,
  1965. true,true,false,false,
  1966. __ALIGN_HORIZ_CENTER | __ALIGN_VERT_CENTER,
  1967. (HFONT)m_FontMarlett.GetSafeHandle(),
  1968. false,
  1969. 0,
  1970. true // bTransparentBk
  1971. );
  1972. _ppbd.m_lParam = lParam;
  1973. PaintPushButton( dc, _ppbd );
  1974. }
  1975. #if (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  1976. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorItem(
  1977. CDC & dc,
  1978. const CRect & rcItem,
  1979. __EXT_MFC_SAFE_LPCTSTR strCaption,
  1980. CExtCmdIcon * pIcon,
  1981. bool bExpanded,
  1982. bool bSelected,
  1983. bool bPushed,
  1984. bool bHover
  1985. )
  1986. {
  1987. ASSERT_VALID( this );
  1988. ASSERT( dc.GetSafeHdc() != NULL );
  1989. if( ! dc.RectVisible(&rcItem) )
  1990. return;
  1991. if( ::GetDeviceCaps( dc.m_hDC,BITSPIXEL) <= 8 || IsHighContrast() )
  1992. {
  1993. CExtPaintManagerOffice2003::PaintPageNavigatorItem( dc, rcItem, strCaption, pIcon, bExpanded, bSelected, bPushed, bHover );
  1994. return;
  1995. }
  1996. COLORREF clrForceText = COLORREF(-1L);
  1997. INT nPnIndex = INT(ePn_Normal);
  1998. if( bSelected )
  1999. nPnIndex = bHover ? INT(ePn_SelectedHover) : INT(ePn_Selected);
  2000. else if( bPushed )
  2001. nPnIndex = INT( ePn_Pressed );
  2002. else if( bHover )
  2003. nPnIndex = INT( ePn_Hover );
  2004. const CExtBitmap * pArrBmp = bExpanded ? m_arrBmpPnItemExpanded : m_arrBmpPnItemCollapsed;
  2005. const CExtBitmap & _bmp = pArrBmp[nPnIndex];
  2006. if( ! _bmp.IsEmpty() )
  2007. {
  2008. CRect _rcItem = rcItem;
  2009. if( ! bExpanded )
  2010. _rcItem.top --;
  2011. else
  2012. _rcItem.bottom --;
  2013. const CRect * pArrPadding = bExpanded ? m_arrRcPnItemPaddingExpanded : m_arrRcPnItemPaddingCollapsed;
  2014. const CRect & _rcPadding = pArrPadding[ nPnIndex ];
  2015. if( ! bExpanded )
  2016. _rcItem.bottom --;
  2017. _bmp.AlphaBlendSkinParts( dc.m_hDC, _rcItem, _rcPadding, CExtBitmap::__EDM_STRETCH, true, true );
  2018. if( bExpanded )
  2019. {
  2020. clrForceText = m_arrClrPnItemTextBmpVer[nPnIndex];
  2021. // paint 1px borders at left/right
  2022. dc.FillSolidRect( _rcItem.left, _rcItem.top, 1, _rcItem.Height(), GetColor( _2003CLR_PN_BORDER, this ) );
  2023. dc.FillSolidRect( _rcItem.right - 1, _rcItem.top, 1, _rcItem.Height(), GetColor( _2003CLR_PN_BORDER, this ) );
  2024. }
  2025. }
  2026. else
  2027. {
  2028. // border
  2029. if( bExpanded )
  2030. {
  2031. CBrush brBorder( GetColor( _2003CLR_PN_BORDER, this ) );
  2032. dc.FrameRect( &rcItem, &brBorder );
  2033. }
  2034. CRect rcItemInner( rcItem );
  2035. if( bExpanded )
  2036. rcItemInner.DeflateRect( 1, 1 );
  2037. COLORREF * pArrClrSchema = m_arrClrPnCaptNormal;
  2038. if( ( bPushed || bSelected ) && bHover )
  2039. pArrClrSchema = m_arrClrPnCaptPressed;
  2040. else if( bPushed || bSelected )
  2041.   pArrClrSchema = m_arrClrPnCaptActive;
  2042. else if( bHover )
  2043. pArrClrSchema = m_arrClrPnCaptHover;
  2044. CRect rcTop = rcItemInner, rcBottom = rcItemInner;
  2045. rcTop.bottom = rcBottom.top =rcTop.top + ::MulDiv( rcTop.Height(), 2, 5 );
  2046. stat_PaintGradientRect( dc, rcTop,    pArrClrSchema[1], pArrClrSchema[0], true );
  2047. stat_PaintGradientRect( dc, rcBottom, pArrClrSchema[3], pArrClrSchema[2], true );
  2048. }
  2049. PaintPageNavigatorCaption( dc, rcItem, strCaption, pIcon, bExpanded, bSelected, bPushed, bHover, false, clrForceText );
  2050. }
  2051. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorItemCaption(
  2052. CDC & dc,
  2053. const CRect & rcCaption,
  2054. __EXT_MFC_SAFE_LPCTSTR strCaption
  2055. )
  2056. {
  2057. ASSERT_VALID( this );
  2058. ASSERT( dc.GetSafeHdc() != NULL );
  2059. if( ! dc.RectVisible(&rcCaption) )
  2060. return;
  2061. if( IsHighContrast() )
  2062. {
  2063. CExtPaintManagerXP::PaintPageNavigatorItemCaption( dc, rcCaption, strCaption );
  2064. return;
  2065. }
  2066. CRect rc( rcCaption );
  2067. dc.FillSolidRect(  &rc,  RGB(255,255,255) );
  2068. CRect rcBottomLine( rc );
  2069. rcBottomLine.top = rcBottomLine.bottom - 1;
  2070. rc.bottom -= 1;
  2071. dc.FillSolidRect( &rcBottomLine, GetColor( _2003CLR_PN_BORDER, this ) );
  2072. rc.top += 1;
  2073. rc.left += 1;
  2074. if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
  2075. stat_PaintGradientRect( dc, &rc, GetColor( _2003CLR_PN_GRIPPER_DARK, this ), GetColor( _2003CLR_PN_GRIPPER_LIGHT, this ), true );
  2076. else
  2077. dc.FillSolidRect(  &rc,  GetColor( COLOR_3DSHADOW, this ) );
  2078. PaintPageNavigatorItemCaptionText( dc, rc, strCaption );
  2079. }
  2080. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorCaptionText(
  2081. CDC & dc,
  2082. const CRect & rcItem,
  2083. __EXT_MFC_SAFE_LPCTSTR strCaption,
  2084. bool bSelected,
  2085. bool bPushed,
  2086. bool bHover,
  2087. bool bAllowInvertTextColor, // = true
  2088. COLORREF clrForceText // = COLORREF(-1L)
  2089. )
  2090. {
  2091. ASSERT_VALID( this );
  2092. ASSERT( dc.GetSafeHdc() != NULL );
  2093. if( ! dc.RectVisible(&rcItem) )
  2094. return;
  2095. if( IsHighContrast() )
  2096. {
  2097. CExtPaintManagerXP::PaintPageNavigatorCaptionText( dc, rcItem, strCaption, bSelected, bPushed, bHover, bAllowInvertTextColor );
  2098. return;
  2099. }
  2100. LOGFONT lf = { sizeof(LOGFONT) };
  2101. VERIFY( ::SystemParametersInfo( SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0 ) );
  2102. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, _T("Arial") );
  2103. lf.lfWeight = FW_BOLD;
  2104. CFont font;
  2105. font.CreateFontIndirect(&lf);
  2106. CFont * pOldFont = dc.SelectObject( &font );
  2107. COLORREF clrOldText =
  2108. dc.SetTextColor(
  2109. ( clrForceText != COLORREF(-1L) )
  2110. ? clrForceText
  2111. : ( ( bPushed || bSelected ) ? m_arrClrPnItemText[0] : m_arrClrPnItemText[1] )
  2112. );
  2113. PaintPageNavigatorCaptionTextImpl( dc, rcItem, strCaption );
  2114. dc.SetTextColor( clrOldText );
  2115. dc.SelectObject( pOldFont );
  2116. }
  2117. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorItemPaneCaptionText(
  2118. CDC & dc,
  2119. const CRect & rcCaption,
  2120. __EXT_MFC_SAFE_LPCTSTR strCaption
  2121. )
  2122. {
  2123. ASSERT_VALID( this );
  2124. ASSERT( dc.GetSafeHdc() != NULL );
  2125. if( ! dc.RectVisible(&rcCaption) )
  2126. return;
  2127. if( IsHighContrast() )
  2128. {
  2129. CExtPaintManagerXP::PaintPageNavigatorItemPaneCaptionText( dc, rcCaption, strCaption );
  2130. return;
  2131. }
  2132. if( strCaption == NULL )
  2133. return;
  2134. // caption text
  2135. LOGFONT lf = { sizeof(LOGFONT) };
  2136. VERIFY( ::SystemParametersInfo( SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0 ) );
  2137. if( ! m_strPnPaneCaptCustomFontFaceName.IsEmpty() )
  2138. __EXT_MFC_STRCPY( lf.lfFaceName, LF_FACESIZE, LPCTSTR(m_strPnPaneCaptCustomFontFaceName) );
  2139. lf.lfWeight = m_bPnPaneCaptFontBold ? FW_BOLD : FW_NORMAL;
  2140. CFont font;
  2141. font.CreateFontIndirect( &lf );
  2142. CFont * pOldFont = dc.SelectObject( &font );
  2143. COLORREF clrOldText = dc.SetTextColor( m_clrPnCaptText );
  2144. PaintPageNavigatorItemPaneCaptionTextImpl( dc, rcCaption, strCaption );
  2145. dc.SetTextColor( clrOldText );
  2146. dc.SelectObject( pOldFont );
  2147. }
  2148. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorItemPaneCaption(
  2149. CDC & dc,
  2150. const CRect & rcCaption,
  2151. __EXT_MFC_SAFE_LPCTSTR strCaption,
  2152. bool bHover,
  2153. bool bPressed,
  2154. bool bExpandable,
  2155. bool bExpanded,
  2156. bool bDrawTopLine // = true
  2157. )
  2158. {
  2159. ASSERT_VALID( this );
  2160. ASSERT( dc.GetSafeHdc() != NULL );
  2161. if( ! dc.RectVisible(&rcCaption) )
  2162. return;
  2163. if( IsHighContrast() )
  2164. {
  2165. CExtPaintManagerXP::PaintPageNavigatorItemPaneCaption( dc, rcCaption, strCaption, bHover, bPressed, bExpandable, bExpanded, bDrawTopLine );
  2166. return;
  2167. }
  2168. CRect rc( rcCaption );
  2169. dc.FillSolidRect( &rc, RGB(255,255,255) );
  2170. if( bDrawTopLine )
  2171. {
  2172. CRect rcTopLine( rc );
  2173. rc.top += 1;
  2174. rcTopLine.bottom = rcTopLine.top + 1;
  2175. dc.FillSolidRect( &rcTopLine, GetColor( _2003CLR_PN_BORDER, this ) );
  2176. }
  2177. CRect rcBottomLine( rc );
  2178. rcBottomLine.top = rcBottomLine.bottom - 1;
  2179. rc.bottom -= 1;
  2180. dc.FillSolidRect( &rcBottomLine, GetColor( _2003CLR_PN_PANE_CAPTION_BOTTOM_LINE, this ) );
  2181. rc.top += 1;
  2182. rc.left += 1;
  2183. if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
  2184. stat_PaintGradientRect2steps(
  2185. dc,
  2186. &rc,
  2187. GetColor( bHover ? _2003CLR_PN_PANE_CAPTION_HOVER_DARK : _2003CLR_PN_PANE_CAPTION_DARK, this ),
  2188. GetColor( bHover ? _2003CLR_PN_PANE_CAPTION_HOVER_LIGHT : _2003CLR_PN_PANE_CAPTION_LIGHT, this ),
  2189. GetColor( bHover ? _2003CLR_PN_PANE_CAPTION_HOVER_DARK : _2003CLR_PN_PANE_CAPTION_DARK, this ),
  2190. false,
  2191. 1,
  2192. 2
  2193. );
  2194. else
  2195. dc.FillSolidRect( &rc, GetColor( COLOR_3DSHADOW, this ) );
  2196. CRect rcText( rc );
  2197. if( bExpandable )
  2198. {
  2199. CExtPaintManager::glyph_t * pGlyph = 
  2200. CExtPaintManager::g_DockingCaptionGlyphs[
  2201. bExpanded ? CExtPaintManager::__DCBT_PN_CAPTION_EXPANDED : CExtPaintManager::__DCBT_PN_CAPTION_COLLAPSED
  2202. ];
  2203. ASSERT( pGlyph != NULL );
  2204. COLORREF ColorValues[2] =
  2205. {
  2206. RGB(0,0,0),
  2207. GetColor( COLOR_3DDKSHADOW, this )
  2208. };
  2209. CRect rcExpandButton( rcText );
  2210. rcExpandButton.right -= 6;
  2211. rcExpandButton.left = rcExpandButton.right - pGlyph->Size().cx - 1*2;
  2212. PaintGlyphCentered( dc, rcExpandButton, *pGlyph, ColorValues );
  2213. rcText.right = rcExpandButton.left;
  2214. }
  2215. PaintPageNavigatorItemPaneCaptionText( dc, rcText, strCaption );
  2216. }
  2217. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorConfigButton(
  2218. CDC & dc,
  2219. const CRect & rcItem,
  2220. bool bPushed,
  2221. bool bHover
  2222. )
  2223. {
  2224. ASSERT_VALID( this );
  2225. ASSERT( dc.GetSafeHdc() != NULL );
  2226. if( ! dc.RectVisible(&rcItem) )
  2227. return;
  2228. if( IsHighContrast() )
  2229. {
  2230. CExtPaintManagerXP::PaintPageNavigatorConfigButton( dc, rcItem, bPushed, bHover );
  2231. return;
  2232. }
  2233. CRect rc( rcItem );
  2234. CExtPaintManager::glyph_t * pGlyph = CExtPaintManager::g_DockingCaptionGlyphs[ CExtPaintManager::__DCBT_PN_CONFIG_BUTTON_2007 ];
  2235. ASSERT( pGlyph != NULL );
  2236. COLORREF ColorValues1[2] = {  RGB(0,0,0),  GetColor( COLOR_WINDOW, this )  };
  2237. PaintGlyphCentered( dc, rc, *pGlyph, ColorValues1 );
  2238. rc.OffsetRect(0,-1);
  2239. COLORREF ColorValues2[2] = {  RGB(0,0,0),  m_clrPnConfigButton  };
  2240. PaintGlyphCentered( dc, rc, *pGlyph, ColorValues2 );
  2241. }
  2242. void CExtPaintManagerOffice2007_Impl::PaintPageNavigatorSplitter(
  2243. CDC & dc,
  2244. const CRect & rcSplitter,
  2245. bool bDrawDots // = true
  2246. )
  2247. {
  2248. ASSERT_VALID( this );
  2249. ASSERT_VALID( this );
  2250. ASSERT( dc.GetSafeHdc() != NULL );
  2251. if( IsHighContrast() )
  2252. {
  2253. CExtPaintManagerXP::PaintPageNavigatorSplitter( dc, rcSplitter, bDrawDots );
  2254. return;
  2255. }
  2256. if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
  2257. {
  2258. stat_PaintGradientRect( dc, &rcSplitter, m_arrClrPnSplitter[1], m_arrClrPnSplitter[0], true );
  2259. dc.FillSolidRect( rcSplitter.left, rcSplitter.top, rcSplitter.Width(), 1, GetColor( _2003CLR_PN_BORDER, this ) );
  2260. if( bDrawDots )
  2261. PaintPageNavigatorSplitterDots( dc, rcSplitter, 0 );
  2262. }
  2263. else
  2264. CExtPaintManagerOffice2003::PaintPageNavigatorSplitter( dc, rcSplitter, true );
  2265. }
  2266. void CExtPaintManagerOffice2010_Impl::PaintPageNavigatorSplitter(
  2267. CDC & dc,
  2268. const CRect & rcSplitter,
  2269. bool bDrawDots // = true
  2270. )
  2271. {
  2272. ASSERT_VALID( this );
  2273. ASSERT_VALID( this );
  2274. ASSERT( dc.GetSafeHdc() != NULL );
  2275. if( IsHighContrast() )
  2276. {
  2277. CExtPaintManagerXP::PaintPageNavigatorSplitter( dc, rcSplitter, bDrawDots );
  2278. return;
  2279. }
  2280. if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 8 )
  2281. {
  2282. stat_PaintGradientRect( dc, &rcSplitter, m_arrClrPnSplitter[1], m_arrClrPnSplitter[0], true );
  2283. dc.FillSolidRect( rcSplitter.left, rcSplitter.top, rcSplitter.Width(), 1, GetColor( _2003CLR_PN_BORDER, this ) );
  2284. dc.FillSolidRect( rcSplitter.left, rcSplitter.bottom-1, rcSplitter.Width(), 1, GetColor( _2003CLR_PN_BORDER, this ) );
  2285. if( bDrawDots )
  2286. PaintPageNavigatorSplitterDots( dc, rcSplitter, 0 );
  2287. }
  2288. else
  2289. CExtPaintManagerOffice2003::PaintPageNavigatorSplitter( dc, rcSplitter, true );
  2290. }
  2291. #endif // (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  2292. CExtPaintManager::SCROLLBARSKINDATA * CExtPaintManagerOffice2007_Impl::ScrollBar_GetSkinData(
  2293. bool bHorzBar,
  2294. CObject * pHelperSrc,
  2295. LPARAM lParam, // = 0L
  2296. bool bLightAccent // = true
  2297. )
  2298. {
  2299. ASSERT_VALID( this );
  2300. if( IsHighContrast() )
  2301. return
  2302. CExtPaintManagerXP::ScrollBar_GetSkinData(
  2303. bHorzBar,
  2304. pHelperSrc,
  2305. lParam,
  2306. bLightAccent
  2307. );
  2308. if( pHelperSrc != NULL )
  2309. {
  2310. ASSERT_VALID( pHelperSrc );
  2311. if( pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtZoomScrollBar ) ) )
  2312. {
  2313. switch( ((CExtZoomScrollBar*)pHelperSrc)->m_eSO )
  2314. {
  2315. case CExtScrollBar::__ESO_TOP:
  2316. return (&m_SbSkinDataT_Zoom);
  2317. case CExtScrollBar::__ESO_BOTTOM:
  2318. return (&m_SbSkinDataB_Zoom);
  2319. case CExtScrollBar::__ESO_LEFT:
  2320. return (&m_SbSkinDataL_Zoom);
  2321. case CExtScrollBar::__ESO_RIGHT:
  2322. return (&m_SbSkinDataR_Zoom);
  2323. default:
  2324. return bHorzBar ? (&m_SbSkinDataT_Zoom) : (&m_SbSkinDataL_Zoom);
  2325. } // switch( ((CExtZoomScrollBar*)pHelperSrc)->m_eSO )
  2326. } // if( pHelperSrc->IsKindOf( RUNTIME_CLASS( CExtZoomScrollBar ) ) )
  2327. } // if( pHelperSrc != NULL )
  2328. if( bLightAccent )
  2329. return bHorzBar ? (&m_SbSkinDataH_Light) : (&m_SbSkinDataV_Light);
  2330. else
  2331. return bHorzBar ? (&m_SbSkinDataH_Dark) : (&m_SbSkinDataV_Dark);
  2332. }
  2333. bool CExtPaintManagerOffice2007_Impl::ScrollBar_GetMetrics(
  2334. INT * p_nHorzBarHeight, // = NULL
  2335. INT * p_nVertBarWidth, // = NULL
  2336. INT * p_nHorzButtonWidth, // = NULL
  2337. INT * p_nVertButtonHeight, // = NULL
  2338. INT * p_nHorzThumbMinWidth, // = NULL
  2339. INT * p_nVertThumbMinHeight, // = NULL
  2340. CObject * pHelperSrc, // = NULL
  2341. LPARAM lParam // = 0L
  2342. ) const
  2343. {
  2344. ASSERT_VALID( this );
  2345. if( IsHighContrast() )
  2346. return
  2347. CExtPaintManagerXP::ScrollBar_GetMetrics(
  2348. p_nHorzBarHeight,
  2349. p_nVertBarWidth,
  2350. p_nHorzButtonWidth,
  2351. p_nVertButtonHeight,
  2352. p_nHorzThumbMinWidth,
  2353. p_nVertThumbMinHeight,
  2354. pHelperSrc,
  2355. lParam
  2356. );
  2357. if( ( p_nHorzBarHeight != NULL
  2358. || p_nVertBarWidth != NULL
  2359. || p_nHorzButtonWidth != NULL
  2360. || p_nVertButtonHeight != NULL
  2361. || p_nHorzThumbMinWidth != NULL
  2362. || p_nVertThumbMinHeight != NULL
  2363. )
  2364. && pHelperSrc != NULL
  2365. )
  2366. {
  2367. ASSERT_VALID( pHelperSrc );
  2368. CExtZoomScrollBar * pZoomScrollBar = DYNAMIC_DOWNCAST( CExtZoomScrollBar, pHelperSrc );
  2369. if( pZoomScrollBar != NULL )
  2370. {
  2371. if( p_nHorzBarHeight != NULL )
  2372. {
  2373. (*p_nHorzBarHeight) = m_SbSkinDataT_Zoom.m_arrPartBmp[INT(__ESBSPT_NORMAL)][INT(__ESBMHT_BUTTON_DOWN)].GetSize().cy;
  2374. if( (*p_nHorzBarHeight) <= 0 )
  2375. return false;
  2376. else
  2377. (*p_nHorzBarHeight) += 2;
  2378. }
  2379. if( p_nVertBarWidth != NULL )
  2380. {
  2381. (*p_nVertBarWidth) = m_SbSkinDataT_Zoom.m_arrPartBmp[INT(__ESBSPT_NORMAL)][INT(__ESBMHT_BUTTON_DOWN)].GetSize().cx;
  2382. if( (*p_nVertBarWidth) <= 0 )
  2383. return false;
  2384. else
  2385. (*p_nVertBarWidth) += 2;
  2386. }
  2387. if( p_nHorzButtonWidth != NULL )
  2388. {
  2389. (*p_nHorzButtonWidth) = m_SbSkinDataT_Zoom.m_arrPartBmp[INT(__ESBSPT_NORMAL)][INT(__ESBMHT_BUTTON_DOWN)].GetSize().cx;
  2390. if( (*p_nHorzButtonWidth) <= 0 )
  2391. return false;
  2392. }
  2393. if( p_nVertButtonHeight != NULL )
  2394. {
  2395. (*p_nVertButtonHeight) = m_SbSkinDataT_Zoom.m_arrPartBmp[INT(__ESBSPT_NORMAL)][INT(__ESBMHT_BUTTON_DOWN)].GetSize().cy;
  2396. if( (*p_nVertButtonHeight) <= 0 )
  2397. return false;
  2398. }
  2399. if( p_nHorzThumbMinWidth != NULL )
  2400. {
  2401. (*p_nHorzThumbMinWidth) = m_SbSkinDataT_Zoom.m_arrPartBmp[INT(__ESBSPT_NORMAL)][INT(__ESBMHT_THUMB)].GetSize().cx;
  2402. if( (*p_nHorzThumbMinWidth) <= 0 )
  2403. return false;
  2404. }
  2405. if( p_nVertThumbMinHeight != NULL )
  2406. {
  2407. (*p_nVertThumbMinHeight) = m_SbSkinDataT_Zoom.m_arrPartBmp[INT(__ESBSPT_NORMAL)][INT(__ESBMHT_THUMB)].GetSize().cy;
  2408. if( (*p_nVertThumbMinHeight) <= 0 )
  2409. return false;
  2410. }
  2411. return true;
  2412. } // if( pZoomScrollBar != NULL )
  2413. }
  2414. return
  2415. CExtPaintManagerOffice2003::ScrollBar_GetMetrics(
  2416. p_nHorzBarHeight,
  2417. p_nVertBarWidth,
  2418. p_nHorzButtonWidth,
  2419. p_nVertButtonHeight,
  2420. p_nHorzThumbMinWidth,
  2421. p_nVertThumbMinHeight,
  2422. pHelperSrc,
  2423. lParam
  2424. );
  2425. }
  2426. CExtPaintManagerOffice2007_R1::CExtPaintManagerOffice2007_R1()
  2427. {
  2428. m_clrFillHint = RGB(205,205,205);
  2429. m_clrAccentHint = RGB(156,193,234);
  2430. m_clrIconAlphaColor = RGB(114,121,138);
  2431. m_clrAdvTipGradientBottom = RGB(229,229,240);
  2432. m_clrDCA1 = RGB(172,180,198);
  2433. m_clrDCA2 = RGB(113,125,152);
  2434. m_clrDCA3 = RGB(132,141,166);
  2435. m_bDocumentClientAreaBkgndR2 = false;
  2436. VERIFY( m_bmpDCA.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_DCA_R1) ) );
  2437. m_bmpDCA.PreMultiplyRGBChannels();
  2438. m_bmpDCA.PreMultipliedRGBChannelsSet( true );
  2439. m_bUseNcFrameBmpForDockerBkgnd = true;
  2440. m_clrCustomDropDownGlyphEnabled = RGB(0,0,0);
  2441. m_clrCustomDropDownGlyphDisabled = RGB(141,141,141);
  2442. m_clrDockingFrameDark = m_clrFloatingToolbarGripperSolid = RGB(83,96,125);
  2443. m_clrDockingFrameCaptionTextActive = RGB(51,51,51);
  2444. m_clrDockingFrameCaptionTextInactive = RGB(51,51,51);
  2445. m_clrDockingFrameCaptionTextFloatingFixed =  RGB(255,255,255);
  2446. m_clrDockingCaptionShapeFixedNormal =  RGB(255,255,255);
  2447. m_rcNcFrameBordersActive.SetRect( 3, 4, 3, 2 );
  2448. m_rcNcFrameBordersInactive.SetRect( 3, 4, 3, 2 );
  2449. m_nCaptionHeightActive = m_nCaptionHeightInactive = 26;
  2450. VERIFY( m_bmpNcFrameActive.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_FRAME_ACTIVE_R1) ) );
  2451. VERIFY( m_bmpNcFrameInactive.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_FRAME_INACTIVE_R1) ) );
  2452. VERIFY( m_bmpNcFrameActive.Make32() );
  2453. VERIFY( m_bmpNcFrameInactive.Make32() );
  2454. m_bmpNcFrameActive.AlphaColor( m_clrTransparentNcFrameActive, RGB(0,0,0), 0 );
  2455. m_bmpNcFrameInactive.AlphaColor( m_clrTransparentNcFrameInactive, RGB(0,0,0), 0 );
  2456. m_clrNcFrameTextActive = RGB(69,69,69); // = RGB(123,123,123);
  2457. m_clrNcFrameTextInactive = RGB(163,163,163); // = RGB(183,183,183);
  2458. m_bmpNcFrameActive.PreMultiplyRGBChannels();
  2459. m_bmpNcFrameActive.PreMultipliedRGBChannelsSet( true );
  2460. m_bmpNcFrameInactive.PreMultiplyRGBChannels();
  2461. m_bmpNcFrameInactive.PreMultipliedRGBChannelsSet( true );
  2462. m_sizeNcButtonShapeInArr.cx = m_sizeNcButtonShapeInArr.cy = 21;
  2463. m_nNcBtnIdxNormalActive = m_nNcBtnIdxNormalInactive = 0;
  2464. VERIFY( m_bmpNcButtonBkHover.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_BUTTON_BK_HOVER_R1) ) );
  2465. VERIFY( m_bmpNcButtonBkPressed.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_BUTTON_BK_PRESSED_R1) ) );
  2466. VERIFY( m_bmpNcButtonBkHover.Make32() );
  2467. VERIFY( m_bmpNcButtonBkPressed.Make32() );
  2468. m_bmpNcButtonBkHover.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  2469. m_bmpNcButtonBkPressed.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  2470. m_bmpNcButtonBkHover.PreMultiplyRGBChannels();
  2471. m_bmpNcButtonBkHover.PreMultipliedRGBChannelsSet( true );
  2472. m_bmpNcButtonBkPressed.PreMultiplyRGBChannels();
  2473. m_bmpNcButtonBkPressed.PreMultipliedRGBChannelsSet( true );
  2474. VERIFY( m_bmpArrNcButtonsHelp.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_ARR_HELP_R1) ) );
  2475. m_bmpArrNcButtonsHelp.PreMultiplyRGBChannels();
  2476. m_bmpArrNcButtonsHelp.PreMultipliedRGBChannelsSet( true );
  2477. VERIFY( m_bmpArrNcButtonsClose.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_ARR_CLOSE_R1) ) );
  2478. m_bmpArrNcButtonsClose.PreMultiplyRGBChannels();
  2479. m_bmpArrNcButtonsClose.PreMultipliedRGBChannelsSet( true );
  2480. VERIFY( m_bmpArrNcButtonsMaximize.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_ARR_MAXIMIZE_R1) ) );
  2481. m_bmpArrNcButtonsMaximize.PreMultiplyRGBChannels();
  2482. m_bmpArrNcButtonsMaximize.PreMultipliedRGBChannelsSet( true );
  2483. VERIFY( m_bmpArrNcButtonsRestore.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_ARR_RESTORE_R1) ) );
  2484. m_bmpArrNcButtonsRestore.PreMultiplyRGBChannels();
  2485. m_bmpArrNcButtonsRestore.PreMultipliedRGBChannelsSet( true );
  2486. VERIFY( m_bmpArrNcButtonsMinimize.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_NC_ARR_MINIMIZE_R1) ) );
  2487. m_bmpArrNcButtonsMinimize.PreMultiplyRGBChannels();
  2488. m_bmpArrNcButtonsMinimize.PreMultipliedRGBChannelsSet( true );
  2489. #if (!defined __EXT_MFC_NO_STATUSBAR)
  2490. m_rcStatusBkPadding.SetRect( 0, 2, 0, 1 );
  2491. VERIFY( m_bmpStatusBkLight.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_STATUSBAR_BK_LIGHT_R1) ) );
  2492. VERIFY( m_bmpStatusBkDark.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_STATUSBAR_BK_DARK_R1) ) );
  2493. m_rcStatusSeparatorPadding.SetRect( 0, 2, 0, 1 );
  2494. VERIFY( m_bmpStatusSeparator.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_STATUSBAR_SEPARATOR_R1) ) );
  2495. #endif // (!defined __EXT_MFC_NO_STATUSBAR)
  2496. #if (!defined __EXT_MFC_NO_TAB_CTRL)
  2497. m_clrTabTextNormal = m_clrTabTextSelected = RGB(8,32,100);
  2498. m_nIdxTabShapeHover = 0;
  2499. m_nIdxTabShapePressed = 1;
  2500. m_nIdxTabShapeSelected = 2;
  2501. m_nIdxTabShapeSelectedHover = 3;
  2502. m_arrSizeTabShape[__ETSOI_TOP].cx
  2503. = m_arrSizeTabShape[__ETSOI_BOTTOM].cx
  2504. = m_arrSizeTabShape[__ETSOI_LEFT].cy
  2505. = m_arrSizeTabShape[__ETSOI_RIGHT].cy
  2506. = 72;
  2507. m_arrSizeTabShape[__ETSOI_TOP].cy
  2508. = m_arrSizeTabShape[__ETSOI_BOTTOM].cy
  2509. = m_arrSizeTabShape[__ETSOI_LEFT].cx
  2510. = m_arrSizeTabShape[__ETSOI_RIGHT].cx
  2511. = 25;
  2512. m_arrRectTabShapePadding[__ETSOI_TOP].SetRect( 6, 3, 6, 3 );
  2513. m_arrRectTabShapePadding[__ETSOI_BOTTOM].SetRect( 6, 3, 6, 3 );
  2514. m_arrRectTabShapePadding[__ETSOI_LEFT].SetRect( 3, 6, 3, 6 );
  2515. m_arrRectTabShapePadding[__ETSOI_RIGHT].SetRect( 3, 6, 3, 6 );
  2516. VERIFY(
  2517. m_arrBmpTabShapeNormal[__ETSOI_TOP].LoadBMP_Resource(
  2518. MAKEINTRESOURCE( IDB_EXT_2007_TAB_SHAPE_ARR_R1 )
  2519. )
  2520. );
  2521. VERIFY( m_arrBmpTabShapeNormal[__ETSOI_TOP].Make32() );
  2522. VERIFY(
  2523. m_arrBmpTabShapeNormal[__ETSOI_BOTTOM].CreateRotated9xStack(
  2524. m_arrBmpTabShapeNormal[__ETSOI_TOP],
  2525. 180,
  2526. 4,
  2527. m_arrSizeTabShape[__ETSOI_TOP].cx,
  2528. m_arrSizeTabShape[__ETSOI_TOP].cy,
  2529. false,
  2530. false
  2531. )
  2532. );
  2533. VERIFY(
  2534. m_arrBmpTabShapeNormal[__ETSOI_LEFT].CreateRotated9xStack(
  2535. m_arrBmpTabShapeNormal[__ETSOI_TOP],
  2536. 270,
  2537. 4,
  2538. m_arrSizeTabShape[__ETSOI_TOP].cx,
  2539. m_arrSizeTabShape[__ETSOI_TOP].cy,
  2540. false,
  2541. false
  2542. )
  2543. );
  2544. VERIFY(
  2545. m_arrBmpTabShapeNormal[__ETSOI_RIGHT].CreateRotated9xStack(
  2546. m_arrBmpTabShapeNormal[__ETSOI_TOP],
  2547. 90,
  2548. 4,
  2549. m_arrSizeTabShape[__ETSOI_TOP].cx,
  2550. m_arrSizeTabShape[__ETSOI_TOP].cy,
  2551. false,
  2552. false
  2553. )
  2554. );
  2555. m_arrSizeTabSeparator[__ETSOI_TOP].cx
  2556. = m_arrSizeTabSeparator[__ETSOI_BOTTOM].cx
  2557. = m_arrSizeTabSeparator[__ETSOI_LEFT].cy
  2558. = m_arrSizeTabSeparator[__ETSOI_RIGHT].cy
  2559. = 1;
  2560. m_arrSizeTabSeparator[__ETSOI_TOP].cy
  2561. = m_arrSizeTabSeparator[__ETSOI_BOTTOM].cy
  2562. = m_arrSizeTabSeparator[__ETSOI_LEFT].cx
  2563. = m_arrSizeTabSeparator[__ETSOI_RIGHT].cx
  2564. = 25;
  2565. m_arrRectTabSeparatorPadding[__ETSOI_TOP].SetRect( 0, 2, 0, 2 );
  2566. m_arrRectTabSeparatorPadding[__ETSOI_BOTTOM].SetRect( 0, 2, 0, 2 );
  2567. m_arrRectTabSeparatorPadding[__ETSOI_LEFT].SetRect( 2, 0, 2, 0 );
  2568. m_arrRectTabSeparatorPadding[__ETSOI_RIGHT].SetRect( 2, 0, 2, 0 );
  2569. VERIFY(
  2570. m_arrBmpTabSeparator[__ETSOI_TOP].LoadBMP_Resource(
  2571. MAKEINTRESOURCE( IDB_EXT_2007_TAB_SEPARATOR_R1 )
  2572. )
  2573. );
  2574. VERIFY( m_arrBmpTabSeparator[__ETSOI_TOP].Make32() );
  2575. m_arrBmpTabSeparator[__ETSOI_TOP].PreMultiplyRGBChannels();
  2576. m_arrBmpTabSeparator[__ETSOI_TOP].PreMultipliedRGBChannelsSet( true );
  2577. VERIFY(
  2578. m_arrBmpTabSeparator[__ETSOI_BOTTOM].CreateRotated9xStack(
  2579. m_arrBmpTabSeparator[__ETSOI_TOP],
  2580. 180,
  2581. 1,
  2582. m_arrSizeTabSeparator[__ETSOI_TOP].cx,
  2583. m_arrSizeTabSeparator[__ETSOI_TOP].cy,
  2584. false,
  2585. false
  2586. )
  2587. );
  2588. VERIFY(
  2589. m_arrBmpTabSeparator[__ETSOI_LEFT].CreateRotated9xStack(
  2590. m_arrBmpTabSeparator[__ETSOI_TOP],
  2591. 270,
  2592. 1,
  2593. m_arrSizeTabSeparator[__ETSOI_TOP].cx,
  2594. m_arrSizeTabSeparator[__ETSOI_TOP].cy,
  2595. false,
  2596. false
  2597. )
  2598. );
  2599. VERIFY(
  2600. m_arrBmpTabSeparator[__ETSOI_RIGHT].CreateRotated9xStack(
  2601. m_arrBmpTabSeparator[__ETSOI_TOP],
  2602. 90,
  2603. 1,
  2604. m_arrSizeTabSeparator[__ETSOI_TOP].cx,
  2605. m_arrSizeTabSeparator[__ETSOI_TOP].cy,
  2606. false,
  2607. false
  2608. )
  2609. );
  2610. #endif // (!defined __EXT_MFC_NO_TAB_CTRL)
  2611. #if (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  2612. m_clrPnCaptText  = RGB(51,51,51);
  2613. #endif // (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  2614. VERIFY(
  2615. m_bmpArrStatesCheckBox.LoadBMP_Resource(
  2616. MAKEINTRESOURCE( IDB_EXT_2007_CHECK_BOX_R1 )
  2617. )
  2618. );
  2619. VERIFY(
  2620. m_bmpArrStatesRadioButton.LoadBMP_Resource(
  2621. MAKEINTRESOURCE( IDB_EXT_2007_RADIO_BUTTON_R1 )
  2622. )
  2623. );
  2624. m_clrMenuItemLeftAreaMarginL = RGB(225,225,225);
  2625. m_clrMenuItemLeftAreaMarginR = RGB(255,255,255);
  2626. VERIFY(
  2627. m_bmpMenuItemLargeLeft.LoadBMP_Resource(
  2628. MAKEINTRESOURCE( IDB_EXT_2007_MENU_ITEM_R1_LARGE_LEFT )
  2629. )
  2630. );
  2631. VERIFY(
  2632. m_bmpMenuItemLargeRight.LoadBMP_Resource(
  2633. MAKEINTRESOURCE( IDB_EXT_2007_MENU_ITEM_R1_LARGE_RIGHT )
  2634. )
  2635. );
  2636. VERIFY(
  2637. m_bmpMenuItemSmallLeft.LoadBMP_Resource(
  2638. MAKEINTRESOURCE( IDB_EXT_2007_MENU_ITEM_R1_SMALL_LEFT )
  2639. )
  2640. );
  2641. VERIFY(
  2642. m_bmpMenuItemSmallRight.LoadBMP_Resource(
  2643. MAKEINTRESOURCE( IDB_EXT_2007_MENU_ITEM_R1_SMALL_RIGHT )
  2644. )
  2645. );
  2646. VERIFY(
  2647. m_bmpMenuArrow.LoadBMP_Resource(
  2648. MAKEINTRESOURCE( IDB_EXT_2007_MENU_ITEM_ARROW )
  2649. )
  2650. );
  2651. m_sizeMenuCheckAreaChecked.cx = 16;
  2652. m_sizeMenuCheckAreaChecked.cy = 16;
  2653. m_sizeMenuCheckAreaUnchecked.cx = 20;
  2654. m_sizeMenuCheckAreaUnchecked.cy = 20;
  2655. m_arrRectMenuCheckAreaCheckedPadding[0].SetRect( 1, 1, 1, 1 );
  2656. m_arrRectMenuCheckAreaCheckedPadding[1].SetRect( 1, 1, 1, 1 );
  2657. m_arrRectMenuCheckAreaUncheckedPadding[0].SetRect( 1, 1, 1, 1 );
  2658. m_arrRectMenuCheckAreaUncheckedPadding[1].SetRect( 1, 1, 1, 1 );
  2659. VERIFY( m_bmpMenuCheckAreaChecked.LoadBMP_Resource(   MAKEINTRESOURCE( IDB_EXT_2007_MENU_CHECK_AREA_CHECKED_R1   ) ) );
  2660. VERIFY( m_bmpMenuCheckAreaUnchecked.LoadBMP_Resource( MAKEINTRESOURCE( IDB_EXT_2007_MENU_CHECK_AREA_UNCHECKED_R1 ) ) );
  2661. VERIFY( m_bmpArrComboBoxDropDown.LoadBMP_Resource( MAKEINTRESOURCE( IDB_EXT_2007_COMBO_BOX_BUTTON_R1 ) ) );
  2662. m_arrClrComboBoxBorder[0] = RGB(177,187,198);
  2663. m_arrClrComboBoxBorder[1] = RGB(148,168,198);
  2664. m_arrClrComboBoxBorder[2] = RGB(148,168,198);
  2665. m_arrClrComboBoxBorder[3] = RGB(177,187,198);
  2666. CRect SbSkinDataPaddingH( 5, 3, 5, 3 ), SbSkinDataPaddingV( 3, 5, 3, 5 );
  2667. CRect rcEntirePaddingRH( 0, 2, 0, 2 ), rcEntirePaddingRV( 2, 0, 2, 0 );
  2668. CRect rcEntirePaddingCH( 1, 1, 1, 1 ), rcEntirePaddingCV( 1, 1, 1, 1 );
  2669. m_SbSkinDataT_Zoom.Load2007_Zoom(
  2670. IDB_EXT_2007_ZS_PLUS_R1, IDB_EXT_2007_ZS_MINUS_R1, IDB_EXT_2007_ZS_THUMB_R1,
  2671. RGB(222,226,236), RGB(163,175,203), RGB(213,218,231), RGB(185,194,215), AFX_IDW_DOCKBAR_TOP, false
  2672. );
  2673. m_SbSkinDataB_Zoom.Load2007_Zoom(
  2674. IDB_EXT_2007_ZS_PLUS_R1, IDB_EXT_2007_ZS_MINUS_R1, IDB_EXT_2007_ZS_THUMB_R1,
  2675. RGB(222,226,236), RGB(163,175,203), RGB(213,218,231), RGB(185,194,215), AFX_IDW_DOCKBAR_BOTTOM, false
  2676. );
  2677. m_SbSkinDataL_Zoom.Load2007_Zoom(
  2678. IDB_EXT_2007_ZS_PLUS_R1, IDB_EXT_2007_ZS_MINUS_R1, IDB_EXT_2007_ZS_THUMB_R1,
  2679. RGB(222,226,236), RGB(163,175,203), RGB(213,218,231), RGB(185,194,215), AFX_IDW_DOCKBAR_LEFT, false
  2680. );
  2681. m_SbSkinDataR_Zoom.Load2007_Zoom(
  2682. IDB_EXT_2007_ZS_PLUS_R1, IDB_EXT_2007_ZS_MINUS_R1, IDB_EXT_2007_ZS_THUMB_R1,
  2683. RGB(222,226,236), RGB(163,175,203), RGB(213,218,231), RGB(185,194,215), AFX_IDW_DOCKBAR_RIGHT, false
  2684. );
  2685. m_SbSkinDataH_Light.Load2007_R1(
  2686. IDB_EXT_2007_SCROLL_BAR_STACK_BUTTONS_R1_HORZ,
  2687. 17,
  2688. IDB_EXT_2007_SCROLL_BAR_GRIPPER_R1_HORZ,
  2689. SbSkinDataPaddingH,
  2690. COLORREF(-1L),
  2691. COLORREF(-1L),
  2692. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  2693. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  2694. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  2695. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  2696. true,
  2697. IDB_EXT_2007_SCROLL_BAR_ENTIRE_BK_R1_LIGHT,
  2698. IDB_EXT_2007_SCROLL_BAR_PAGE_BK_R1_LIGHT,
  2699. rcEntirePaddingRH,
  2700. rcEntirePaddingCH
  2701. );
  2702. m_SbSkinDataV_Light.Load2007_R1(
  2703. IDB_EXT_2007_SCROLL_BAR_STACK_BUTTONS_R1_VERT,
  2704. 17,
  2705. IDB_EXT_2007_SCROLL_BAR_GRIPPER_R1_VERT,
  2706. SbSkinDataPaddingV,
  2707. COLORREF(-1L),
  2708. COLORREF(-1L),
  2709. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  2710. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  2711. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  2712. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  2713. false,
  2714. IDB_EXT_2007_SCROLL_BAR_ENTIRE_BK_R1_LIGHT,
  2715. IDB_EXT_2007_SCROLL_BAR_PAGE_BK_R1_LIGHT,
  2716. rcEntirePaddingRV,
  2717. rcEntirePaddingCV
  2718. );
  2719. m_SbSkinDataH_Dark.Load2007_R1(
  2720. IDB_EXT_2007_SCROLL_BAR_STACK_BUTTONS_R1_HORZ,
  2721. 17,
  2722. IDB_EXT_2007_SCROLL_BAR_GRIPPER_R1_HORZ,
  2723. SbSkinDataPaddingH,
  2724. COLORREF(-1L),
  2725. COLORREF(-1L),
  2726. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  2727. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  2728. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  2729. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  2730. true,
  2731. IDB_EXT_2007_SCROLL_BAR_ENTIRE_BK_R1_DARK,
  2732. IDB_EXT_2007_SCROLL_BAR_PAGE_BK_R1_DARK,
  2733. rcEntirePaddingRH,
  2734. rcEntirePaddingCH
  2735. );
  2736. m_SbSkinDataV_Dark.Load2007_R1(
  2737. IDB_EXT_2007_SCROLL_BAR_STACK_BUTTONS_R1_VERT,
  2738. 17,
  2739. IDB_EXT_2007_SCROLL_BAR_GRIPPER_R1_VERT,
  2740. SbSkinDataPaddingV,
  2741. COLORREF(-1L),
  2742. COLORREF(-1L),
  2743. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  2744. IDB_EXT_2007_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  2745. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  2746. IDB_EXT_2007_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  2747. false,
  2748. IDB_EXT_2007_SCROLL_BAR_ENTIRE_BK_R1_DARK,
  2749. IDB_EXT_2007_SCROLL_BAR_PAGE_BK_R1_DARK,
  2750. rcEntirePaddingRV,
  2751. rcEntirePaddingCV
  2752. );
  2753. m_clrGridHeaderBkTop     = RGB(253,253,253);
  2754. m_clrGridHeaderBkBottom  = RGB(212,215,220);
  2755. m_clrGridHeaderSeparator = RGB(145,153,164);
  2756. m_clrGridHeaderSortArrow = RGB(145,153,164);
  2757. m_clrGridHeaderBorder    = RGB(145,153,164);
  2758. m_clrRgHeaderBkTop     = RGB(253,253,253);
  2759. m_clrRgHeaderBkBottom  = RGB(212,215,220);
  2760. m_clrRgHeaderSeparator = RGB(145,153,164);
  2761. m_clrRgHeaderSortArrow = RGB(145,153,164);
  2762. m_clrRgHeaderText      = RGB(0,0,0);
  2763. m_clrRgHeaderBorder    = RGB(76,83,92);
  2764. #if (!defined __EXT_MFC_NO_REPORTGRIDWND)
  2765. m_clrRgGroupAreaBk     = RGB(235,235,235);
  2766. m_clrRgGroupAreaText   = RGB(70,70,70);
  2767. #endif // (!defined __EXT_MFC_NO_REPORTGRIDWND)
  2768. //  m_nTbbLightWeightSDDRightGlyphHeightV = 9;
  2769. //  VERIFY(
  2770. //  m_arrBmpTbbLightWeightSimpleH.LoadBMP_Resource(
  2771. //  MAKEINTRESOURCE(IDB_EXT_2007_TBB_LIGHTWEIGHT_R1_SIMPLE )
  2772. //  )
  2773. //  );
  2774. //  VERIFY(
  2775. //  m_arrBmpTbbLightWeightSDDLeftH.LoadBMP_Resource(
  2776. //  MAKEINTRESOURCE(IDB_EXT_2007_TBB_LIGHTWEIGHT_R1_LEFT_PART )
  2777. //  )
  2778. //  );
  2779. //  VERIFY(
  2780. //  m_arrBmpTbbLightWeightSDDRightH.LoadBMP_Resource(
  2781. //  MAKEINTRESOURCE(IDB_EXT_2007_TBB_LIGHTWEIGHT_R1_RIGHT_PART )
  2782. //  )
  2783. //  );
  2784. //  VERIFY(
  2785. //  m_arrBmpTbbLightWeightSimpleV.CreateRotated9xStack(
  2786. //  m_arrBmpTbbLightWeightSimpleH,
  2787. //  90,
  2788. //  INT(__EPBGT_GLYPH_COUNT),
  2789. //  m_arrBmpTbbLightWeightSimpleH.GetSize().cx,
  2790. //  m_nTbbLightWeightSimpleGlyphHeightH,
  2791. //  false,
  2792. //  false
  2793. //  )
  2794. //  );
  2795. //  VERIFY(
  2796. //  m_arrBmpTbbLightWeightSDDLeftV.CreateRotated9xStack(
  2797. //  m_arrBmpTbbLightWeightSDDLeftH,
  2798. //  90,
  2799. //  INT(__EPBGT_GLYPH_COUNT),
  2800. //  m_arrBmpTbbLightWeightSDDLeftH.GetSize().cx,
  2801. //  m_nTbbLightWeightSDDLeftGlyphHeightH,
  2802. //  false,
  2803. //  false
  2804. //  )
  2805. //  );
  2806. //  VERIFY(
  2807. //  m_arrBmpTbbLightWeightSDDRightV.CreateRotated9xStack(
  2808. //  m_arrBmpTbbLightWeightSDDRightH,
  2809. //  90,
  2810. //  INT(__EPBGT_GLYPH_COUNT),
  2811. //  m_arrBmpTbbLightWeightSDDRightH.GetSize().cx,
  2812. //  m_nTbbLightWeightSDDRightGlyphHeightH,
  2813. //  false,
  2814. //  false
  2815. //  )
  2816. //  );
  2817. m_nPushBtnSDDRightGlyphHeightV = 9;
  2818. VERIFY(
  2819. m_arrBmpPushBtnSimpleH.LoadBMP_Resource(
  2820. MAKEINTRESOURCE(IDB_EXT_2007_BUTTON_R1_SIMPLE )
  2821. )
  2822. );
  2823. VERIFY(
  2824. m_arrBmpPushBtnSDDLeftH.LoadBMP_Resource(
  2825. MAKEINTRESOURCE(IDB_EXT_2007_BUTTON_R1_LEFT_PART )
  2826. )
  2827. );
  2828. VERIFY(
  2829. m_arrBmpPushBtnSDDRightH.LoadBMP_Resource(
  2830. MAKEINTRESOURCE(IDB_EXT_2007_BUTTON_R1_RIGHT_PART )
  2831. )
  2832. );
  2833. VERIFY(
  2834. m_arrBmpPushBtnSimpleV.CreateRotated9xStack(
  2835. m_arrBmpPushBtnSimpleH,
  2836. 90,
  2837. INT(__EPBGT_GLYPH_COUNT),
  2838. m_arrBmpPushBtnSimpleH.GetSize().cx,
  2839. m_nPushBtnSimpleGlyphHeightH,
  2840. false,
  2841. false
  2842. )
  2843. );
  2844. VERIFY(
  2845. m_arrBmpPushBtnSDDLeftV.CreateRotated9xStack(
  2846. m_arrBmpPushBtnSDDLeftH,
  2847. 90,
  2848. INT(__EPBGT_GLYPH_COUNT),
  2849. m_arrBmpPushBtnSDDLeftH.GetSize().cx,
  2850. m_nPushBtnSDDLeftGlyphHeightH,
  2851. false,
  2852. false
  2853. )
  2854. );
  2855. VERIFY(
  2856. m_arrBmpPushBtnSDDRightV.CreateRotated9xStack(
  2857. m_arrBmpPushBtnSDDRightH,
  2858. 90,
  2859. INT(__EPBGT_GLYPH_COUNT),
  2860. m_arrBmpPushBtnSDDRightH.GetSize().cx,
  2861. m_nPushBtnSDDRightGlyphHeightH,
  2862. false,
  2863. false
  2864. )
  2865. );
  2866. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  2867. m_bRibbonGroupCaptionAtTop = true;
  2868. m_bRibbonGroupCaptionAreaHasPadding = true;
  2869. m_nRibbonGroupCaptionAreaHeightExpanded = 16;
  2870. m_nRibbonGroupCaptionAreaHeightCollapsed = 16;
  2871. m_nRibbonGroupIconBkVertOffset = 0;
  2872. m_nRibbonCaptionPartHeight = 17;
  2873. m_rcRibbonPageOuterContentPadding.SetRect( 0, 0, 0, 0 );
  2874. m_clrRibbonComboBackGroundNormal = RGB(231,234,241);
  2875. m_nRibbonQuickAccessBarButtonsAlignment = 0;
  2876. m_clrRibbonGroupCaptionTextCollapsed
  2877. = m_clrRibbonButtonNormal
  2878. = RGB(32,0,112);
  2879. m_clrRibbonButtonDisabled = RGB(128,128,128);
  2880. m_clrRibbonGroupCaptionTextExpanded = RGB( 240, 240, 240 );
  2881. m_clrRibbonGroupCaptionTextShadowExpanded = RGB( 0, 0, 0 );
  2882. m_sizeRibbonGroupCaptionTextOffset = CSize( 1, 1 );
  2883. m_rcRibbonPageBkPadding.SetRect( 5, 19, 5, 10 );
  2884. VERIFY(
  2885. m_bmpRibbonPageBk.LoadBMP_Resource(
  2886. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_PAGE_BK_R1)
  2887. )
  2888. );
  2889. m_rcRibbonGroupPaddingBkExpanded.SetRect( 5, 4, 5, 4 );
  2890. VERIFY(
  2891. m_bmpRibbonGroupBkExpanded[0].LoadBMP_Resource(
  2892. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_GROUP_EXPANDED_NORMAL_BK_R1)
  2893. )
  2894. );
  2895. VERIFY(
  2896. m_bmpRibbonGroupBkExpanded[1].LoadBMP_Resource(
  2897. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_GROUP_EXPANDED_HOVER_BK_R1)
  2898. )
  2899. );
  2900. m_rcRibbonGroupPaddingBkCollapsed.SetRect( 6, 18, 6, 4 );
  2901. VERIFY(
  2902. m_bmpRibbonGroupBkCollapsed[0].LoadBMP_Resource(
  2903. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_GROUP_COLLAPSED_NORMAL_BK_R1)
  2904. )
  2905. );
  2906. VERIFY(
  2907. m_bmpRibbonGroupBkCollapsed[1].LoadBMP_Resource(
  2908. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_GROUP_COLLAPSED_HOVER_BK_R1)
  2909. )
  2910. );
  2911. VERIFY(
  2912. m_bmpRibbonGroupBkCollapsed[2].LoadBMP_Resource(
  2913. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_GROUP_COLLAPSED_PRESSED_BK_R1)
  2914. )
  2915. );
  2916. VERIFY(
  2917. m_bmpRibbonGroupBkCollapsed[3].LoadBMP_Resource( // selected same as hover in R1
  2918. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_GROUP_COLLAPSED_HOVER_BK_R1)
  2919. )
  2920. );
  2921. //INT nBkIndex, nBkCount;
  2922. // nBkCount = sizeof( m_bmpRibbonGroupBkExpanded ) / sizeof( m_bmpRibbonGroupBkExpanded[0] );
  2923. // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  2924. // {
  2925. // m_bmpRibbonGroupBkExpanded[nBkIndex].Make32();
  2926. // m_bmpRibbonGroupBkExpanded[nBkIndex].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  2927. // } // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  2928. // nBkCount = sizeof( m_bmpRibbonGroupBkCollapsed ) / sizeof( m_bmpRibbonGroupBkCollapsed[0] );
  2929. // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  2930. // {
  2931. // m_bmpRibbonGroupBkCollapsed[nBkIndex].Make32();
  2932. // m_bmpRibbonGroupBkCollapsed[nBkIndex].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  2933. // } // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  2934. m_nRibbonSeparatorDrawModeH = INT( CExtBitmap::__EDM_TILE_H );
  2935. m_nRibbonSeparatorDrawModeV = INT( CExtBitmap::__EDM_TILE_V );
  2936. m_rcRibbonSeparatorPaddingH.SetRect( 8, 0, 8, 0 );
  2937. VERIFY(
  2938. m_bmpRibbonSeparatorH.LoadBMP_Resource(
  2939. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_SEPARATOR_H_R1)
  2940. )
  2941. );
  2942. VERIFY( m_bmpRibbonSeparatorH.Make32() );
  2943. m_bmpRibbonSeparatorH.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  2944. m_rcRibbonSeparatorPaddingV.SetRect( 0, 9, 0, 9 );
  2945. VERIFY(
  2946. m_bmpRibbonSeparatorV.LoadBMP_Resource(
  2947. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_SEPARATOR_V_R1)
  2948. )
  2949. );
  2950. VERIFY( m_bmpRibbonSeparatorV.Make32() );
  2951. m_bmpRibbonSeparatorV.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  2952. m_nRibbonHeightOfQACEB = 18;
  2953. m_nIdxRibbonQACEB_Selected = 0;
  2954. VERIFY(
  2955. m_bmpArrRibbonQACEB.LoadBMP_Resource(
  2956. MAKEINTRESOURCE(IDB_EXT_2007_QATB_CEB_R1)
  2957. )
  2958. );
  2959. m_bmpArrRibbonQACEB.PreMultiplyRGBChannels();
  2960. m_bmpArrRibbonQACEB.PreMultipliedRGBChannelsSet( true );
  2961. m_nRibbonEmbeddedCaptionTextAlignmentFlags = (DT_SINGLELINE|DT_CENTER|DT_VCENTER);
  2962. m_bRibbonFileButtonItegrationSupported = false;
  2963. //INT nCaptionHeightActive = NcFrame_GetCaptionHeight( true, NULL ) + m_rcNcFrameBordersActive.top;
  2964. //INT nCaptionHeightInactive = NcFrame_GetCaptionHeight( false, NULL ) + m_rcNcFrameBordersInactive.top;
  2965. //CExtBitmap::Filter _fBox( CExtBitmap::Filter::box );
  2966. // m_rcRibbonNcCornerLeftCP.SetRect( 22, 8, 2, 2 );
  2967. // m_rcRibbonNcCornerRightCP.SetRect( 2, 8, 22, 2 );
  2968. //
  2969. // VERIFY(
  2970. // m_bmpRibbonNcCornerActiveLeft.LoadBMP_Resource(
  2971. // MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_NC_CORNER_ACTIVE_LEFT_R2_LUNA_BLUE)
  2972. // )
  2973. // );
  2974. // m_bmpRibbonNcCornerActiveLeft.PreMultipliedRGBChannelsSet( true );
  2975. // m_bmpRibbonNcCornerActiveLeft.Scale(
  2976. // m_bmpRibbonNcCornerActiveLeft.GetSize().cx,
  2977. // nCaptionHeightActive,
  2978. // _fBox
  2979. // );
  2980. //
  2981. // VERIFY(
  2982. // m_bmpRibbonNcCornerInactiveLeft.LoadBMP_Resource(
  2983. // MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_NC_CORNER_INACTIVE_LEFT_R2_LUNA_BLUE)
  2984. // )
  2985. // );
  2986. // m_bmpRibbonNcCornerInactiveLeft.PreMultipliedRGBChannelsSet( true );
  2987. // m_bmpRibbonNcCornerInactiveLeft.Scale(
  2988. // m_bmpRibbonNcCornerInactiveLeft.GetSize().cx,
  2989. // nCaptionHeightInactive,
  2990. // _fBox
  2991. // );
  2992. //
  2993. // VERIFY(
  2994. // m_bmpRibbonNcCornerActiveRight.LoadBMP_Resource(
  2995. // MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_NC_CORNER_ACTIVE_RIGHT_R2_LUNA_BLUE)
  2996. // )
  2997. // );
  2998. // m_bmpRibbonNcCornerActiveRight.PreMultipliedRGBChannelsSet( true );
  2999. // m_bmpRibbonNcCornerActiveRight.Scale(
  3000. // m_bmpRibbonNcCornerActiveRight.GetSize().cx,
  3001. // nCaptionHeightActive,
  3002. // _fBox
  3003. // );
  3004. //
  3005. // VERIFY(
  3006. // m_bmpRibbonNcCornerInactiveRight.LoadBMP_Resource(
  3007. // MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_NC_CORNER_INACTIVE_RIGHT_R2_LUNA_BLUE)
  3008. // )
  3009. // );
  3010. // m_bmpRibbonNcCornerInactiveRight.PreMultipliedRGBChannelsSet( true );
  3011. // m_bmpRibbonNcCornerInactiveRight.Scale(
  3012. // m_bmpRibbonNcCornerInactiveRight.GetSize().cx,
  3013. // nCaptionHeightInactive,
  3014. // _fBox
  3015. // );
  3016. //
  3017. // VERIFY(
  3018. // m_bmpRibbonNcCornerHT.LoadBMP_Resource(
  3019. // MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_NC_CORNER_HT_MASK_R2_LUNA_BLUE)
  3020. // )
  3021. // );
  3022. // m_bmpRibbonNcCornerHT.Make32();
  3023. // m_bmpRibbonNcCornerHT.Scale(
  3024. // m_bmpRibbonNcCornerHT.GetSize().cx,
  3025. // nCaptionHeightActive,
  3026. // _fBox
  3027. // );
  3028. // VERIFY( m_bmpArrRibbonFileButton.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_FILE_BUTTON) ) );
  3029. // //m_bmpArrRibbonFileButton.PreMultipliedRGBChannelsSet( true );
  3030. VERIFY( m_bmpArrRibbonFileButtonR1.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_FILE_BUTTON_INTERIOR_R1) ) );
  3031. VERIFY( m_bmpRibbonFileButtonArea.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_FILE_BUTTON_AREA_R1) ) );
  3032. m_bmpRibbonFileButtonArea.Make32();
  3033. m_bmpRibbonFileButtonArea.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3034. m_rcPaddingRibbonQuickAccessBarBkAtTheBottom.SetRect( 0, 0, 0, 0 );
  3035. VERIFY( m_bmpRibbonQuickAccessBarBkAtTheBottom.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_QATB_BK_R1) ) );
  3036. m_nRibbonHeightOfOneDLB = 12;
  3037. m_nDlbIdxDisabled = m_nDlbIdxNormal = 0;
  3038. m_nDlbIdxHover = 1;
  3039. m_nDlbIdxPressed = 2;
  3040. rcRibbonContentPaddingDLB.SetRect( 1, 1, 1, 1 );
  3041. VERIFY(
  3042. m_arrBmpRibbonDLB.LoadBMP_Resource(
  3043. MAKEINTRESOURCE(IDB_EXT_2007_GCB_R1)
  3044. )
  3045. );
  3046. m_clrRibbonGalleryInplaceBorderNormal = RGB(195,202,217);
  3047. m_clrRibbonGalleryInplaceBorderHover  = RGB(171,180,199);
  3048. m_clrRibbonGalleryInplaceBkgndNormal  = RGB(195,202,217);
  3049. m_clrRibbonGalleryInplaceBkgndHover   = RGB(192,202,222);
  3050. m_rcRibbonGalleryScrollFill = RGB(198,204,218);
  3051. m_rcRibbonGalleryScrollButtonPadding.SetRect( 3, 3, 3, 3 );
  3052. m_nHeightRibbonGalleryScrollButton = -1; //20;
  3053. m_nIndexRibbonGalleryScrollButtonDisabled = 0;
  3054. m_nIndexRibbonGalleryScrollButtonNormal = 1;
  3055. m_nIndexRibbonGalleryScrollButtonHover = 2;
  3056. m_nIndexRibbonGalleryScrollButtonPressed = 3;
  3057. VERIFY(
  3058. m_bmpArrRibbonGalleryScrollButtonDown.LoadBMP_Resource(
  3059. MAKEINTRESOURCE(IDB_EXT_2007_RGIBTN_DOWN_R1)
  3060. )
  3061. );
  3062. VERIFY(
  3063. m_bmpArrRibbonGalleryScrollButtonUp.LoadBMP_Resource(
  3064. MAKEINTRESOURCE(IDB_EXT_2007_RGIBTN_UP_R1)
  3065. )
  3066. );
  3067. VERIFY(
  3068. m_bmpArrRibbonGalleryScrollButtonMenu.LoadBMP_Resource(
  3069. MAKEINTRESOURCE(IDB_EXT_2007_RGIBTN_MENU_R1)
  3070. )
  3071. );
  3072. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  3073. VERIFY( m_bmpRibbonDDA.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_DDA_R1) ) );
  3074. VERIFY( m_bmpRibbonDDA.Make32() );
  3075. m_bmpRibbonDDA.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3076. VERIFY( m_bmpArrRibbonComboBoxDropDown.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_COMBO_BOX_BUTTON_R1) ) );
  3077. // tool buttons 2007
  3078. m_nHeightOfButtonLSM = 66;
  3079. // tool buttons 2007
  3080. m_arrIndicesButtonTS[INT(__E07BI_NORMAL)] = 0;
  3081. m_arrIndicesButtonTS[INT(__E07BI_HOVER)] = 3;
  3082. m_arrIndicesButtonTS[INT(__E07BI_PRESSED)] = 2;
  3083. m_arrIndicesButtonTS[INT(__E07BI_HDD)] = 0;
  3084. m_arrIndicesButtonTS[INT(__E07BI_SEL_T)] = 1;
  3085. m_arrIndicesButtonTS[INT(__E07BI_INDETERMINATE)] = 0;
  3086. m_arrIndicesButtonSS_Left[INT(__E07BI_NORMAL)] = -1;
  3087. m_arrIndicesButtonSS_Left[INT(__E07BI_HOVER)] = 0;
  3088. m_arrIndicesButtonSS_Left[INT(__E07BI_PRESSED)] = 1;
  3089. m_arrIndicesButtonSS_Left[INT(__E07BI_HDD)] = 2;
  3090. m_arrIndicesButtonSS_Left[INT(__E07BI_SEL_T)] = 3;
  3091. m_arrIndicesButtonSS_Left[INT(__E07BI_INDETERMINATE)] = 4;
  3092. m_arrIndicesButtonSS_Right[INT(__E07BI_NORMAL)] = -1;
  3093. m_arrIndicesButtonSS_Right[INT(__E07BI_HOVER)] = 0;
  3094. m_arrIndicesButtonSS_Right[INT(__E07BI_PRESSED)] = 1;
  3095. m_arrIndicesButtonSS_Right[INT(__E07BI_HDD)] = 2;
  3096. m_arrIndicesButtonSS_Right[INT(__E07BI_SEL_T)] = 3;
  3097. m_arrIndicesButtonSS_Right[INT(__E07BI_INDETERMINATE)] = -1;
  3098. m_arrIndicesButtonLSM[INT(__E07BI_NORMAL)] = -1;
  3099. m_arrIndicesButtonLSM[INT(__E07BI_HOVER)] = 0;
  3100. m_arrIndicesButtonLSM[INT(__E07BI_PRESSED)] = 1;
  3101. m_arrIndicesButtonLSM[INT(__E07BI_HDD)] = 2;
  3102. m_arrIndicesButtonLSM[INT(__E07BI_SEL_T)] = 0;
  3103. m_arrIndicesButtonLSM[INT(__E07BIX_INDETERMINATE)] = 0;
  3104. // m_arrIndicesButtonLSB[INT(__E07BI_NORMAL)] = -1;
  3105. // m_arrIndicesButtonLSB[INT(__E07BI_HOVER)] = 0;
  3106. // m_arrIndicesButtonLSB[INT(__E07BI_PRESSED)] = 1;
  3107. // m_arrIndicesButtonLSB[INT(__E07BI_HDD)] = 4;
  3108. // m_arrIndicesButtonLSB[INT(__E07BI_SEL_T)] = 0;
  3109. // m_arrIndicesButtonLSB[INT(__E07BI_INDETERMINATE)] = 0;
  3110. m_arrIndicesButtonLSXM[INT(__E07BIX_NORMAL)] = -1;
  3111. m_arrIndicesButtonLSXM[INT(__E07BIX_HOVER)] = 0;
  3112. m_arrIndicesButtonLSXM[INT(__E07BIX_HOVER2)] = 6;
  3113. m_arrIndicesButtonLSXM[INT(__E07BIX_PRESSED)] = 1;
  3114. m_arrIndicesButtonLSXM[INT(__E07BIX_PRESSED2)] = 2;
  3115. m_arrIndicesButtonLSXM[INT(__E07BIX_PRESSED3)] = 3;
  3116. m_arrIndicesButtonLSXM[INT(__E07BIX_INDETERMINATE)] = 5;
  3117. m_arrIndicesButtonLSXM[INT(__E07BIX_SELECTED)] = 6;
  3118. m_arrIndicesButtonLSXB[INT(__E07BIX_NORMAL)] = -1;
  3119. m_arrIndicesButtonLSXB[INT(__E07BIX_HOVER)] = 0;
  3120. m_arrIndicesButtonLSXB[INT(__E07BIX_HOVER2)] = 5;
  3121. m_arrIndicesButtonLSXB[INT(__E07BIX_PRESSED)] = 1;
  3122. m_arrIndicesButtonLSXB[INT(__E07BIX_PRESSED2)] = 2;
  3123. m_arrIndicesButtonLSXB[INT(__E07BIX_PRESSED3)] = 2;
  3124. m_arrIndicesButtonLSXB[INT(__E07BIX_INDETERMINATE)] = 4;
  3125. m_arrIndicesButtonLSXB[INT(__E07BIX_SELECTED)] = 5;
  3126. VERIFY(
  3127. m_bmpArrButtonTS[INT(__EBTSA_SOLID)].LoadBMP_Resource(
  3128. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_TB_SOLID_R1)
  3129. )
  3130. );
  3131. //m_bmpArrButtonTS[INT(__EBTSA_SOLID)].PreMultipliedRGBChannelsSet( true );
  3132. VERIFY(
  3133. m_bmpArrButtonTS[INT(__EBTSA_LEFT)].LoadBMP_Resource(
  3134. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_TB_LEFT_R1)
  3135. )
  3136. );
  3137. //m_bmpArrButtonTS[INT(__EBTSA_LEFT)].PreMultipliedRGBChannelsSet( true );
  3138. VERIFY(
  3139. m_bmpArrButtonTS[INT(__EBTSA_MIDDLE)].LoadBMP_Resource(
  3140. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_TB_MIDDLE_R1)
  3141. )
  3142. );
  3143. //m_bmpArrButtonTS[INT(__EBTSA_MIDDLE)].PreMultipliedRGBChannelsSet( true );
  3144. VERIFY(
  3145. m_bmpArrButtonTS[INT(__EBTSA_RIGHT)].LoadBMP_Resource(
  3146. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_TB_RIGHT_R1)
  3147. )
  3148. );
  3149. //m_bmpArrButtonTS[INT(__EBTSA_RIGHT)].PreMultipliedRGBChannelsSet( true );
  3150. VERIFY(
  3151. m_bmpArrButtonSS_DD[INT(__EBSSA_LEFT)].LoadBMP_Resource(
  3152. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_SMALL_LEFT_R1)
  3153. )
  3154. );
  3155. //m_bmpArrButtonSS_DD[INT(__EBSSA_LEFT)].PreMultipliedRGBChannelsSet( true );
  3156. VERIFY(
  3157. m_bmpArrButtonSS_DD[INT(__EBSSA_RIGHT)].LoadBMP_Resource(
  3158. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_SMALL_RIGHT_R1)
  3159. )
  3160. );
  3161. //m_bmpArrButtonSS_DD[INT(__EBSSA_RIGHT)].PreMultipliedRGBChannelsSet( true );
  3162. m_bmpArrButtonSS_simple = m_bmpArrButtonSS_DD[ INT(__EBSSA_LEFT) ];
  3163. if( ! m_bmpArrButtonSS_simple.IsEmpty() )
  3164. {
  3165. CSize _sizeBmp = m_bmpArrButtonSS_simple.GetSize();
  3166. INT nY = 0, nXRange = _sizeBmp.cx / 2;
  3167. for( ; nY < _sizeBmp.cy; nY ++ )
  3168. {
  3169. INT nXSrc = nXRange - 1, nXDst = _sizeBmp.cx - nXRange;
  3170. for( ; nXDst < _sizeBmp.cx; nXDst ++, nXSrc -- )
  3171. {
  3172. RGBQUAD _pixel;
  3173. VERIFY( m_bmpArrButtonSS_simple.GetPixel( nXSrc, nY, _pixel ) );
  3174. VERIFY( m_bmpArrButtonSS_simple.SetPixel( nXDst, nY, _pixel ) );
  3175. } // for( ; nXDst < _sizeBmp.cx; nXDst ++, nXSrc -- )
  3176. } // for( ; nY < _sizeBmp.cy; nY ++ )
  3177. } // if( m_bmpArrButtonSS_simple.IsEmpty() )
  3178. VERIFY(
  3179. m_bmpArrButtonLSM.LoadBMP_Resource(
  3180. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_ALL_R1) // IDB_EXT_2007_RIBBON_BTN_PART_LARGE_TOP_R1
  3181. )
  3182. );
  3183. // m_bmpArrButtonLSM.PreMultipliedRGBChannelsSet( true );
  3184. // VERIFY(
  3185. // m_bmpArrButtonLSB.LoadBMP_Resource(
  3186. // MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_BOTTOM_R1)
  3187. // )
  3188. // );
  3189. // m_bmpArrButtonLSB.PreMultipliedRGBChannelsSet( true );
  3190. VERIFY(
  3191. m_bmpArrButtonLSXM.LoadBMP_Resource(
  3192. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_TOP_R1)
  3193. )
  3194. );
  3195. // m_bmpArrButtonLSXM.PreMultipliedRGBChannelsSet( true );
  3196. VERIFY(
  3197. m_bmpArrButtonLSXB.LoadBMP_Resource(
  3198. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_BOTTOM_R1)
  3199. )
  3200. );
  3201. // m_bmpArrButtonLSXB.PreMultipliedRGBChannelsSet( true );
  3202. VERIFY(
  3203. m_bmpToolBtnSeparator[INT(__ETBS_HOVER)].LoadBMP_Resource(
  3204. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_TB_SEPARATOR_HOVER_R1)
  3205. )
  3206. );
  3207. m_bmpToolBtnSeparator[INT(__ETBS_HOVER)].Make32();
  3208. m_bmpToolBtnSeparator[INT(__ETBS_HOVER)].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3209. VERIFY(
  3210. m_bmpToolBtnSeparator[INT(__ETBS_PRESSED)].LoadBMP_Resource(
  3211. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_TB_SEPARATOR_PRESSED_R1)
  3212. )
  3213. );
  3214. m_bmpToolBtnSeparator[INT(__ETBS_PRESSED)].Make32();
  3215. m_bmpToolBtnSeparator[INT(__ETBS_PRESSED)].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3216. VERIFY(
  3217. m_bmpLargeBtnSeparator[INT(__ELBS_HOVER)].LoadBMP_Resource(
  3218. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_SEPARATOR_HOVER_R1)
  3219. )
  3220. );
  3221. m_bmpLargeBtnSeparator[INT(__ELBS_HOVER)].Make32();
  3222. m_bmpLargeBtnSeparator[INT(__ELBS_HOVER)].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3223. VERIFY(
  3224. m_bmpLargeBtnSeparator[INT(__ELBS_PRESSED)].LoadBMP_Resource(
  3225. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_SEPARATOR_PRESSED_R1)
  3226. )
  3227. );
  3228. m_bmpLargeBtnSeparator[INT(__ELBS_PRESSED)].Make32();
  3229. m_bmpLargeBtnSeparator[INT(__ELBS_PRESSED)].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3230. m_clrRibbonModeMenuTextNormal = RGB(0,0,128);
  3231. VERIFY(
  3232. m_bmpRibbonModeMenuBorder.LoadBMP_Resource(
  3233. MAKEINTRESOURCE(IDB_EXT_2007_MENU_BORDER_R1)
  3234. )
  3235. );
  3236. m_bmpRibbonModeMenuBorder.Make32();
  3237. m_bmpRibbonModeMenuBorder.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3238. m_clrMenuCaptionText = RGB(0,0,128);;
  3239. m_rcMenuCaptionBmpPadding.SetRect( 0, 2, 0, 2 );
  3240. VERIFY(
  3241. m_bmpMenuCaptionBk.LoadBMP_Resource(
  3242. MAKEINTRESOURCE(IDB_EXT_2007_MENU_CAPTION_BK_R1)
  3243. )
  3244. );
  3245. m_rcPaddingRibbonFileMenuBigBorder.SetRect( 8, 8, 8, 26 );
  3246. VERIFY( m_bmpRibbonFileMenuBigBorder.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RM_BIG_BORDER_R1) ) );
  3247. m_bmpRibbonFileMenuBigBorder.Make32();
  3248. m_bmpRibbonFileMenuBigBorder.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3249. m_rcPaddingRibbonFileMenuOptionsButton.SetRect( 2, 2, 2, 2 );
  3250. // VERIFY(
  3251. // m_bmpRibbonFileMenuOptionsButtonCold.LoadBMP_Resource(
  3252. // MAKEINTRESOURCE(IDB_EXT_2007_RM_OPTION_COLD_R1)
  3253. // )
  3254. // );
  3255. // m_bmpRibbonFileMenuOptionsButtonCold.Make32();
  3256. // m_bmpRibbonFileMenuOptionsButtonCold.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3257. VERIFY(
  3258. m_bmpRibbonFileMenuOptionsButtonHot.LoadBMP_Resource(
  3259. MAKEINTRESOURCE(IDB_EXT_2007_RM_OPTION_HOT_R1)
  3260. )
  3261. );
  3262. m_bmpRibbonFileMenuOptionsButtonHot.Make32();
  3263. m_bmpRibbonFileMenuOptionsButtonHot.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3264. VERIFY( m_bmpResizingGripper.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_RESIZING_GRIPPER_R1) ) );
  3265. m_bmpResizingGripper.Make32();
  3266. m_bmpResizingGripper.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3267. // spin bitmaps
  3268. VERIFY( m_arrBmpSpinArrowDown. LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_SPIN_ARROW_DOWN_R1) ) );
  3269. VERIFY( m_arrBmpSpinArrowUp. LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_SPIN_ARROW_UP_R1) ) );
  3270. VERIFY( m_arrBmpSpinDown. LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_SPIN_DOWN_R1) ) );
  3271. VERIFY( m_arrBmpSpinUp. LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_SPIN_UP_R1) ) );
  3272. }
  3273. CExtPaintManagerOffice2007_R1::~CExtPaintManagerOffice2007_R1()
  3274. {
  3275. }
  3276. CExtPaintManagerOffice2010_Impl::CExtPaintManagerOffice2010_Impl()
  3277. {
  3278. #if (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  3279. m_bPnPaneCaptFontBold = false;
  3280. m_strPnPaneCaptCustomFontFaceName = _T("");
  3281. #endif // (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  3282. }
  3283. CExtPaintManagerOffice2010_Impl::~CExtPaintManagerOffice2010_Impl()
  3284. {
  3285. }
  3286. CExtPaintManagerOffice2010_R1::CExtPaintManagerOffice2010_R1()
  3287. {
  3288. m_bThemedMenuItemsEverywhere = true;
  3289. m_clrFillHint = RGB(205,205,205);
  3290. m_clrAccentHint = RGB(255,227,140); // RGB(156,193,234);
  3291. m_clrIconAlphaColor = RGB(114,121,138);
  3292. m_clrAdvTipGradientBottom = RGB(229,229,240);
  3293. VERIFY( m_arrMdiRightIcons[0].m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_MDI_ICON_SC_MINIMIZE) ) );
  3294. VERIFY( m_arrMdiRightIcons[1].m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_MDI_ICON_SC_RESTORE) ) );
  3295. VERIFY( m_arrMdiRightIcons[2].m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_MDI_ICON_SC_CLOSE) ) );
  3296. // m_clrDCA1 = RGB(172,180,198);
  3297. // m_clrDCA2 = RGB(113,125,152);
  3298. // m_clrDCA3 = RGB(132,141,166);
  3299. // m_bDocumentClientAreaBkgndR2 = false;
  3300. // VERIFY( m_bmpDCA.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_DCA_R1) ) );
  3301. // m_bmpDCA.PreMultiplyRGBChannels();
  3302. // m_bmpDCA.PreMultipliedRGBChannelsSet( true );
  3303. m_clrDCA_Solid = RGB(220,226,232);
  3304. m_bUseNcFrameBmpForDockerBkgnd = true;
  3305. m_clrCustomDropDownGlyphEnabled = RGB(0,0,0);
  3306. m_clrCustomDropDownGlyphDisabled = RGB(141,141,141);
  3307. m_clrDockingFrameDark = m_clrFloatingToolbarGripperSolid = RGB(83,96,125);
  3308. m_clrDockingFrameCaptionTextActive = RGB(51,51,51);
  3309. m_clrDockingFrameCaptionTextInactive = RGB(51,51,51);
  3310. m_clrDockingFrameCaptionTextFloatingFixed =  RGB(255,255,255);
  3311. m_clrDockingCaptionShapeFixedNormal =  RGB(255,255,255);
  3312. m_rcNcFrameBordersActive.SetRect( 3, 4, 3, 2 );
  3313. m_rcNcFrameBordersInactive.SetRect( 3, 4, 3, 2 );
  3314. m_nCaptionHeightActive = m_nCaptionHeightInactive = 26;
  3315. VERIFY( m_bmpNcFrameActive.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_FRAME_ACTIVE_R1) ) );
  3316. VERIFY( m_bmpNcFrameInactive.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_FRAME_INACTIVE_R1) ) );
  3317. VERIFY( m_bmpNcFrameActive.Make32() );
  3318. VERIFY( m_bmpNcFrameInactive.Make32() );
  3319. m_bmpNcFrameActive.AlphaColor( m_clrTransparentNcFrameActive, RGB(0,0,0), 0 );
  3320. m_bmpNcFrameInactive.AlphaColor( m_clrTransparentNcFrameInactive, RGB(0,0,0), 0 );
  3321. m_clrNcFrameTextActive = RGB(69,69,69); // = RGB(123,123,123);
  3322. m_clrNcFrameTextInactive = RGB(163,163,163); // = RGB(183,183,183);
  3323. m_bmpNcFrameActive.PreMultiplyRGBChannels();
  3324. m_bmpNcFrameActive.PreMultipliedRGBChannelsSet( true );
  3325. m_bmpNcFrameInactive.PreMultiplyRGBChannels();
  3326. m_bmpNcFrameInactive.PreMultipliedRGBChannelsSet( true );
  3327. m_sizeNcButtonShapeInArr.cx = m_sizeNcButtonShapeInArr.cy = 21;
  3328. m_nNcBtnIdxNormalActive = m_nNcBtnIdxNormalInactive = 0;
  3329. m_rcNcButtonBkPadding.SetRect( 4, 4, 4, 4 );
  3330. VERIFY( m_bmpNcButtonBkHover.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_BUTTON_BK_HOVER_R1) ) );
  3331. VERIFY( m_bmpNcButtonBkPressed.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_BUTTON_BK_PRESSED_R1) ) );
  3332. VERIFY( m_bmpNcButtonBkHover.Make32() );
  3333. VERIFY( m_bmpNcButtonBkPressed.Make32() );
  3334. m_bmpNcButtonBkHover.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3335. m_bmpNcButtonBkPressed.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3336. m_bmpNcButtonBkHover.PreMultiplyRGBChannels();
  3337. m_bmpNcButtonBkHover.PreMultipliedRGBChannelsSet( true );
  3338. m_bmpNcButtonBkPressed.PreMultiplyRGBChannels();
  3339. m_bmpNcButtonBkPressed.PreMultipliedRGBChannelsSet( true );
  3340. VERIFY( m_bmpNcButtonBkHoverX.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_BUTTON_BK_HOVER_R1_X) ) );
  3341. VERIFY( m_bmpNcButtonBkPressedX.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_BUTTON_BK_PRESSED_R1_X) ) );
  3342. VERIFY( m_bmpNcButtonBkHoverX.Make32() );
  3343. VERIFY( m_bmpNcButtonBkPressedX.Make32() );
  3344. m_bmpNcButtonBkHoverX.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3345. m_bmpNcButtonBkPressedX.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3346. m_bmpNcButtonBkHoverX.PreMultiplyRGBChannels();
  3347. m_bmpNcButtonBkHoverX.PreMultipliedRGBChannelsSet( true );
  3348. m_bmpNcButtonBkPressedX.PreMultiplyRGBChannels();
  3349. m_bmpNcButtonBkPressedX.PreMultipliedRGBChannelsSet( true );
  3350. m_sizeNcButtonShapeInArr.cx = 13;
  3351. m_sizeNcButtonShapeInArr.cy = 12;
  3352. m_nNcBtnIdxNormalActive = 0;
  3353. m_nNcBtnIdxHover = 1;
  3354. m_nNcBtnIdxPressed = 2;
  3355. m_nNcBtnIdxNormalInactive = 3;
  3356. m_nNcBtnIdxDisabled = 4;
  3357. VERIFY( m_bmpArrNcButtonsClose.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_ARR_CLOSE_R1) ) );
  3358. // m_bmpArrNcButtonsClose.PreMultiplyRGBChannels();
  3359. m_bmpArrNcButtonsClose.PreMultipliedRGBChannelsSet( true );
  3360. VERIFY( m_bmpArrNcButtonsMaximize.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_ARR_MAXIMIZE_R1) ) );
  3361. // m_bmpArrNcButtonsMaximize.PreMultiplyRGBChannels();
  3362. m_bmpArrNcButtonsMaximize.PreMultipliedRGBChannelsSet( true );
  3363. VERIFY( m_bmpArrNcButtonsRestore.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_ARR_RESTORE_R1) ) );
  3364. // m_bmpArrNcButtonsRestore.PreMultiplyRGBChannels();
  3365. m_bmpArrNcButtonsRestore.PreMultipliedRGBChannelsSet( true );
  3366. VERIFY( m_bmpArrNcButtonsMinimize.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_ARR_MINIMIZE_R1) ) );
  3367. // m_bmpArrNcButtonsMinimize.PreMultiplyRGBChannels();
  3368. m_bmpArrNcButtonsMinimize.PreMultipliedRGBChannelsSet( true );
  3369. VERIFY( m_bmpArrNcButtonsHelp.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_NC_ARR_HELP_R1) ) );
  3370. m_bmpArrNcButtonsHelp.PreMultiplyRGBChannels();
  3371. #if (!defined __EXT_MFC_NO_STATUSBAR)
  3372. m_rcStatusBkPadding.SetRect( 2, 2, 2, 2 );
  3373. VERIFY( m_bmpStatusBkLight.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_STATUSBAR_BK_LIGHT_R1) ) );
  3374. VERIFY( m_bmpStatusBkDark.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_STATUSBAR_BK_DARK_R1) ) );
  3375. m_rcStatusSeparatorPadding.SetRect( 0, 2, 0, 2 );
  3376. VERIFY( m_bmpStatusSeparator.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_STATUSBAR_SEPARATOR_R1) ) );
  3377. #endif // (!defined __EXT_MFC_NO_STATUSBAR)
  3378. #if (!defined __EXT_MFC_NO_TAB_CTRL)
  3379. m_clrTabTextNormal = m_clrTabTextSelected = RGB( 52, 52, 64 );
  3380. m_clrTabTextNormalDWM = m_clrTabTextSelectedDWM = RGB( 76, 83, 92 );
  3381. m_nIdxTabShapeHover = 1;
  3382. m_nIdxTabShapePressed = 0;
  3383. m_nIdxTabShapeSelected = 0;
  3384. m_nIdxTabShapeSelectedHover = 0;
  3385. m_arrSizeTabShape[__ETSOI_TOP].cx
  3386. = m_arrSizeTabShape[__ETSOI_BOTTOM].cx
  3387. = m_arrSizeTabShape[__ETSOI_LEFT].cy
  3388. = m_arrSizeTabShape[__ETSOI_RIGHT].cy
  3389. = 19;
  3390. m_arrSizeTabShape[__ETSOI_TOP].cy
  3391. = m_arrSizeTabShape[__ETSOI_BOTTOM].cy
  3392. = m_arrSizeTabShape[__ETSOI_LEFT].cx
  3393. = m_arrSizeTabShape[__ETSOI_RIGHT].cx
  3394. = 23;
  3395. m_arrRectTabShapePadding[__ETSOI_TOP].SetRect( 4, 3, 4, 3 );
  3396. m_arrRectTabShapePadding[__ETSOI_BOTTOM].SetRect( 4, 3, 4, 3 );
  3397. m_arrRectTabShapePadding[__ETSOI_LEFT].SetRect( 3, 4, 3, 4 );
  3398. m_arrRectTabShapePadding[__ETSOI_RIGHT].SetRect( 3, 4, 3, 4 );
  3399. VERIFY(
  3400. m_arrBmpTabShapeNormal[__ETSOI_TOP].LoadBMP_Resource(
  3401. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_TAB_SHAPE_ARR_R1 )
  3402. )
  3403. );
  3404. VERIFY( m_arrBmpTabShapeNormal[__ETSOI_TOP].Make32() );
  3405. VERIFY(
  3406. m_arrBmpTabShapeNormal[__ETSOI_BOTTOM].CreateRotated9xStack(
  3407. m_arrBmpTabShapeNormal[__ETSOI_TOP],
  3408. 180,
  3409. 4,
  3410. m_arrSizeTabShape[__ETSOI_TOP].cx,
  3411. m_arrSizeTabShape[__ETSOI_TOP].cy,
  3412. false,
  3413. false
  3414. )
  3415. );
  3416. VERIFY(
  3417. m_arrBmpTabShapeNormal[__ETSOI_LEFT].CreateRotated9xStack(
  3418. m_arrBmpTabShapeNormal[__ETSOI_TOP],
  3419. 270,
  3420. 4,
  3421. m_arrSizeTabShape[__ETSOI_TOP].cx,
  3422. m_arrSizeTabShape[__ETSOI_TOP].cy,
  3423. false,
  3424. false
  3425. )
  3426. );
  3427. VERIFY(
  3428. m_arrBmpTabShapeNormal[__ETSOI_RIGHT].CreateRotated9xStack(
  3429. m_arrBmpTabShapeNormal[__ETSOI_TOP],
  3430. 90,
  3431. 4,
  3432. m_arrSizeTabShape[__ETSOI_TOP].cx,
  3433. m_arrSizeTabShape[__ETSOI_TOP].cy,
  3434. false,
  3435. false
  3436. )
  3437. );
  3438. VERIFY(
  3439. m_arrBmpTabShapeSelArea[__ETSOI_TOP].LoadBMP_Resource(
  3440. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_TAB_SHAPE_ARR_SEL_AREA_R1 )
  3441. )
  3442. );
  3443. //VERIFY( m_arrBmpTabShapeSelArea[__ETSOI_TOP].Make32() );
  3444. //m_arrBmpTabShapeSelArea[__ETSOI_TOP].PreMultipliedRGBChannelsSet( true );
  3445. VERIFY(
  3446. m_arrBmpTabShapeSelArea[__ETSOI_BOTTOM].CreateRotated9xStack(
  3447. m_arrBmpTabShapeSelArea[__ETSOI_TOP],
  3448. 180,
  3449. 4,
  3450. m_arrSizeTabShape[__ETSOI_TOP].cx,
  3451. m_arrSizeTabShape[__ETSOI_TOP].cy,
  3452. false,
  3453. false
  3454. )
  3455. );
  3456. //m_arrBmpTabShapeSelArea[__ETSOI_BOTTOM].PreMultipliedRGBChannelsSet( true );
  3457. VERIFY(
  3458. m_arrBmpTabShapeSelArea[__ETSOI_LEFT].CreateRotated9xStack(
  3459. m_arrBmpTabShapeSelArea[__ETSOI_TOP],
  3460. 270,
  3461. 4,
  3462. m_arrSizeTabShape[__ETSOI_TOP].cx,
  3463. m_arrSizeTabShape[__ETSOI_TOP].cy,
  3464. false,
  3465. false
  3466. )
  3467. );
  3468. //m_arrBmpTabShapeSelArea[__ETSOI_LEFT].PreMultipliedRGBChannelsSet( true );
  3469. VERIFY(
  3470. m_arrBmpTabShapeSelArea[__ETSOI_RIGHT].CreateRotated9xStack(
  3471. m_arrBmpTabShapeSelArea[__ETSOI_TOP],
  3472. 90,
  3473. 4,
  3474. m_arrSizeTabShape[__ETSOI_TOP].cx,
  3475. m_arrSizeTabShape[__ETSOI_TOP].cy,
  3476. false,
  3477. false
  3478. )
  3479. );
  3480. //m_arrBmpTabShapeSelArea[__ETSOI_RIGHT].PreMultipliedRGBChannelsSet( true );
  3481. m_arrRectTabAreaPadding[__ETSOI_TOP].SetRect( 3, 3, 3, 3 );
  3482. m_arrRectTabAreaPadding[__ETSOI_BOTTOM].SetRect( 3, 3, 3, 3 );
  3483. m_arrRectTabAreaPadding[__ETSOI_LEFT].SetRect( 3, 3, 3, 3 );
  3484. m_arrRectTabAreaPadding[__ETSOI_RIGHT].SetRect( 3, 3, 3, 3 );
  3485. m_arrTabAreaMargins[__ETSOI_TOP] = 1;
  3486. m_arrTabAreaMargins[__ETSOI_BOTTOM] = 1;
  3487. m_arrTabAreaMargins[__ETSOI_LEFT] = 1;
  3488. m_arrTabAreaMargins[__ETSOI_RIGHT] = 1;
  3489. m_arrSizeTabSeparator[__ETSOI_TOP].cx
  3490. = m_arrSizeTabSeparator[__ETSOI_BOTTOM].cx
  3491. = m_arrSizeTabSeparator[__ETSOI_LEFT].cy
  3492. = m_arrSizeTabSeparator[__ETSOI_RIGHT].cy
  3493. = 2;
  3494. m_arrSizeTabSeparator[__ETSOI_TOP].cy
  3495. = m_arrSizeTabSeparator[__ETSOI_BOTTOM].cy
  3496. = m_arrSizeTabSeparator[__ETSOI_LEFT].cx
  3497. = m_arrSizeTabSeparator[__ETSOI_RIGHT].cx
  3498. = 23;
  3499. m_arrRectTabSeparatorPadding[__ETSOI_TOP].SetRect( 0, 2, 0, 2 );
  3500. m_arrRectTabSeparatorPadding[__ETSOI_BOTTOM].SetRect( 0, 2, 0, 2 );
  3501. m_arrRectTabSeparatorPadding[__ETSOI_LEFT].SetRect( 2, 0, 2, 0 );
  3502. m_arrRectTabSeparatorPadding[__ETSOI_RIGHT].SetRect( 2, 0, 2, 0 );
  3503. VERIFY(
  3504. m_arrBmpTabSeparator[__ETSOI_TOP].LoadBMP_Resource(
  3505. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_TAB_SEPARATOR_R1 )
  3506. )
  3507. );
  3508. VERIFY( m_arrBmpTabSeparator[__ETSOI_TOP].Make32() );
  3509. m_arrBmpTabSeparator[__ETSOI_TOP].PreMultiplyRGBChannels();
  3510. m_arrBmpTabSeparator[__ETSOI_TOP].PreMultipliedRGBChannelsSet( true );
  3511. VERIFY(
  3512. m_arrBmpTabSeparator[__ETSOI_BOTTOM].CreateRotated9xStack(
  3513. m_arrBmpTabSeparator[__ETSOI_TOP],
  3514. 180,
  3515. 1,
  3516. m_arrSizeTabSeparator[__ETSOI_TOP].cx,
  3517. m_arrSizeTabSeparator[__ETSOI_TOP].cy,
  3518. false,
  3519. false
  3520. )
  3521. );
  3522. VERIFY(
  3523. m_arrBmpTabSeparator[__ETSOI_LEFT].CreateRotated9xStack(
  3524. m_arrBmpTabSeparator[__ETSOI_TOP],
  3525. 270,
  3526. 1,
  3527. m_arrSizeTabSeparator[__ETSOI_TOP].cx,
  3528. m_arrSizeTabSeparator[__ETSOI_TOP].cy,
  3529. false,
  3530. false
  3531. )
  3532. );
  3533. VERIFY(
  3534. m_arrBmpTabSeparator[__ETSOI_RIGHT].CreateRotated9xStack(
  3535. m_arrBmpTabSeparator[__ETSOI_TOP],
  3536. 90,
  3537. 1,
  3538. m_arrSizeTabSeparator[__ETSOI_TOP].cx,
  3539. m_arrSizeTabSeparator[__ETSOI_TOP].cy,
  3540. false,
  3541. false
  3542. )
  3543. );
  3544. #endif // (!defined __EXT_MFC_NO_TAB_CTRL)
  3545. VERIFY(
  3546. m_bmpArrStatesCheckBox.LoadBMP_Resource(
  3547. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_CHECK_BOX_R1 )
  3548. )
  3549. );
  3550. VERIFY(
  3551. m_bmpArrStatesRadioButton.LoadBMP_Resource(
  3552. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_RADIO_BUTTON_R1 )
  3553. )
  3554. );
  3555. m_clrMenuItemLeftAreaMarginL = RGB(226, 228, 231);
  3556. m_clrMenuItemLeftAreaMarginR = RGB(245, 245, 245);
  3557. m_rcMenuItemPaddingLargeLeft.SetRect(  3, 3, 3, 16 );
  3558. m_rcMenuItemPaddingLargeRight.SetRect( 1, 3, 3, 16 );
  3559. m_rcMenuItemPaddingSmallLeft.SetRect(  3, 3, 3, 10 );
  3560. m_rcMenuItemPaddingSmallRight.SetRect( 1, 3, 3, 10 );
  3561. VERIFY(
  3562. m_bmpMenuItemLargeLeft.LoadBMP_Resource(
  3563. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_ITEM_R1_LARGE_LEFT )
  3564. )
  3565. );
  3566. VERIFY(
  3567. m_bmpMenuItemLargeRight.LoadBMP_Resource(
  3568. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_ITEM_R1_LARGE_RIGHT )
  3569. )
  3570. );
  3571. VERIFY(
  3572. m_bmpMenuItemSmallLeft.LoadBMP_Resource(
  3573. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_ITEM_R1_SMALL_LEFT )
  3574. )
  3575. );
  3576. VERIFY(
  3577. m_bmpMenuItemSmallRight.LoadBMP_Resource(
  3578. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_ITEM_R1_SMALL_RIGHT )
  3579. )
  3580. );
  3581. VERIFY(
  3582. m_bmpMenuArrow.LoadBMP_Resource(
  3583. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_ITEM_ARROW )
  3584. )
  3585. );
  3586. m_sizeMenuCheckAreaChecked.cx = 16;
  3587. m_sizeMenuCheckAreaChecked.cy = 16;
  3588. m_sizeMenuCheckAreaUnchecked.cx = 20;
  3589. m_sizeMenuCheckAreaUnchecked.cy = 20;
  3590. m_arrRectMenuCheckAreaCheckedPadding[0].SetRect( 1, 1, 1, 1 );
  3591. m_arrRectMenuCheckAreaCheckedPadding[1].SetRect( 1, 1, 1, 1 );
  3592. m_arrRectMenuCheckAreaUncheckedPadding[0].SetRect( 1, 1, 1, 1 );
  3593. m_arrRectMenuCheckAreaUncheckedPadding[1].SetRect( 1, 1, 1, 1 );
  3594. VERIFY( m_bmpMenuCheckAreaChecked.LoadBMP_Resource(   MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_CHECK_AREA_CHECKED_R1   ) ) );
  3595. VERIFY( m_bmpMenuCheckAreaUnchecked.LoadBMP_Resource( MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_MENU_CHECK_AREA_UNCHECKED_R1 ) ) );
  3596. #if (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  3597. m_arrClrPnCaptNormal[0]  = RGB(235,238,250);
  3598. m_arrClrPnCaptNormal[1]  = RGB(215,219,229);
  3599. m_arrClrPnCaptNormal[2]  = RGB(197,199,209);
  3600. m_arrClrPnCaptNormal[3]  = RGB(212,216,226);
  3601. m_arrClrPnSplitter[0]    = RGB( 240, 243, 247 );
  3602. m_arrClrPnSplitter[1]    = RGB( 215, 219, 225 );
  3603. m_clrPnCaptText  = RGB( 30, 57, 91 );
  3604. m_arrClrPnItemText[0]    = RGB(0,0,0);
  3605. m_arrClrPnItemText[1]    = RGB(76,83,92);
  3606. m_clrPnConfigButton  = RGB(101,104,112);
  3607. static const UINT g_arrResIdPnItemExpanded[ePn_Count] =
  3608. {
  3609. IDB_EXT_2010_OFFICE_PN_ITEM_EXPANDED_NORMAL_R1,
  3610. IDB_EXT_2010_OFFICE_PN_ITEM_EXPANDED_HOVER_R1,
  3611. IDB_EXT_2010_OFFICE_PN_ITEM_EXPANDED_PRESSED_R1,
  3612. IDB_EXT_2010_OFFICE_PN_ITEM_EXPANDED_SELECTED_R1,
  3613. IDB_EXT_2010_OFFICE_PN_ITEM_EXPANDED_SELECTED_HOVER_R1,
  3614. };
  3615. static const UINT g_arrResIdPnItemCollapsed[ePn_Count] =
  3616. {
  3617. IDB_EXT_2010_OFFICE_PN_ITEM_COLLAPSED_NORMAL_R1,
  3618. IDB_EXT_2010_OFFICE_PN_ITEM_COLLAPSED_HOVER_R1,
  3619. IDB_EXT_2010_OFFICE_PN_ITEM_COLLAPSED_PRESSED_R1,
  3620. IDB_EXT_2010_OFFICE_PN_ITEM_COLLAPSED_SELECTED_R1,
  3621. IDB_EXT_2010_OFFICE_PN_ITEM_COLLAPSED_SELECTED_HOVER_R1,
  3622. };
  3623. INT nPnIndex;
  3624. for( nPnIndex = 0; nPnIndex < INT(ePn_Count); nPnIndex ++ )
  3625. {
  3626. VERIFY( m_arrBmpPnItemExpanded[nPnIndex].LoadBMP_Resource( MAKEINTRESOURCE(g_arrResIdPnItemExpanded[nPnIndex]) ) );
  3627. VERIFY( m_arrBmpPnItemCollapsed[nPnIndex].LoadBMP_Resource( MAKEINTRESOURCE(g_arrResIdPnItemCollapsed[nPnIndex]) ) );
  3628. m_arrRcPnItemPaddingExpanded[nPnIndex].SetRect( 0, 2, 0, 2 );
  3629. m_arrRcPnItemPaddingCollapsed[nPnIndex].SetRect( 0, 0, 0, 0 );
  3630. m_arrClrPnItemTextBmpVer[nPnIndex] = RGB(0,0,0);
  3631. }
  3632. #endif // (!defined __EXT_MFC_NO_PAGE_NAVIGATOR )
  3633. VERIFY( m_bmpArrComboBoxDropDown.LoadBMP_Resource( MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_COMBO_BOX_BUTTON_R1 ) ) );
  3634. m_bmpArrComboBoxDropDown.PreMultipliedRGBChannelsSet( true );
  3635. m_arrClrComboBoxBorder[0] = RGB(212,214,217);
  3636. m_arrClrComboBoxBorder[1] = RGB(180,180,180);
  3637. m_arrClrComboBoxBorder[2] = RGB(212,214,217);
  3638. m_arrClrComboBoxBorder[3] = RGB(228,231,235);
  3639. CRect SbSkinDataPaddingH( 5, 3, 5, 3 ), SbSkinDataPaddingV( 3, 5, 3, 5 );
  3640. CRect rcEntirePaddingRH( 2, 2, 2, 2 ), rcEntirePaddingRV( 2, 2, 2, 2 );
  3641. CRect rcEntirePaddingCH( 1, 1, 1, 1 ), rcEntirePaddingCV( 1, 1, 1, 1 );
  3642. m_SbSkinDataT_Zoom.Load2010_Zoom_R1(
  3643. IDB_EXT_2010_OFFICE_ZS_PLUS_R1, IDB_EXT_2010_OFFICE_ZS_MINUS_R1, IDB_EXT_2010_OFFICE_ZS_THUMB_R1,
  3644. RGB(204,204,204), RGB(37,37,37), RGB(204,204,204), RGB(37,37,37), AFX_IDW_DOCKBAR_TOP
  3645. );
  3646. m_SbSkinDataB_Zoom.Load2010_Zoom_R1(
  3647. IDB_EXT_2010_OFFICE_ZS_PLUS_R1, IDB_EXT_2010_OFFICE_ZS_MINUS_R1, IDB_EXT_2010_OFFICE_ZS_THUMB_R1,
  3648. RGB(204,204,204), RGB(37,37,37), RGB(204,204,204), RGB(37,37,37), AFX_IDW_DOCKBAR_BOTTOM
  3649. );
  3650. m_SbSkinDataL_Zoom.Load2010_Zoom_R1(
  3651. IDB_EXT_2010_OFFICE_ZS_PLUS_R1, IDB_EXT_2010_OFFICE_ZS_MINUS_R1, IDB_EXT_2010_OFFICE_ZS_THUMB_R1,
  3652. RGB(204,204,204), RGB(37,37,37), RGB(204,204,204), RGB(37,37,37), AFX_IDW_DOCKBAR_LEFT
  3653. );
  3654. m_SbSkinDataR_Zoom.Load2010_Zoom_R1(
  3655. IDB_EXT_2010_OFFICE_ZS_PLUS_R1, IDB_EXT_2010_OFFICE_ZS_MINUS_R1, IDB_EXT_2010_OFFICE_ZS_THUMB_R1,
  3656. RGB(204,204,204), RGB(37,37,37), RGB(204,204,204), RGB(37,37,37), AFX_IDW_DOCKBAR_RIGHT
  3657. );
  3658. m_SbSkinDataH_Light.Load2007_R1(
  3659. IDB_EXT_2010_OFFICE_SCROLL_BAR_STACK_BUTTONS_R1_HORZ_LIGHT,
  3660. 15,
  3661. IDB_EXT_2010_OFFICE_SCROLL_BAR_GRIPPER_R1_HORZ,
  3662. SbSkinDataPaddingH,
  3663. COLORREF(-1L),
  3664. COLORREF(-1L),
  3665. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  3666. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  3667. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  3668. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  3669. true,
  3670. IDB_EXT_2010_OFFICE_SCROLL_BAR_ENTIRE_BK_R1_LIGHT,
  3671. IDB_EXT_2010_OFFICE_SCROLL_BAR_PAGE_BK_R1_LIGHT,
  3672. rcEntirePaddingRH,
  3673. rcEntirePaddingCH
  3674. );
  3675. m_SbSkinDataV_Light.Load2007_R1(
  3676. IDB_EXT_2010_OFFICE_SCROLL_BAR_STACK_BUTTONS_R1_VERT_LIGHT,
  3677. 17,
  3678. IDB_EXT_2010_OFFICE_SCROLL_BAR_GRIPPER_R1_VERT,
  3679. SbSkinDataPaddingV,
  3680. COLORREF(-1L),
  3681. COLORREF(-1L),
  3682. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  3683. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  3684. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  3685. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  3686. false,
  3687. IDB_EXT_2010_OFFICE_SCROLL_BAR_ENTIRE_BK_R1_LIGHT,
  3688. IDB_EXT_2010_OFFICE_SCROLL_BAR_PAGE_BK_R1_LIGHT,
  3689. rcEntirePaddingRV,
  3690. rcEntirePaddingCV
  3691. );
  3692. m_SbSkinDataH_Dark.Load2007_R1(
  3693. IDB_EXT_2010_OFFICE_SCROLL_BAR_STACK_BUTTONS_R1_HORZ_DARK,
  3694. 15,
  3695. IDB_EXT_2010_OFFICE_SCROLL_BAR_GRIPPER_R1_HORZ,
  3696. SbSkinDataPaddingH,
  3697. COLORREF(-1L),
  3698. COLORREF(-1L),
  3699. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  3700. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  3701. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  3702. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  3703. true,
  3704. IDB_EXT_2010_OFFICE_SCROLL_BAR_ENTIRE_BK_R1_DARK,
  3705. IDB_EXT_2010_OFFICE_SCROLL_BAR_PAGE_BK_R1_DARK,
  3706. rcEntirePaddingRH,
  3707. rcEntirePaddingCH
  3708. );
  3709. m_SbSkinDataV_Dark.Load2007_R1(
  3710. IDB_EXT_2010_OFFICE_SCROLL_BAR_STACK_BUTTONS_R1_VERT_DARK,
  3711. 17,
  3712. IDB_EXT_2010_OFFICE_SCROLL_BAR_GRIPPER_R1_VERT,
  3713. SbSkinDataPaddingV,
  3714. COLORREF(-1L),
  3715. COLORREF(-1L),
  3716. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_NORMAL_R1,
  3717. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_UP_DISABLED_R1,
  3718. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_NORMAL_R1,
  3719. IDB_EXT_2010_OFFICE_SCROLL_BAR_ARROW_DOWN_DISABLED_R1,
  3720. false,
  3721. IDB_EXT_2010_OFFICE_SCROLL_BAR_ENTIRE_BK_R1_DARK,
  3722. IDB_EXT_2010_OFFICE_SCROLL_BAR_PAGE_BK_R1_DARK,
  3723. rcEntirePaddingRV,
  3724. rcEntirePaddingCV
  3725. );
  3726. m_clrGridHeaderBkTop     = RGB(253,253,253);
  3727. m_clrGridHeaderBkBottom  = RGB(212,215,220);
  3728. m_clrGridHeaderSeparator = RGB(145,153,164);
  3729. m_clrGridHeaderSortArrow = RGB(145,153,164);
  3730. m_clrGridHeaderBorder    = RGB(145,153,164);
  3731. m_clrRgHeaderBkTop     = RGB(253,253,253);
  3732. m_clrRgHeaderBkBottom  = RGB(212,215,220);
  3733. m_clrRgHeaderSeparator = RGB(145,153,164);
  3734. m_clrRgHeaderSortArrow = RGB(145,153,164);
  3735. m_clrRgHeaderText      = RGB(0,0,0);
  3736. m_clrRgHeaderBorder    = RGB(76,83,92);
  3737. #if (!defined __EXT_MFC_NO_REPORTGRIDWND)
  3738. m_clrRgGroupAreaBk     = RGB(235,235,235);
  3739. m_clrRgGroupAreaText   = RGB(70,70,70);
  3740. #endif // (!defined __EXT_MFC_NO_REPORTGRIDWND)
  3741. m_nPushBtnSimpleGlyphHeightH = 43;
  3742. m_nPushBtnSimpleGlyphHeightV = 43;
  3743. m_nPushBtnSDDLeftGlyphHeightH = 43;
  3744. m_nPushBtnSDDLeftGlyphHeightV = 43;
  3745. m_nPushBtnSDDRightGlyphHeightH = 43;
  3746. m_nPushBtnSDDRightGlyphHeightV = 9;
  3747. m_rcPushBtnSimplePaddingH.SetRect( 3, 3, 3, 3 );
  3748. m_rcPushBtnSimplePaddingV.SetRect( 3, 3, 3, 3 );
  3749. m_rcPushBtnSDDLeftPaddingH.SetRect( 3, 3, 3, 3 );
  3750. m_rcPushBtnSDDLeftPaddingV.SetRect( 3, 3, 3, 3 );
  3751. m_rcPushBtnSDDRightPaddingH.SetRect( 3, 3, 3, 3 );
  3752. m_rcPushBtnSDDRightPaddingV.SetRect( 3, 3, 3, 3 );
  3753. VERIFY(
  3754. m_arrBmpPushBtnSimpleH.LoadBMP_Resource(
  3755. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_BUTTON_R1_SIMPLE )
  3756. )
  3757. );
  3758. VERIFY(
  3759. m_arrBmpPushBtnSDDLeftH.LoadBMP_Resource(
  3760. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_BUTTON_R1_LEFT_PART )
  3761. )
  3762. );
  3763. VERIFY(
  3764. m_arrBmpPushBtnSDDRightH.LoadBMP_Resource(
  3765. MAKEINTRESOURCE( IDB_EXT_2010_OFFICE_BUTTON_R1_RIGHT_PART )
  3766. )
  3767. );
  3768. VERIFY(
  3769. m_arrBmpPushBtnSimpleV.CreateRotated9xStack(
  3770. m_arrBmpPushBtnSimpleH,
  3771. 90,
  3772. INT(__EPBGT_GLYPH_COUNT),
  3773. m_arrBmpPushBtnSimpleH.GetSize().cx,
  3774. m_nPushBtnSimpleGlyphHeightH,
  3775. false,
  3776. false
  3777. )
  3778. );
  3779. VERIFY(
  3780. m_arrBmpPushBtnSDDLeftV.CreateRotated9xStack(
  3781. m_arrBmpPushBtnSDDLeftH,
  3782. 90,
  3783. INT(__EPBGT_GLYPH_COUNT),
  3784. m_arrBmpPushBtnSDDLeftH.GetSize().cx,
  3785. m_nPushBtnSDDLeftGlyphHeightH,
  3786. false,
  3787. false
  3788. )
  3789. );
  3790. VERIFY(
  3791. m_arrBmpPushBtnSDDRightV.CreateRotated9xStack(
  3792. m_arrBmpPushBtnSDDRightH,
  3793. 90,
  3794. INT(__EPBGT_GLYPH_COUNT),
  3795. m_arrBmpPushBtnSDDRightH.GetSize().cx,
  3796. m_nPushBtnSDDRightGlyphHeightH,
  3797. false,
  3798. false
  3799. )
  3800. );
  3801. m_arrBmpPushBtnSimpleV.PreMultipliedRGBChannelsSet( true );
  3802. m_arrBmpPushBtnSDDLeftV.PreMultipliedRGBChannelsSet( true );
  3803. m_arrBmpPushBtnSDDRightV.PreMultipliedRGBChannelsSet( true );
  3804. #if (!defined __EXT_MFC_NO_RIBBON_BAR)
  3805. if( g_PaintManager.m_bIsWinVistaOrLater )
  3806. {
  3807. VERIFY( m_bmpRibbonTabAreaBlur.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TAB_AREA_DWM_BLUR) ) );
  3808. m_rcRibbonTabAreaBlurPadding.SetRect( 35, 0, 35, 36 );
  3809. }
  3810. m_clrRibbonTabClientAreaActive = RGB(227,230,232);
  3811. m_clrRibbonTabClientAreaInactive = RGB(252,252,252);
  3812. m_clrContractedMargin1 = RGB(128,128,128);
  3813. m_clrContractedMargin2 = RGB(128,128,128);
  3814. m_bRibbonGroupCaptionAtTop = false;
  3815. m_bRibbonGroupCaptionAreaHasPadding = true;
  3816. m_nRibbonGroupCaptionAreaHeightExpanded = 16;
  3817. m_nRibbonGroupCaptionAreaHeightCollapsed = 16;
  3818. m_nRibbonGroupIconBkVertOffset = 2;
  3819. m_nRibbonCaptionPartHeight = 17;
  3820. m_rcRibbonPageOuterContentPadding.SetRect( 0, 0, 0, 0 );
  3821. m_clrRibbonComboBackGroundNormal   = RGB(255,255,255);
  3822. m_clrRibbonComboBackGroundDisabled = RGB(255,255,255);
  3823. m_nRibbonTabIntersectionHeight = 1;
  3824. //m_nRibbonQuickAccessBarButtonsAlignment = 0;
  3825. m_clrRibbonGroupCaptionTextCollapsed
  3826. = m_clrRibbonButtonNormal
  3827. = RGB(57,60,63);
  3828. m_clrRibbonButtonDisabled = RGB(128,128,128);
  3829. m_clrRibbonGroupCaptionTextExpanded = RGB( 52, 52, 64 );
  3830. //m_clrRibbonGroupCaptionTextShadowExpanded = RGB( 0, 0, 0 );
  3831. //m_sizeRibbonGroupCaptionTextOffset = CSize( 1, 1 );
  3832. m_nRibbonGroupCaptionTextDF
  3833. = m_nRibbonGroupCaptionTextShadowDF
  3834. = DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_END_ELLIPSIS;
  3835. m_rcRibbonPageBkPadding.SetRect( 1, 1, 1, 1 );
  3836. VERIFY(
  3837. m_bmpRibbonPageBk.LoadBMP_Resource(
  3838. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_PAGE_BK_R1)
  3839. )
  3840. );
  3841. m_rcRibbonGroupPaddingBkExpanded.SetRect( 2, 6, 2, 2 );
  3842. VERIFY(
  3843. m_bmpRibbonGroupBkExpanded[0].LoadBMP_Resource(
  3844. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_EXPANDED_NORMAL_BK_R1)
  3845. )
  3846. );
  3847. m_bmpRibbonGroupBkExpanded[0].PreMultipliedRGBChannelsSet( false );
  3848. VERIFY(
  3849. m_bmpRibbonGroupBkExpanded[1].LoadBMP_Resource(
  3850. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_EXPANDED_HOVER_BK_R1)
  3851. )
  3852. );
  3853. m_bmpRibbonGroupBkExpanded[1].PreMultipliedRGBChannelsSet( false );
  3854. m_rcRibbonGroupPaddingBkCollapsed.SetRect( 2, 6, 2, 2 );
  3855. VERIFY(
  3856. m_bmpRibbonGroupBkCollapsed[0].LoadBMP_Resource(
  3857. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_COLLAPSED_NORMAL_BK_R1)
  3858. )
  3859. );
  3860. m_bmpRibbonGroupBkCollapsed[0].PreMultipliedRGBChannelsSet( false );
  3861. VERIFY(
  3862. m_bmpRibbonGroupBkCollapsed[1].LoadBMP_Resource(
  3863. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_COLLAPSED_HOVER_BK_R1)
  3864. )
  3865. );
  3866. m_bmpRibbonGroupBkCollapsed[1].PreMultipliedRGBChannelsSet( false );
  3867. VERIFY(
  3868. m_bmpRibbonGroupBkCollapsed[2].LoadBMP_Resource(
  3869. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_COLLAPSED_PRESSED_BK_R1)
  3870. )
  3871. );
  3872. m_bmpRibbonGroupBkCollapsed[2].PreMultipliedRGBChannelsSet( false );
  3873. VERIFY(
  3874. m_bmpRibbonGroupBkCollapsed[3].LoadBMP_Resource( // selected same as hover in R1
  3875. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_COLLAPSED_HOVER_BK_R1)
  3876. )
  3877. );
  3878. m_bmpRibbonGroupBkCollapsed[3].PreMultipliedRGBChannelsSet( false );
  3879. //INT nBkIndex, nBkCount;
  3880. // nBkCount = sizeof( m_bmpRibbonGroupBkExpanded ) / sizeof( m_bmpRibbonGroupBkExpanded[0] );
  3881. // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  3882. // {
  3883. // m_bmpRibbonGroupBkExpanded[nBkIndex].Make32();
  3884. // m_bmpRibbonGroupBkExpanded[nBkIndex].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3885. // } // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  3886. // nBkCount = sizeof( m_bmpRibbonGroupBkCollapsed ) / sizeof( m_bmpRibbonGroupBkCollapsed[0] );
  3887. // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  3888. // {
  3889. // m_bmpRibbonGroupBkCollapsed[nBkIndex].Make32();
  3890. // m_bmpRibbonGroupBkCollapsed[nBkIndex].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3891. // } // for( nBkIndex = 0; nBkIndex < nBkCount; nBkIndex ++ )
  3892. VERIFY( m_bmpRibbonGroupBkQATB[0].LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_BUTTON_QATB_NORMAL_BK_R1) ) );
  3893. m_bmpRibbonGroupBkQATB[0].PreMultiplyRGBChannels( false );
  3894. VERIFY( m_bmpRibbonGroupBkQATB[1].LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_BUTTON_QATB_HOVER_BK_R1) ) );
  3895. m_bmpRibbonGroupBkQATB[1].PreMultiplyRGBChannels( false );
  3896. VERIFY( m_bmpRibbonGroupBkQATB[2].LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_GROUP_BUTTON_QATB_PRESSED_BK_R1) ) );
  3897. m_bmpRibbonGroupBkQATB[2].PreMultiplyRGBChannels( false );
  3898. m_bmpRibbonGroupBkQATB[3] = m_bmpRibbonGroupBkQATB[1];
  3899. m_nRibbonSeparatorDrawModeH = INT( CExtBitmap::__EDM_STRETCH );
  3900. m_nRibbonSeparatorDrawModeV = INT( CExtBitmap::__EDM_STRETCH );
  3901. m_rcRibbonSeparatorPaddingH.SetRect( 0, 0, 0, 0 );
  3902. VERIFY(
  3903. m_bmpRibbonSeparatorH.LoadBMP_Resource(
  3904. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_SEPARATOR_H_R1)
  3905. )
  3906. );
  3907. VERIFY( m_bmpRibbonSeparatorH.Make32() );
  3908. m_bmpRibbonSeparatorH.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3909. m_rcRibbonSeparatorPaddingV.SetRect( 0, 0, 0, 0 );
  3910. VERIFY(
  3911. m_bmpRibbonSeparatorV.LoadBMP_Resource(
  3912. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_SEPARATOR_V_R1)
  3913. )
  3914. );
  3915. VERIFY( m_bmpRibbonSeparatorV.Make32() );
  3916. m_bmpRibbonSeparatorV.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3917. m_rcRibbonPaddingQACEB.SetRect( 3, 3, 3, 3 );
  3918. m_nRibbonHeightOfQACEB = 22;
  3919. m_nIdxRibbonQACEB_Normal   = 3;
  3920. m_nIdxRibbonQACEB_Hover    = 0;
  3921. m_nIdxRibbonQACEB_Pressed  = 1;
  3922. m_nIdxRibbonQACEB_Selected = 2;
  3923. VERIFY(
  3924. m_bmpArrRibbonQACEB.LoadBMP_Resource(
  3925. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_QATB_CEB_R1)
  3926. )
  3927. );
  3928. m_bmpArrRibbonQACEB.PreMultiplyRGBChannels( false );
  3929. //m_bmpArrRibbonQACEB.PreMultipliedRGBChannelsSet( true );
  3930. m_nRibbonEmbeddedCaptionTextAlignmentFlags = (DT_SINGLELINE|DT_CENTER|DT_VCENTER);
  3931. //m_bRibbonFileButtonItegrationSupported = false;
  3932. //m_nRibbonFileButtonMenuIntersectionHeight = 20;
  3933. m_nQatbAdditionalSpaceAtRightDWM = 0;
  3934. //  INT nCaptionHeightActive = NcFrame_GetCaptionHeight( true, NULL ) + m_rcNcFrameBordersActive.top;
  3935. //  INT nCaptionHeightInactive = NcFrame_GetCaptionHeight( false, NULL ) + m_rcNcFrameBordersInactive.top;
  3936. //  CExtBitmap::Filter _fBox( CExtBitmap::Filter::box );
  3937. m_rcRibbonNcCornerLeftCP.SetRect( 53, 2, 2, 2 );
  3938. m_rcRibbonNcCornerRightCP.SetRect( 2, 2, 42, 2 );
  3939. VERIFY( m_bmpArrRibbonFileButton.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_FILE_BUTTON) ) );
  3940. //m_bmpArrRibbonFileButton.PreMultipliedRGBChannelsSet( true );
  3941. m_bmpArrRibbonFileButton.PreMultiplyRGBChannels( true );
  3942. m_nRibbonFileButtonHeight = m_bmpArrRibbonFileButton.GetSize().cy / 3;
  3943. m_rcPaddingRibbonQuickAccessBarBkAtTheBottom.SetRect( 0, 1, 0, 1 );
  3944. VERIFY( m_bmpRibbonQuickAccessBarBkAtTheBottom.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_QATB_BK_R1) ) );
  3945. m_nRibbonHeightOfOneDLB = 14;
  3946. m_nDlbIdxDisabled = m_nDlbIdxNormal = 0;
  3947. m_nDlbIdxHover = 1;
  3948. m_nDlbIdxPressed = 2;
  3949. rcRibbonContentPaddingDLB.SetRect( 2, 2, 2, 2 );
  3950. VERIFY( m_arrBmpRibbonDLB.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_GCB_R1) ) );
  3951. //m_arrBmpRibbonDLB.PreMultipliedRGBChannelsSet( true );
  3952. m_arrBmpRibbonDLB.PreMultiplyRGBChannels( false );
  3953. m_clrRibbonGalleryInplaceBorderNormal = m_clrRibbonGalleryInplaceBorderHover  = RGB(198,202,205);
  3954. m_clrRibbonGalleryInplaceBkgndNormal  = m_clrRibbonGalleryInplaceBkgndHover   = RGB(255,255,255);
  3955. m_rcRibbonGalleryScrollFill = RGB(255,255,255);
  3956. m_rcRibbonGalleryScrollButtonPadding.SetRect( 3, 3, 3, 3 );
  3957. m_nHeightRibbonGalleryScrollButton = -1; //20;
  3958. m_nIndexRibbonGalleryScrollButtonNormal   = 0;
  3959. m_nIndexRibbonGalleryScrollButtonHover    = 1;
  3960. m_nIndexRibbonGalleryScrollButtonPressed  = 2;
  3961. m_nIndexRibbonGalleryScrollButtonDisabled = 3;
  3962. VERIFY(
  3963. m_bmpArrRibbonGalleryScrollButtonDown.LoadBMP_Resource(
  3964. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RGIBTN_DOWN_R1)
  3965. )
  3966. );
  3967. m_bmpArrRibbonGalleryScrollButtonDown.PreMultipliedRGBChannelsSet( true );
  3968. VERIFY(
  3969. m_bmpArrRibbonGalleryScrollButtonUp.LoadBMP_Resource(
  3970. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RGIBTN_UP_R1)
  3971. )
  3972. );
  3973. m_bmpArrRibbonGalleryScrollButtonUp.PreMultipliedRGBChannelsSet( true );
  3974. VERIFY(
  3975. m_bmpArrRibbonGalleryScrollButtonMenu.LoadBMP_Resource(
  3976. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RGIBTN_MENU_R1)
  3977. )
  3978. );
  3979. m_bmpArrRibbonGalleryScrollButtonMenu.PreMultipliedRGBChannelsSet( true );
  3980. #endif // (!defined __EXT_MFC_NO_RIBBON_BAR)
  3981. VERIFY( m_bmpRibbonDDA.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_DDA_R1) ) );
  3982. VERIFY( m_bmpRibbonDDA.Make32() );
  3983. m_bmpRibbonDDA.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  3984. m_rcRibbonPaddingComboBoxDropDown.SetRect( 2, 2, 2, 2 );
  3985. VERIFY( m_bmpArrRibbonComboBoxDropDown.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_COMBO_BOX_BUTTON_R1) ) );
  3986. m_bmpArrRibbonComboBoxDropDown.PreMultipliedRGBChannelsSet( true );
  3987. // buttons 2010
  3988. m_nHeightOfButtonLSM = 66;
  3989. m_nHeightOfButtonLSXM = 39;
  3990. m_nHeightOfButtonLSXB = 27;
  3991. // tool buttons 2010
  3992. m_rcPaddingOfButtonTS.SetRect( 3, 3, 3, 3 );
  3993. m_arrIndicesButtonTS[INT(__E07BI_NORMAL)] = -1;
  3994. m_arrIndicesButtonTS[INT(__E07BI_HOVER)] = 0;
  3995. m_arrIndicesButtonTS[INT(__E07BI_PRESSED)] = 1;
  3996. m_arrIndicesButtonTS[INT(__E07BI_HDD)] = 2;
  3997. m_arrIndicesButtonTS[INT(__E07BI_SEL_T)] = 3;
  3998. m_arrIndicesButtonTS[INT(__E07BI_INDETERMINATE)] = 4;
  3999. m_rcPaddingOfButtonSS.SetRect( 3, 3, 3, 3 );
  4000. m_arrIndicesButtonSS_Left[INT(__E07BI_NORMAL)] = -1;
  4001. m_arrIndicesButtonSS_Left[INT(__E07BI_HOVER)] = 0;
  4002. m_arrIndicesButtonSS_Left[INT(__E07BI_PRESSED)] = 1;
  4003. m_arrIndicesButtonSS_Left[INT(__E07BI_HDD)] = 2;
  4004. m_arrIndicesButtonSS_Left[INT(__E07BI_SEL_T)] = 3;
  4005. m_arrIndicesButtonSS_Left[INT(__E07BI_INDETERMINATE)] = 4;
  4006. m_arrIndicesButtonSS_Right[INT(__E07BI_NORMAL)] = -1;
  4007. m_arrIndicesButtonSS_Right[INT(__E07BI_HOVER)] = 0;
  4008. m_arrIndicesButtonSS_Right[INT(__E07BI_PRESSED)] = 1;
  4009. m_arrIndicesButtonSS_Right[INT(__E07BI_HDD)] = 2;
  4010. m_arrIndicesButtonSS_Right[INT(__E07BI_SEL_T)] = 3;
  4011. m_arrIndicesButtonSS_Right[INT(__E07BI_INDETERMINATE)] = 4;
  4012. m_rcPaddingOfButtonLSM.SetRect( 4, 4, 4, 4 );
  4013. m_arrIndicesButtonLSM[INT(__E07BI_NORMAL)] = -1;
  4014. m_arrIndicesButtonLSM[INT(__E07BI_HOVER)] = 0;
  4015. m_arrIndicesButtonLSM[INT(__E07BI_PRESSED)] = 1;
  4016. m_arrIndicesButtonLSM[INT(__E07BI_HDD)] = 2;
  4017. m_arrIndicesButtonLSM[INT(__E07BI_SEL_T)] = 3;
  4018. m_arrIndicesButtonLSM[INT(__E07BIX_INDETERMINATE)] = 4;
  4019. // m_rcPaddingOfButtonLSB.SetRect( 4, 4, 4, 4 );
  4020. // m_arrIndicesButtonLSB[INT(__E07BI_NORMAL)] = -1;
  4021. // m_arrIndicesButtonLSB[INT(__E07BI_HOVER)] = 0;
  4022. // m_arrIndicesButtonLSB[INT(__E07BI_PRESSED)] = 1;
  4023. // m_arrIndicesButtonLSB[INT(__E07BI_HDD)] = 2;
  4024. // m_arrIndicesButtonLSB[INT(__E07BI_SEL_T)] = 3;
  4025. // m_arrIndicesButtonLSB[INT(__E07BI_INDETERMINATE)] = 4;
  4026. m_rcPaddingOfButtonLSXM.SetRect( 4, 4, 4, 4 );
  4027. m_arrIndicesButtonLSXM[INT(__E07BIX_NORMAL)] = -1;
  4028. m_arrIndicesButtonLSXM[INT(__E07BIX_HOVER)] = 0;
  4029. m_arrIndicesButtonLSXM[INT(__E07BIX_HOVER2)] = 0;
  4030. m_arrIndicesButtonLSXM[INT(__E07BIX_PRESSED)] = 1;
  4031. m_arrIndicesButtonLSXM[INT(__E07BIX_PRESSED2)] = 1;
  4032. m_arrIndicesButtonLSXM[INT(__E07BIX_PRESSED3)] = 1;
  4033. m_arrIndicesButtonLSXM[INT(__E07BIX_INDETERMINATE)] = 5;
  4034. m_arrIndicesButtonLSXM[INT(__E07BIX_SELECTED)] = 3;
  4035. m_rcPaddingOfButtonLSXB.SetRect( 4, 4, 4, 4 );
  4036. m_arrIndicesButtonLSXB[INT(__E07BIX_NORMAL)] = -1;
  4037. m_arrIndicesButtonLSXB[INT(__E07BIX_HOVER)] = 0;
  4038. m_arrIndicesButtonLSXB[INT(__E07BIX_HOVER2)] = 0;
  4039. m_arrIndicesButtonLSXB[INT(__E07BIX_PRESSED)] = 1;
  4040. m_arrIndicesButtonLSXB[INT(__E07BIX_PRESSED2)] = 1;
  4041. m_arrIndicesButtonLSXB[INT(__E07BIX_PRESSED3)] = 1;
  4042. m_arrIndicesButtonLSXB[INT(__E07BIX_INDETERMINATE)] = 5;
  4043. m_arrIndicesButtonLSXB[INT(__E07BIX_SELECTED)] = 3;
  4044. VERIFY(
  4045. m_bmpArrButtonTS[INT(__EBTSA_SOLID)].LoadBMP_Resource(
  4046. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TB_SOLID_R1)
  4047. )
  4048. );
  4049. m_bmpArrButtonTS[INT(__EBTSA_SOLID)].PreMultipliedRGBChannelsSet( true );
  4050. VERIFY(
  4051. m_bmpArrButtonTS[INT(__EBTSA_LEFT)].LoadBMP_Resource(
  4052. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TB_SOLID_R1)
  4053. )
  4054. );
  4055. m_bmpArrButtonTS[INT(__EBTSA_LEFT)].PreMultipliedRGBChannelsSet( true );
  4056. VERIFY(
  4057. m_bmpArrButtonTS[INT(__EBTSA_MIDDLE)].LoadBMP_Resource(
  4058. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TB_SOLID_R1)
  4059. )
  4060. );
  4061. m_bmpArrButtonTS[INT(__EBTSA_MIDDLE)].PreMultipliedRGBChannelsSet( true );
  4062. VERIFY(
  4063. m_bmpArrButtonTS[INT(__EBTSA_RIGHT)].LoadBMP_Resource(
  4064. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TB_SOLID_R1)
  4065. )
  4066. );
  4067. m_bmpArrButtonTS[INT(__EBTSA_RIGHT)].PreMultipliedRGBChannelsSet( true );
  4068. VERIFY(
  4069. m_bmpArrButtonSS_DD[INT(__EBSSA_LEFT)].LoadBMP_Resource(
  4070. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_BTN_PART_SMALL_LEFT_R1)
  4071. )
  4072. );
  4073. m_bmpArrButtonSS_DD[INT(__EBSSA_LEFT)].PreMultipliedRGBChannelsSet( true );
  4074. VERIFY(
  4075. m_bmpArrButtonSS_DD[INT(__EBSSA_RIGHT)].LoadBMP_Resource(
  4076. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_BTN_PART_SMALL_RIGHT_R1)
  4077. )
  4078. );
  4079. m_bmpArrButtonSS_DD[INT(__EBSSA_RIGHT)].PreMultipliedRGBChannelsSet( true );
  4080. m_bmpArrButtonSS_simple = m_bmpArrButtonSS_DD[ INT(__EBSSA_LEFT) ];
  4081. if( ! m_bmpArrButtonSS_simple.IsEmpty() )
  4082. {
  4083. CSize _sizeBmp = m_bmpArrButtonSS_simple.GetSize();
  4084. INT nY = 0, nXRange = _sizeBmp.cx / 2;
  4085. for( ; nY < _sizeBmp.cy; nY ++ )
  4086. {
  4087. INT nXSrc = nXRange - 1, nXDst = _sizeBmp.cx - nXRange;
  4088. for( ; nXDst < _sizeBmp.cx; nXDst ++, nXSrc -- )
  4089. {
  4090. RGBQUAD _pixel;
  4091. VERIFY( m_bmpArrButtonSS_simple.GetPixel( nXSrc, nY, _pixel ) );
  4092. VERIFY( m_bmpArrButtonSS_simple.SetPixel( nXDst, nY, _pixel ) );
  4093. } // for( ; nXDst < _sizeBmp.cx; nXDst ++, nXSrc -- )
  4094. } // for( ; nY < _sizeBmp.cy; nY ++ )
  4095. } // if( m_bmpArrButtonSS_simple.IsEmpty() )
  4096. VERIFY(
  4097. m_bmpArrButtonLSM.LoadBMP_Resource(
  4098. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_BTN_PART_LARGE_ALL_R1)
  4099. )
  4100. );
  4101. m_bmpArrButtonLSM.PreMultipliedRGBChannelsSet( true );
  4102. // VERIFY(
  4103. // m_bmpArrButtonLSB.LoadBMP_Resource(
  4104. // MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_BTN_PART_LARGE_BOTTOM_R1)
  4105. // )
  4106. // );
  4107. // m_bmpArrButtonLSB.PreMultipliedRGBChannelsSet( true );
  4108. VERIFY(
  4109. m_bmpArrButtonLSXM.LoadBMP_Resource(
  4110. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_BTN_PART_LARGE_TOP_R1)
  4111. )
  4112. );
  4113. m_bmpArrButtonLSXM.PreMultipliedRGBChannelsSet( true );
  4114. VERIFY(
  4115. m_bmpArrButtonLSXB.LoadBMP_Resource(
  4116. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_BTN_PART_LARGE_BOTTOM_R1)
  4117. )
  4118. );
  4119. m_bmpArrButtonLSXB.PreMultipliedRGBChannelsSet( true );
  4120. VERIFY(
  4121. m_bmpToolBtnSeparator[INT(__ETBS_HOVER)].LoadBMP_Resource(
  4122. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TB_SEPARATOR_HOVER_R1)
  4123. )
  4124. );
  4125. m_bmpToolBtnSeparator[INT(__ETBS_HOVER)].PreMultipliedRGBChannelsSet( true );
  4126. VERIFY(
  4127. m_bmpToolBtnSeparator[INT(__ETBS_PRESSED)].LoadBMP_Resource(
  4128. MAKEINTRESOURCE(IDB_EXT_2010_OFFICE_RIBBON_TB_SEPARATOR_PRESSED_R1)
  4129. )
  4130. );
  4131. m_bmpToolBtnSeparator[INT(__ETBS_PRESSED)].PreMultipliedRGBChannelsSet( true );
  4132. VERIFY(
  4133. m_bmpLargeBtnSeparator[INT(__ELBS_HOVER)].LoadBMP_Resource(
  4134. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_SEPARATOR_HOVER_R1)
  4135. )
  4136. );
  4137. m_bmpLargeBtnSeparator[INT(__ELBS_HOVER)].Make32();
  4138. m_bmpLargeBtnSeparator[INT(__ELBS_HOVER)].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  4139. VERIFY(
  4140. m_bmpLargeBtnSeparator[INT(__ELBS_PRESSED)].LoadBMP_Resource(
  4141. MAKEINTRESOURCE(IDB_EXT_2007_RIBBON_BTN_PART_LARGE_SEPARATOR_PRESSED_R1)
  4142. )
  4143. );
  4144. m_bmpLargeBtnSeparator[INT(__ELBS_PRESSED)].Make32();
  4145. m_bmpLargeBtnSeparator[INT(__ELBS_PRESSED)].AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
  4146. VERIFY( m_bmpRibbonMenuResizingMarginHV.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_MRB_HV_OBSIDIAN) ) );
  4147. VERIFY( m_bmpRibbonMenuResizingMarginV.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_MRB_V_OBSIDIAN) ) );
  4148. VERIFY( m_bmpRibbonMenuResizingGripperHV.LoadBMP_Resource( MAKEINTRESOURCE(IDB_EXT_2007_MRG_HV_OBSIDIAN) ) );
  4149. m_bmpRibbonMenuResizingGripperHV.Make32();