Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Load Style without cjstyles-Files?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Load Style without cjstyles-Files?

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

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Topic: Load Style without cjstyles-Files?
    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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 10 March 2008 at 4:10pm
Hi,
 
Add XTPColorManager()->SetLunaTheme(xtpSystemThemeBlue);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2008 at 3:41am
Great, thank you Oleg!!!
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.172 seconds.