Updated Office2003 theme - 2000 and below |
Post Reply |
Author | |
Ark42
Senior Member Joined: 20 October 2003 Status: Offline Points: 291 |
Post Options
Thanks(0)
Posted: 25 July 2004 at 11:22pm |
//////////////////////////////////////////////////////////// //////////////// // CXTPDockingPaneOffice2003ThemeEx class CXTPDockingPaneOffice2003ThemeEx : public CXTPDockingPaneOffice2003Theme { public: CXTPDockingPaneOffice2003ThemeEx(BOOL bGreyToBlue = TRUE); virtual void DrawCaption(CDC& dc, CXTPDockingPaneTabbedContainer* pPane, CRect rc); virtual void DrawFloatingFrame(CDC& dc, CXTPDockingPaneMiniWnd* pPane, CRect rc); BOOL m_bGreyToBlue; protected: virtual void RefreshMetrics(); }; //////////////////////////////////////////////////////////// //////////////// // CColorSetOffice2003Ex class CColorSetOffice2003Ex : public CXTPTabPaintManager::CColorSetOffice2003 { public: CColorSetOffice2003Ex(BOOL bGreyToBlue = TRUE); BOOL m_bGreyToBlue; protected: virtual void RefreshMetrics(); }; //////////////////////////////////////////////////////////// //////////////// // CXTPDockingPaneOffice2003ThemeEx CXTPDockingPaneOffice2003ThemeEx::CXTPDockingPaneOffice2003T hemeEx(BOOL bGreyToBlue) { m_bGreyToBlue = bGreyToBlue; RefreshMetrics(); } void CXTPDockingPaneOffice2003ThemeEx::DrawCaption(CDC& dc, CXTPDockingPaneTabbedContainer* pPane, CRect rc) { if( pPane->IsActive() ) { COLORREF oldDark = m_clrCommandBarDark, oldLight = m_clrCommandBarLight; if( m_bLunaTheme ) { m_clrCommandBarDark = RGB(255, 166, 76); m_clrCommandBarLight = RGB(255, 212, 139); } else { m_clrCommandBarDark = XTPColorManager()->LightColor(m_clrCommandBarDark, m_ clrCommandBarLight, 50); m_clrCommandBarLight = m_clrCommandBarDark; } CXTPDockingPaneOffice2003Theme::DrawCaption(dc, pPane, rc); m_clrCommandBarDark = oldDark; m_clrCommandBarLight = oldLight; } else { CXTPDockingPaneOffice2003Theme::DrawCaption(dc, pPane, rc); } } void CXTPDockingPaneOffice2003ThemeEx::DrawFloatingFrame(CDC& dc, CXTPDockingPaneMiniWnd* pPane, CRect rc) { if( pPane->IsActive() ) { COLORREF oldDark = m_clrCommandBarDark, oldLight = m_clrCommandBarLight; if( m_bLunaTheme ) { m_clrCommandBarDark = RGB(255, 166, 76); m_clrCommandBarLight = RGB(255, 212, 139); } else { m_clrCommandBarDark = XTPColorManager()->LightColor(m_clrCommandBarDark, m_ clrCommandBarLight, 50); m_clrCommandBarLight = m_clrCommandBarDark; } CXTPDockingPaneOffice2003Theme::DrawFloatingFrame(dc, pPane, rc); m_clrCommandBarDark = oldDark; m_clrCommandBarLight = oldLight; } else { CXTPDockingPaneOffice2003Theme::DrawFloatingFrame(dc, pPane, rc); } } void CXTPDockingPaneOffice2003ThemeEx::RefreshMetrics() { CXTPDockingPaneOffice2003Theme::RefreshMetrics(); if( !m_bLunaTheme ) { CXTPColorManager *pClrMgr = XTPColorManager(); COLORREF btn = pClrMgr->GetColor(COLOR_BTNFACE); if( m_bGreyToBlue && (btn == RGB(192, 192, 192) || btn == RGB(212, 208, 200)) ) { m_clrCommandBarDark = RGB(129, 169, 226); m_clrCommandBarLight = RGB(221, 236, 254); m_bLunaTheme = TRUE; m_arrColor[0] = RGB(0, 0, 0); m_arrColor[1] = RGB(0, 78, 152); m_arrColor[2] = RGB(0, 84, 227); m_arrColor[3] = RGB(122, 150, 223); m_arrColor[4] = RGB(255, 255, 255); m_arrColor[5] = RGB(255, 255, 255); m_arrColor[6] = RGB(0, 0, 0); m_arrColor[7] = RGB(0, 0, 0); m_arrColor[8] = RGB(0, 0, 0); m_arrColor[9] = RGB(255, 255, 255); m_arrColor[10] = RGB(212, 208, 200); m_arrColor[11] = RGB(212, 208, 200); m_arrColor[12] = RGB(128, 128, 128); m_arrColor[13] = RGB(49, 106, 197); m_arrColor[14] = RGB(255, 255, 255); // m_arrColor[15] = RGB(236, 233, 216); m_arrColor[15] = btn; m_arrColor[16] = RGB(172, 168, 153); m_arrColor[17] = RGB(172, 168, 153); m_arrColor[18] = RGB(0, 0, 0); m_arrColor[19] = RGB(216, 228, 248); m_arrColor[20] = RGB(255, 255, 255); m_arrColor[21] = RGB(113, 111, 100); m_arrColor[22] = RGB(251, 248, 231); m_arrColor[23] = RGB(0, 0, 0); m_arrColor[24] = RGB(255, 255, 225); m_arrColor[25] = RGB(181, 181, 181); m_arrColor[26] = RGB(0, 0, 128); m_arrColor[27] = RGB(61, 149, 255); m_arrColor[28] = RGB(0, 0, 0); m_arrColor[29] = RGB(0, 0, 0); m_arrColor[30] = RGB(158, 190, 245); m_arrColor[31] = RGB(255, 238, 194); m_arrColor[32] = RGB(0, 0, 128); m_arrColor[33] = RGB(254, 128, 62); m_arrColor[34] = RGB(144, 157, 178); m_arrColor[35] = RGB(197, 194, 184); m_arrColor[36] = RGB(255, 192, 111); m_arrColor[37] = RGB(0, 0, 128); m_arrColor[38] = RGB(39, 65, 118); m_arrColor[39] = RGB(106, 140, 203); m_arrColor[40] = RGB(109, 150, 208); m_arrColor[41] = RGB(246, 246, 246); m_arrColor[42] = RGB(230, 227, 210); m_arrColor[43] = RGB(0, 45, 150); m_arrColor[44] = RGB(0, 0, 0); m_arrColor[45] = RGB(0, 0, 0); m_arrColor[46] = RGB(0, 0, 0); m_arrColor[47] = RGB(0, 0, 0); m_arrColor[48] = RGB(218, 233, 255); m_arrColor[49] = RGB(129, 126, 114); m_arrColor[50] = RGB(0, 0, 128); m_arrColor[51] = RGB(216, 231, 252); m_arrColor[52] = RGB(158, 190, 245); m_arrColor[53] = RGB(203, 225, 252); m_arrColor[54] = RGB(0, 45, 150); m_arrColor[55] = RGB(196, 218, 250); } } } //////////////////////////////////////////////////////////// //////////////// // CColorSetOffice2003Ex CColorSetOffice2003Ex::CColorSetOffice2003Ex(BOOL bGreyToBlue) { m_bGreyToBlue = bGreyToBlue; // RefreshMetrics(); } void CColorSetOffice2003Ex::RefreshMetrics() { CColorSetOffice2003::RefreshMetrics(); if( !m_bLunaTheme ) { CXTPColorManager *pClrMgr = XTPColorManager(); COLORREF btn = pClrMgr->GetColor(COLOR_BTNFACE); if( m_bGreyToBlue && (btn == RGB(192, 192, 192) || btn == RGB(212, 208, 200)) ) { m_clrHeaderFace.clrLight = RGB(196, 218, 250); m_clrHeaderFace.clrDark = RGB(252, 253, 254); m_clrAutoHideFace.clrLight = RGB(158, 190, 245); m_clrAutoHideFace.clrDark = RGB(196, 218, 250); m_clrFrameBorder = RGB(59, 97, 156); m_clrControlFace = RGB(236, 233, 216); m_clrHighlight = RGB(255, 255, 255); m_clrButtonSelected = RGB(255, 194, 115); m_clrButtonNormal = RGB(162, 192, 246); m_clrNormalText = RGB(0, 0, 0); m_clrInActiveText = RGB(0, 0, 0); m_clrSelectedText = RGB(0, 0, 0); m_clrHighlightText = RGB(0, 0, 0); m_clrDisabledText = RGB(172, 168, 153); m_clrButtonHighlighted = RGB(255, 240, 201); m_clrNavigateButtonBorder = RGB(0, 0, 128); m_bLunaTheme = TRUE; } } } Sample Usage: m_paneManager.InstallDockingPanes(this); m_paneManager.UseSplitterTracker(FALSE); m_paneManager.SetThemedFloatingFrames(TRUE); m_paneManager.SetAlphaDockingContext(TRUE); m_paneManager.SetCustomTheme(new CXTPDockingPaneOffice2003ThemeEx()); m_paneManager.GetPaintManager()->m_pTabPaintManager->S etColorSet(new CColorSetOffice2003Ex()); m_paneManager.GetPaintManager()->m_pPanelPaintManager-> ;SetColorSet(new CColorSetOffice2003Ex()); I also have a little hackish code that highlights the panes when they have focus by coloring the caption orange, similar to how Office 2003 actually does it sometimes. So you will see a pane go from to when it gets focus. It works on the new SetThemedFloatingFrames style too. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |