Print Page | Close Window

How to create a second paintmanager instance

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=6674
Printed Date: 12 November 2025 at 11:48am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to create a second paintmanager instance
Posted By: andolo
Subject: How to create a second paintmanager instance
Date 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 -----------






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


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


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


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


Posted By: andolo
Date Posted: 20 March 2007 at 10:53am
Sorry!

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

Thank you very much.



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