Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Multiple Skins for Multiple CommandBars
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple Skins for Multiple CommandBars

 Post Reply Post Reply
Author
Message
dang View Drop Down
Newbie
Newbie
Avatar

Joined: 23 November 2012
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote dang Quote  Post ReplyReply Direct Link To This Post Topic: Multiple Skins for Multiple CommandBars
    Posted: 23 November 2012 at 8:39am
Hi

I have an application which uses XTP Themes throughout. I have recently added a modal dialog with several pages using Skin Framework, each page having a different skin. This works fine.

However, I am using a CXTPPopupBar on one of the pages for a pop-up menu, and this is not skinned correctly. On another page I am using a CMenu, and this skins correctly, but I cannot use CMenu for the other as I need features of CommandBars such as SetCloseSubMenuOnClick(false).

Reading these forums, it seems that to get CommandBars to be skinned, you need to do pPopupBar->SetPaintManager( new CXTPNativeXPTheme ) in a handler for WM_XTP_INITCOMMANDSPOPUP (i.e. after the hwnd is created). This works in that the popup is skinned, but it has the wrong skin.

Looking a little deeper, it seems that CXTPNativeXPTheme::RefreshMetrics gets looks up AfxGetMainWnd to get skinning info, rather than the window being skinned...

I tried deriving my own PaintManager from CXTPNativeXPTheme and overriding RefreshMetrics to use a specific window I know has the right skin applied to it. However, this does not work - it seems that in the hooked drawing functions for CommandBars the skin is looked up based on CXTPSkinManager::m_pSchema - the 'top level' schema named "NormalDefault_ini" - where I need it to look up the skin data from a specific child schema/ini.

I have tried calling CXTPSKinManager::LoadSkin("mySkins.cjstyles", "specificSkin.ini"), hoping to set the 'current' skin on the SkinManager, but of course this then affects the whole application behind the modal dialog.

Is there a way to have multiple CommandBars using multiple skins at the same time? It seems that it is designed with the assumption that only one skin at a time would ever be used with CommandBars. I hope this is not the case!

Any suggestions?

Thanks.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.