Print Page | Close Window

Color changes and the INI files

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=24162
Printed Date: 22 December 2024 at 12:11pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Color changes and the INI files
Posted By: rdhd
Subject: Color changes and the INI files
Date 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.



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


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


Posted By: Pesci7
Date 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++)



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