Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Paint UI with mix of themes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Paint UI with mix of themes

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


Joined: 28 February 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote CamG Quote  Post ReplyReply Direct Link To This Post Topic: Paint UI with mix of themes
    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.

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: 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
Back to Top
fredwobus View Drop Down
Newbie
Newbie
Avatar

Joined: 02 September 2004
Location: Austria
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote fredwobus Quote  Post ReplyReply Direct Link To This Post 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
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: 05 March 2005 at 5:18am
delete m_pCommandBars
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Russ View Drop Down
Groupie
Groupie
Avatar

Joined: 21 September 2003
Location: Russian Federation
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Russ Quote  Post ReplyReply Direct Link To This Post Posted: 05 December 2006 at 9:10am
you cannot use "delete m_pCommandBars"!
Back to Top
fredwobus View Drop Down
Newbie
Newbie
Avatar

Joined: 02 September 2004
Location: Austria
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote fredwobus Quote  Post ReplyReply Direct Link To This Post Posted: 05 December 2006 at 9:31am
Originally posted by Russ Russ wrote:

you cannot use "delete m_pCommandBars"!


Why ?
Back to Top
Russ View Drop Down
Groupie
Groupie
Avatar

Joined: 21 September 2003
Location: Russian Federation
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Russ Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2006 at 12:14am
because it won't compile, destructor is declared as protected

PS: using 9.51 here
Back to Top
fredwobus View Drop Down
Newbie
Newbie
Avatar

Joined: 02 September 2004
Location: Austria
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote fredwobus Quote  Post ReplyReply Direct Link To This Post 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.
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.063 seconds.