Load Style without cjstyles-Files? |
Post Reply |
Author | |
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
Posted: 04 March 2008 at 4:27am |
Hi. An question to skins:
Is it possible to use the "WinXP.Luna" (Blue) style without loading the WinXP.Luna.cjstyles? Our clients should get only an exe without outher Files! Is this option in the newest Version of Codejock included?
Nice Regards
Fabian
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
LoadSkin(NULL, ...);
Put the needed rc-files in your rc2-file. Search this forum! People (including me) have asked this before.
|
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Hi znakeeye.
Thanks for your tipp.
Should i set my own class delivered by CXTPSkinManagerResourceFile to use the function SetModuleHandle. This function isn't available in this class and the module handle is protected to set the handle like this: XTPSkinManager()->GetResourceFile()->SetModuleHandle(AfxGetInstanceHandle());
Best Regards
Fabian |
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Hi.
I add the rc files like this:
class CMYXTPSkinManagerResourceFile : public CXTPSkinManagerResourceFile
{ public: void SetModuleHandle(HMODULE hModule) { m_hModule = hModule; } }; XTPSkinManager()->SetResourceFile(new CMYXTPSkinManagerResourceFile);
((CMYXTPSkinManagerResourceFile*)XTPSkinManager()->GetResourceFile())->SetModuleHandle(AfxGetInstanceHandle()); XTPColorManager()->m_bEnableLunaBlueForRoyaleTheme = TRUE; XTPSkinManager()->LoadSkin(NULL, _T("NORMALBLUE.INI")); XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyMetrics | xtpSkinApplyColors); I copied the WinXP.Luna.rc File and the res Folder to my project:
MyProjectPath\Styles\WinXP.Luna.rc
MyProjectPath\Styles\res\...(ini's and bmp fpr the style)
I modified the WinXP.Luna.rc like this:
I replace the Path in WinXP.Luna.rc:
EXTRALARGEBLUE_INI TEXTFILE MOVEABLE PURE "res\\Blue_ExtraLarge.ini" to
"MyProjectPath\\Styles\\res\\Blue_ExtraLarge.ini"
... and save it.
But the result isn't with the style.
What is wrong?
Nice Regards
Fabian |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi You don't need additional class. Replace
XTPSkinManager()->SetResourceFile(new CMYXTPSkinManagerResourceFile);
((CMYXTPSkinManagerResourceFile*)XTPSkinManager()->GetResourceFile())->SetModuleHandle(AfxGetInstanceHandle()); to XTPSkinManager()->GetResourceFile()->SetModuleHandle(AfxGetInstanceHandle());
think it will work.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Hi Oleg.
I'm using Xtreme ToolkitPro v10.10. In this version CXTPSkinManagerResourceFile::SetModuleHandle isn't available.
Regards
|
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Hi. I have updated to Xtreme ToolkitPro v11.2.2. Now i can use CXTPSkinManagerResourceFile::SetModuleHandle. The result is not as expected.
If i try it like below the skin is set for each control (CXTPCommandBars):
XTPColorManager()->m_bEnableLunaBlueForRoyaleTheme = TRUE;
XTPSkinManager()->LoadSkin(strStylesPath, _T("NormalBlue.INI")); XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyMetrics | xtpSkinApplyColors); If I make it as described, CXTPCommandBars is not drawn with the Skin. XTPColorManager()->m_bEnableLunaBlueForRoyaleTheme = TRUE;
XTPSkinManager()->GetResourceFile()->SetModuleHandle(AfxGetInstanceHandle()); XTPSkinManager()->LoadSkin(NULL, _T("NORMALBLUE.ini")); XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyMetrics | xtpSkinApplyColors); my .rc2 File:
#include <XTToolkitPro.rc>
#include "Styles\WinXP.Luna\WinXP.Luna.rc" Any idee? Best Regards
Fabian
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Add XTPColorManager()->SetLunaTheme(xtpSystemThemeBlue);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
FSauer
Groupie Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
Post Options
Thanks(0)
|
Great, thank you Oleg!!!
|
|
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 |