Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Skin and CXTPToolbar in a dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Skin and CXTPToolbar in a dialog

 Post Reply Post Reply
Author
Message
Dominique View Drop Down
Newbie
Newbie


Joined: 06 July 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Topic: Skin and CXTPToolbar in a dialog
    Posted: 21 March 2007 at 11:17am
Does CXTPToolbar supports skin when it is used in a dialog box ?
 
I made a simple test in the sample "SkinControls"
I added a CXTPToolBar in top of the dialog box.
 
//SkinControls.h
CXTPToolBar   m_toolBar;
 
//SkinControls.cpp
 
static UINT auIDToolBar[]=
{
 ID_FILE_NEW,
 ID_FILE_OPEN,
 ID_FILE_SAVE
};
 
BOOL CSkinControlsDlg::OnInitDialog()
{
 CDialog::OnInitDialog();
 
//at the end of OnInitDialog I added few lines
 
m_toolBar.CreateToolBar( TBSTYLE_FLAT|TBSTYLE_TRANSPARENT|TBSTYLE_TOOLTIPS
        |WS_CHILD|WS_VISIBLE|CBRS_ALIGN_TOP
        ,this
       );
 m_toolBar.SetButtons(auIDToolBar, sizeof(auIDToolBar)/sizeof(UINT));
 RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0);
 CRect rcToolBar(0,0, 150, 30);
 m_toolBar.MoveWindow(&rcToolBar);
}
 
When i run the sample my new toolbar is not modified when i change theme (vista for example).
 
what's wrong with my code ?
 
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 2:06am
hI,
you have to set theme
 
XTPPaintManager()->SetTheme(xtpThemeNativeWinXP);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Dominique View Drop Down
Newbie
Newbie


Joined: 06 July 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 5:07am
If i put this line in the constructor of CSkinControlsDlg just before calling XTPSkinManager()->SetApplyOptions, nothing changes.
 
If i put this line in the constructor of CSkinControlsDlg just after XTPSkinManager()->LoadSkin, the toolbar is drawn black.
 
 
 
Back to Top
Dominique View Drop Down
Newbie
Newbie


Joined: 06 July 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 5:45am
My problem is resolved.
 
I derive CSkinControlsDlg from CXTPDialog and i call InitCommandBars() in OnInitdialog and it works!!!
 
 
Back to Top
zrethy View Drop Down
Newbie
Newbie
Avatar

Joined: 19 June 2003
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote zrethy Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2007 at 11:41am
I have a similar problem (although using an older version of Suite Pro, v9.5.1)

>XTPPaintManager()->SetTheme(xtpThemeNativeWinXP);
I did, but some of the toolbars aren't shown with the 3d look I'm expecting (I mean the gradient, metallic background for menus that is default on Vista, see e.g. Notepad). I'm usint CXTPToolBar and CXTPMenubar, the top toolbar and the menu have a plain lightblue colour instead of the expected one. I also have some toolbars on docking panes, that are themed correctly if they're at the top, but not if they're at the bottom.

Thanks in advance

Regards,

Zsolt Rethy
Back to Top
zrethy View Drop Down
Newbie
Newbie
Avatar

Joined: 19 June 2003
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote zrethy Quote  Post ReplyReply Direct Link To This Post Posted: 13 July 2007 at 9:03am
Resolved now, using a custom CXTPReBarPaintManager object as the theme
Regards,

Zsolt Rethy
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.047 seconds.