Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Color changes and the INI files
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Color changes and the INI files

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Color changes and the INI files
    Posted: 27 May 2021 at 12:46pm
I have found INI files that get pulled into the binaries that have all the color settings for various UI elements in CodeJock. We have a need to modify some of the colors such as colors used in docking panes and a few other places. I found the INI editor, which is a nifty tool I might add. Is there some way to load one of the INI file programmatically?

This would let, for example, our UX group work on color changes that until now require code changes to effect. That makes experimenting with such changes a bit of a pain. I would like to be able to load a color theme and then call to load a corresponding INI file from disk.

Alternatively, we are examining some sort of resource hacker that lets one modify the INI resource using the hacker, which I personally dislike a lot.
Back to Top
dbrookes View Drop Down
Groupie
Groupie


Joined: 30 August 2019
Location: Australia
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrookes Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2021 at 8:24pm
I've kind of played around with this a bit. At one point I patched Office 2016 colorful to have accent coloured selection highlights, I don't do that anymore because I'm lazy.

My products primary marketing colour is green, the excel accent colours are fairly close but not exact. I've thought about patching that to be closer but its a lot of colours to change. I also had a request about having some custom ribbon background images for our product.

As a test I experimented with adding a custom theme DLL that was derived from the Office 2016 DLL. You can call XTPResourceImages()->SetHandle(hMyDLL, strINI); with your own DLL handle and INI file name. I  didn't end up doing this though as I didn't think it would be as easy to maintain. As for adding custom INI files to that DLL I don't know. XTPResourceImages.h has a bunch of predefined INI file names as strings, I guess you could just pass your own string instead.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2021 at 12:36pm
Hi dbrookes,

My issue is a bit more generic as we would have to build all those custom DLLs for each team that wants customization changes. I am hoping to allow our own .ini file to reference a custom colors INI file that I could load programmatically into CodeJock directly. Guess I could read it myself and use low level APIs to change all the colors one API call at a time but am hoping to avoid that. No reply from CJ so apparently what I want isn't possible. Rats.
Back to Top
Pesci7 View Drop Down
Groupie
Groupie
Avatar

Joined: 27 January 2021
Location: Italy
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pesci7 Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2021 at 4:11pm
CXTPResourceImages has a "SetIniData" that loads an INI as string but also erases all existing values.
You can add a "LoadIniData" that has the same code as "SetIniData" but without the RemoveAll() and ClearProperties(). In this way you can overwrite existing properties.

I tried the following code that must be called immediately after XTPPaintManager()->SetTheme(paintTheme); and it changes the text size of docking pane.

LPCSTR lpIniData = "[DockingPane]\r\nFontSize = 12\r\n";
XTPResourceImages()->LoadIniData(lpIniData);

Product: Xtreme ToolkitPro (22.1.0)
Platform: Windows 11 (x64)
Language: Visual Studio 2022 (C++)
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.156 seconds.