Office2007 theme for CXTCaption in case anyone wants it.
To use, in your caption, use
pCaption->SetTheme(new CXTCaptionThemeOffice2007);
enjoy.
class CXTCaptionThemeOffice2007 : public CXTCaptionThemeOffice2003 { public: virtual void DrawCaptionBack(CDC* pDC, CXTCaption* pCaption, CRect& rcItem); virtual void RefreshMetrics();
CXTPPaintManagerColorGradient m_clrNormalCaption; // Color of pane caption when inactive. CXTPPaintManagerColor m_clrNormalCaptionText; // Color of pane caption text when the caption is inactive COLORREF m_arrColor[XPCOLOR_LAST + 1]; // Self colors array. };
void CXTCaptionThemeOffice2007::RefreshMetrics() { CXTCaptionThemeOffice2003::RefreshMetrics();
if (XTPOffice2007Images()->IsValid()) { m_arrColor[XPCOLOR_FRAME] = XTPOffice2007Images()->GetImageColor(_T("Window"), _T("WindowFrame")); m_arrColor[XPCOLOR_3DFACE] = XTPOffice2007Images()->GetImageColor(_T("Window"), _T("ButtonFace")); m_arrColor[COLOR_3DHIGHLIGHT] = XTPOffice2007Images()->GetImageColor(_T("Window"), _T("EdgeHighLightColor")); m_arrColor[XPCOLOR_TOOLBAR_GRIPPER] = XTPOffice2007Images()->GetImageColor(_T("Toolbar"), _T("ToolbarGripper")); m_arrColor[XPCOLOR_MENUBAR_BORDER] = XTPOffice2007Images()->GetImageColor(_T("Toolbar"), _T("MenuPopupBorder"));
m_clrNormalCaption.SetStandardValue(XTPOffice2007Images()->GetImageColor(_T("DockingPane"), _T("NormalCaptionLight")), XTPOffice2007Images()->GetImageColor(_T("DockingPane"), _T("NormalCaptionDark")), 0.25f); m_clrNormalCaptionText.SetStandardValue(XTPOffice2007Images()->GetImageColor(_T("DockingPane"), _T("NormalCaptionText"))); } else { // defaults for if there's no Office2007 images. m_arrColor[XPCOLOR_FRAME] = RGB(101, 147, 207); m_arrColor[XPCOLOR_3DFACE] = RGB(191, 219, 255); m_arrColor[COLOR_3DHIGHLIGHT] = RGB(255, 255, 255); m_clrNormalCaption.SetStandardValue(RGB(227, 239, 255), RGB(175, 210, 255), 0.25f); m_clrNormalCaptionText.SetStandardValue(RGB(8, 55, 114)); } }
void CXTCaptionThemeOffice2007::DrawCaptionBack(CDC* pDC, CXTCaption* pCaption, CRect& rcItem) { XTPDrawHelpers()->GradientFill(pDC, rcItem, m_clrNormalCaption, FALSE); pDC->FillSolidRect(rcItem.left, rcItem.top, rcItem.Width(), 1, m_arrColor[XPCOLOR_FRAME]); pDC->FillSolidRect(rcItem.left, rcItem.top + 1, rcItem.Width(), 1, m_arrColor[COLOR_3DHIGHLIGHT]); pDC->FillSolidRect(rcItem.left, rcItem.top, 1, rcItem.Height(), m_arrColor[XPCOLOR_FRAME]); pDC->FillSolidRect(rcItem.left + 1, rcItem.top + 1, 1, rcItem.Height() - 1, m_arrColor[COLOR_3DHIGHLIGHT]); pDC->FillSolidRect(rcItem.right - 1, rcItem.top, 1, rcItem.Height(), m_arrColor[XPCOLOR_FRAME]); }
|