Print Page | Close Window

Load Style without cjstyles-Files?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=9783
Printed Date: 26 June 2024 at 1:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Load Style without cjstyles-Files?
Posted By: FSauer
Subject: Load Style without cjstyles-Files?
Date 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



Replies:
Posted By: znakeeye
Date Posted: 07 March 2008 at 2:58am
LoadSkin(NULL, ...);
 
Put the needed rc-files in your rc2-file. Search this forum! People (including me) have asked this before.


Posted By: FSauer
Date Posted: 07 March 2008 at 4:06am
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


Posted By: FSauer
Date Posted: 07 March 2008 at 5:06am
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


Posted By: Oleg
Date Posted: 07 March 2008 at 3:29pm

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


Posted By: FSauer
Date Posted: 10 March 2008 at 10:59am
Hi Oleg.
 
I'm using Xtreme ToolkitPro v10.10. In this version CXTPSkinManagerResourceFile::SetModuleHandle isn't available.
 
Regards


Posted By: FSauer
Date Posted: 10 March 2008 at 12:51pm

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


Posted By: Oleg
Date Posted: 10 March 2008 at 4:10pm
Hi,
 
Add XTPColorManager()->SetLunaTheme(xtpSystemThemeBlue);


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


Posted By: FSauer
Date Posted: 11 March 2008 at 3:41am
Great, thank you Oleg!!!



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