How to apply Skins to Ribbon Bar |
Post Reply |
Author | |
Makarand
Senior Member Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
Post Options
Thanks(0)
Posted: 31 March 2010 at 6:30am |
Hello CJ Team,
We have implemented Ribbon bar in our application previously we are using normal toolbar where we can apply different skin to the application (Code as follow). ------------------------------------------------- switch (iStyleNo) { case None: XTPSkinManager()->LoadSkin(_T(""), _T("")); break; case Office2007Style: XTPSkinManager()->LoadSkin(m_strStylesPath + _T("Office2007.cjstyles"), _T("NormalBlue.INI")); break; case WindowsVistaStyle: XTPSkinManager()->LoadSkin(m_strStylesPath + _T("Vista.cjstyles"), _T("NormalBlue.INI")); break; case WindowsVistaStyleBlack: XTPSkinManager()->LoadSkin(m_strStylesPath + _T("Vista.cjstyles"), _T("NormalBlack.INI")); break; case WindowsXPLunaStyle: XTPSkinManager()->LoadSkin(m_strStylesPath + _T("WinXP.Luna.cjstyles"), _T("NormalBlue.INI")); break; case WindowsXPRoyalStyle: XTPSkinManager()->LoadSkin(m_strStylesPath + _T("WinXP.Royale.cjstyles"), _T("NormalRoyale.INI")); break; } XTPSkinManager()->SetApplyOptions(XTPSkinManager()->GetApplyOptions() | xtpSkinApplyMetrics); XTPPaintManager()->RefreshMetrics(); ------------------------------------------------------- Now we have ribbon bar with the replacement of toolbar in that case we are not able to set the skin to the Ribon bar. Is it possible to set the style to the Ribbon bar? if yes then How can we apply? -Mak |
|
Smucker
Senior Member Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
|
If ribbons work the same as regular command bars, you just need set the
style to NativeWinXP. The code below is copied from a routine I use to
keep command bar themes, pane themes, and grid themes in synch, along
with allowing for skins:
if (XTPSkinManager()->LoadSkin(filename) ) { CXTPCommandBars* pbars = GetCommandBars(); // From main frame XTPPaintManager()->SetTheme(xtpThemeNativeWinXP); pbars->GetImageManager()->RefreshAll(); pbars->UpdateCommandBars(); pbars->RedrawCommandBars(); ApplySkin(); } ApplySkin() looks like this: void CMainFrame::ApplySkin() { DWORD options = xtpSkinApplyColors; XTPPaintManager()->RefreshMetrics(); if (m_skinning) { if (m_skinframe) options |= xtpSkinApplyFrame; //|xtpSkinApplyMetrics; XTPSkinManager()->SetApplyOptions(options); } XTPSkinManager()->SetAutoApplyNewWindows(TRUE); XTPSkinManager()->SetAutoApplyNewThreads(TRUE); XTPSkinManager()->EnableCurrentThread(); XTPSkinManager()->ApplyWindow(GetSafeHwnd()); XTPSkinManager()->RedrawAllControls(); ExcludeSkinModules(XTPSkinManager()); OnSysColorChange(); RedrawWindow(0, 0, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE|RDW_ALLCHILDREN); } I'm probably doing some unnecessary repainting, but this isn't something that happens that often, so I'm not worried about it. |
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
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 |