Print Page | Close Window

Paint UI with mix of themes

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=489
Printed Date: 11 November 2025 at 8:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Paint UI with mix of themes
Posted By: CamG
Subject: Paint UI with mix of themes
Date Posted: 02 March 2004 at 7:25pm

I want to have the bulk of my UI rendered with the CXTPOffice2003Theme, but selectively apply custom themes to other items, such as a toolbar here and there.

For example, I have an MDI child window with a CXTPToolbar attached which needs to be rendered with my custom theme. In this window's CChildFrame::OnCreate I tried the following, where CMyCustomTheme inherits CXTPOffice2003Theme and does some custom painting:

CXTPCommandBars* pCommandBars = CXTPCommandBars::CreateCommandBars();
pCommandBars->SetPaintManager(new CMyCustomTheme());

VERIFY(m_wndToolBar.CreateToolBar(WS_VISIBLE|WS_CHILD|CBRS_T OOLTIPS, this));
VERIFY(m_wndToolBar.LoadToolBar(IDR_CHILDFRAME));
m_wndToolBar.SetCommandBars(pCommandBars);

It worked, but I get an access violation when I mouse over a control in the toolbar. What's going on here? Is it a good idea to CXTPCommandBars::CreateCommandBars() again after the toolkit has initialized? Is the toolkit capable of supporting this?

I'm evaluating the toolkit, so the lack of source code is not helping.




Replies:
Posted By: Oleg
Date Posted: 04 March 2004 at 12:48pm

try to call pCommadnBars->SetSite().   In next version will appear CXTPCommandBar::SetPaintManager method.



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


Posted By: fredwobus
Date Posted: 04 March 2005 at 3:35am
on the subject of CXTPCommandBars::CreateCommandBars

what do you have to call to free the destroy the object that is returned by that call ?

I call CXTPCommandBars::CreateCommandBars in my dialogs OnCreate handler, and want to get rid of the allocated memory in its OnDestroy handler.

do I just call "delete m_pCommandBars" ? or maybe "m_pCommandBars->InternalRelease()" ?

which is correct ?

Thanks Fred


Posted By: Oleg
Date Posted: 05 March 2005 at 5:18am
delete m_pCommandBars

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


Posted By: Russ
Date Posted: 05 December 2006 at 9:10am
you cannot use "delete m_pCommandBars"!


Posted By: fredwobus
Date Posted: 05 December 2006 at 9:31am
Originally posted by Russ Russ wrote:

you cannot use "delete m_pCommandBars"!


Why ?


Posted By: Russ
Date Posted: 06 December 2006 at 12:14am
because it won't compile, destructor is declared as protected

PS: using 9.51 here


Posted By: fredwobus
Date Posted: 10 December 2006 at 11:59am
Originally posted by Russ Russ wrote:

because it won't compile, destructor is declared as protected

PS: using 9.51 here


Ahh, well, I use the delete operator in a derived class.
It's worked well so far.



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