Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 
Developer forum

Dialog Box: toggle solid color in image


Development is currently in Archicad 24:


I would like to have a 8 swatches of color around 4 buttons in a dialog box that I could  toggle between two solid colors [red and the color of the dialog] based on the button click event.



In the ResIDs.hpp file, I have defined the ID.



#define JHP_UL_RED_T		32501




In the .grc file, I have placed the Icon in the dialog.



/* [    ] */ Icon					  20    30  135    35	JHP_UL_RED_T




In my class in the .hpp file, I am currently NOT doing anything with this icon.





I am not doing anything here because nothing was necessary to get another icon to appear in the dialog.



If I try to use this as part of the class, I get


so I keep it commented out for now.


In the Fix.grc file, if I try to set this red [255,0,0]



'GICN'	JHP_UL_RED_T "General Settings"{
	255 0 0





I get a build error



1>RFIX.WIN\JHP_UL.rc2(12): fatal error RC1015: cannot open include file 'JHP_ULFix.grc.rc2'.
1>Done building project "JHP_UL.vcxproj" -- FAILED.




Even if I could set to red in this way, it would be permanent.

Is there a function I could use to set all 8 to the dialog color and then toggle the set that corresponds to the selected button to red [255,0,0]?  Is swapping solid colors like this even possible?  Am I even close to doing this correctly?




Chris Gilmer
Intel i7-7700K CPU @ 4.20GHz
NVIDIA Quadro M4000
32.0 GB RAM
Windows 10 Pro 64-bit


Hi Chris!

1. I think the syntax in your Fix.grc file doesn't work. You can't specify a color there. You would need to use a file name (withouth the ending) there. Something like this:


'GICN'	JHP_UL_RED_T "General Settings"{


 And then you would need an image called "red_image.png" at the correct place. The correct place depends on how you call the resource compiler in your build process.


2. To show and hide this icon, you will need the item as part of your dialog class. Concerning the error there. Make sure that you uncomment all the instances of the 3 pictures you posted. (Also make sure to make unique indices in the first picture). From the error it seems you uncommented only the line in the last picture. If the error is still there then we probably need more context to debug this.

3. Other options are to setup a drawing context yourself. This is a bit more cumbersome but there's a good example Add-On in the DevKit. Check the example file: "DG_Test/Src/DrawDialogItems.cpp"

Hope this helps,

Bernd Schwarzenbacher
Archicad Add-On Developer
Get (partially free) Add-Ons at

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!