Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to create a second paintmanager instance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to create a second paintmanager instance

 Post Reply Post Reply
Author
Message
andolo View Drop Down
Groupie
Groupie
Avatar

Joined: 16 November 2005
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote andolo Quote  Post ReplyReply Direct Link To This Post Topic: How to create a second paintmanager instance
    Posted: 19 March 2007 at 12:56pm
Hi,

how can i use a second paintmanager in my executable?
the code below changes the global painmanager (XTPPaintManager())!
how can i avoid this.

Thanks in advance.
al

----------- begin snippet -----------
    m_pPaintManager = new CXTPOffice2007Theme();

    HMODULE hModule = LoadLibrary("MyOffice2007Blue.dll");
    if(hModule != NULL)
        ((CXTPOffice2007Theme*)m_pPaintManager)->SetImageHandle(hModule, NULL);
----------- end snippet -----------



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: 20 March 2007 at 2:27am
Hi,
 
by default all CXTPOffice2007Theme themes use same XTPOffice2007Images. Do you want one Office2007 use one colors and another - another?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
andolo View Drop Down
Groupie
Groupie
Avatar

Joined: 16 November 2005
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote andolo Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2007 at 4:25am
Yes, i want one global (not necessary but best for me if global) CXTPOffice2007Theme and for some special windows a set of (XTPOffice2007-)Images with colors of our company.
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: 20 March 2007 at 6:22am

You can

override CXTPOffice2007Theme,
in constructor
m_pImages = new CXTPOffice2007Images();
in destructor
delete m_pImages
 
and set this new class as paintmanager to individual commandbars
 
pCommandBars->SetPaintManager(new CMyOffice2007theme());
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
andolo View Drop Down
Groupie
Groupie
Avatar

Joined: 16 November 2005
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote andolo Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2007 at 6:50am
I can't find a member 'CXTPOffice2007Theme::m_pImages'.
The only thing i found id CXTPOffice2007Theme::GetImages() which returns
XTPOffice2007Images(), defined as follows:

//--------------------------------------------------
CXTPOffice2007Images* AFX_CDECL XTPOffice2007Images()
{
    static CXTPOffice2007Images images;
    return &images;
}
//--------------------------------------------------


when i understand right i need a second instance of these static CXTPOffice2007Images images!?
Back to Top
andolo View Drop Down
Groupie
Groupie
Avatar

Joined: 16 November 2005
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote andolo Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2007 at 10:53am
Sorry!

Found it after update from 10.3 to 10.4 source. Works!

Thank you very much.
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.