Print Page | Close Window

Skin and CXTPToolbar in a dialog

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6694
Printed Date: 13 November 2025 at 5:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Skin and CXTPToolbar in a dialog
Posted By: Dominique
Subject: Skin and CXTPToolbar in a dialog
Date 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 ?
 
 



Replies:
Posted By: Oleg
Date Posted: 22 March 2007 at 2:06am
hI,
you have to set theme
 
XTPPaintManager()->SetTheme(xtpThemeNativeWinXP);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Dominique
Date 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.
 
 
 


Posted By: Dominique
Date 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!!!
 
 


Posted By: zrethy
Date 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


Posted By: zrethy
Date Posted: 13 July 2007 at 9:03am
Resolved now, using a custom CXTPReBarPaintManager object as the theme

-------------
Regards,

Zsolt Rethy



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net