![]() |
Skin and CXTPToolbar in a dialog |
Post Reply
|
| Author | |
Dominique
Newbie
Joined: 06 July 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: Skin and CXTPToolbar in a dialogPosted: 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 ?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 March 2007 at 2:06am |
|
hI,
you have to set theme
XTPPaintManager()->SetTheme(xtpThemeNativeWinXP);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Dominique
Newbie
Joined: 06 July 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Dominique
Newbie
Joined: 06 July 2005 Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
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!!!
![]() |
|
![]() |
|
zrethy
Newbie
Joined: 19 June 2003 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
zrethy
Newbie
Joined: 19 June 2003 Status: Offline Points: 9 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 July 2007 at 9:03am |
|
Resolved now, using a custom CXTPReBarPaintManager object as the theme
|
|
|
Regards,
Zsolt Rethy |
|
![]() |
|
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 |