Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Converting CDialogBar to CXTPDialogBar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Converting CDialogBar to CXTPDialogBar?

 Post Reply Post Reply
Author
Message
cuisinart View Drop Down
Groupie
Groupie


Joined: 31 January 2012
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuisinart Quote  Post ReplyReply Direct Link To This Post Topic: Converting CDialogBar to CXTPDialogBar?
    Posted: 04 February 2012 at 8:35pm
Hi guys, struggling here trying to test out this skinning framework by converting my app to use it.
  The User Guide is severely lacking.

 I make use of CDialogBars, and the constructor:
CDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)

These of course are not skinned, but the skin framework offers a skinnable CXTPDialogBar. Drop-in replacement, right?  Nope.

Unfortunately there is no similar constructor in CXTPDialogBar, and I'm at a loss as to how to convert between the two.

There are two ways to construct CXTPDialogBar. One is without any template, which doesn't make much sense, and another requires use of a string class name.  There is no constructor that allows use of a nIDTemplate integer.  

So, I used the User's guide search feature to search for CXTPDialogBar, but the word does not exist.

So, how can I use CXTPDialogBar with a dialog resource ID template?


EDIT:
Ok, after a while it's coming together.  Despite the user guide, there are a lot of good examples where most of this can be learned, by searching through the source for the functions to learn.

Instead of the MFC method of creating the CToolBar member in the OnCreate function of CMainFrame using CToolBar::Create (or CDialogBar::Create), we aren't supposed to create CXTPToolbars and dialog bars via their create functions. A toolbar should be created by adding it first to the commandBar, and then LOADING the gui-generated toolbar template as so:

CXTPToolBar* pToolBar = (CXTPToolBar*)  pCommandBars->Add(_T("Main"), xtpBarTop);
pToolBar->LoadToolBar(IDR_MAINFRAME);

Likewise, dialog-based command bars are not to be create() ed with a template, rather they are to be added to the command bar, sized, and then a child dialog or wnd is attached with SetChild:

CXTPDialogBar* pPalBar = (CXTPDialogBar*) pCommandBars->Add(_T("Palette"), xtpBarRight,RUNTIME_CLASS(CXTPDialogBar));
m_wndColorPalette.Create(0,0,WS_VISIBLE | WS_CHILD,CRect(),pPalBar,0);
pPalBar->SetChild(&m_wndColorPalette);

By setting the DialogBar to be aware of its child, it will update the child dialog or window size during scaling and docking transitions.
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.170 seconds.