Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Checkbox push button icon dissapears on check

Anonymous
Not applicable
I am currently encountering an issue where the icon of a checkbox defined via GRC as "IconPushCheck" dissapears when the checkbox is checked via using DGSetItemValLong or DGSetCheckBoxState.
Is there a way around this?

Also why is the DGSetItemImageId function absent from the DG module in the current API? Am I missing something?
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Anonymous
Not applicable
Okay, I found what causes the missing/disappearing icons. For anyone else running into this: "Don't use shared image resources for your menus and toolbar." After creating duplicates for the resource entries in the grc it miraculously started to work like a charm.

The other issue with the DGSetImage method still stands though but I'll close this thread either way.

View solution in original post

9 REPLIES 9
Anonymous
Not applicable
Can anyone help me here? Am I missing something, is this the wrong board for issues like these?
Ralph Wessel
Mentor
Not sure why that's happening. We're using DGSetItemValLong on an IconPushCheck item without problems. Which version of ARCHICAD are you working with?

I think DGSetItemImageId disappeared after AC17. Use DGSetItemImage instead.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Hi, I'm using Archicad 21 (3005 USA FULL).

Aside from that there's nothing fancy in the resources at all. Basically just a couple of checkbox push buttons and regular push buttons in a pallete. I took a look at DGSetItemImage but wasn't able to get it to work, DGSetItemImageId would've been perfect for what I am trying to do.
Ralph Wessel
Mentor
Make sure none of your resources are overlapping – that can sometimes cause disappearances. Otherwise, not sure what to suggest.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
The elements are not overlapping and even setting the enabled/disabled state on the IconPushCheck buttons causes this behaviour. Oddly the icons also dissappear when the "noFrame" option is set for any IconButton.
Anonymous
Not applicable
Regarding the DGSetItemImage function btw. I am unable to get it to work because after including "DGUtility.hpp", which contains the definition of the Image class, an error pops up indicating that another .hpp is missing "NativeImage.hpp". This .hpp is missing even if I include each and every .lib present in the API DevKit.
Solution
Anonymous
Not applicable
Okay, I found what causes the missing/disappearing icons. For anyone else running into this: "Don't use shared image resources for your menus and toolbar." After creating duplicates for the resource entries in the grc it miraculously started to work like a charm.

The other issue with the DGSetImage method still stands though but I'll close this thread either way.
Ralph Wessel
Mentor
NativeImage.hpp can be found in Support/Modules/Graphix. Specify that as a search path in your project and add
#include "NativeImage.hpp"
to your code.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Ralph wrote:
NativeImage.hpp can be found in Support/Modules/Graphix. Specify that as a search path in your project and add
#include "NativeImage.hpp"
to your code.
Aaaaah, got it, Thanks a lot!