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

Can't set icon to menu item

Anonymous
Not applicable
I try to assign to menu item "Show/close" the icon "Panel_icon".
Create icon with ID 30650
Place ID 32650 to menu text as ^32650.
But no icon pictures show in my menu (((.
------------------------------------
in RegisterInterface (void):

err = ACAPI_Register_Menu (32503, 0, MenuCode_Extras, MenuFlag_Default);
------------------------------------
in file .grc:

'STR#' 32503 "Solaris menu" {
/* [ ] */ "LabPP - Squares"
/* [ ] */ "Show/close^E3^ES^EE^EI^ED^EL^EW^ET^32650"
}
--------------------------------------
in file ...fix.grc:

'GICN' 32650 "Settings Extra page icon" {
"Panel_Icon"
0 128 128
}
--------------------------------------
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Just to make it clear:
If you register a menu item using ACAPI_Register_Menu, then you must create an 'STR#' resource for the text of the menu items into your localized GRC file.
You can set extra flags for a menu items using the '^' character.
For example "^E3^ES^32650" means that this menu will be enabled also when a 3D or Section window is active (by default Add-Ons' menu items are enabled only when the 2D floor plan window is active) and the icon with 32650 identifier will be added to the menu item.
The 32650 icon identifier refers to a 'GICN' icon resource defined in your GRC file.

See all available flags inside the documentation: http://archicadapi.graphisoft.com/documentation/required-resources

Note that from ARCHICAD 20 'GICN' icon resources can be attached to menu items (previously you had to use 'GBMP'). The possible source image formats of 'GICN' icon resources are PNG and SVG (previously you had to use BMP).

View solution in original post

3 REPLIES 3
Anonymous
Not applicable
O'h I'm so sorry))).
No 'GICN', it must be 'GBMP'.
All works properly)).
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Just to make it clear:
If you register a menu item using ACAPI_Register_Menu, then you must create an 'STR#' resource for the text of the menu items into your localized GRC file.
You can set extra flags for a menu items using the '^' character.
For example "^E3^ES^32650" means that this menu will be enabled also when a 3D or Section window is active (by default Add-Ons' menu items are enabled only when the 2D floor plan window is active) and the icon with 32650 identifier will be added to the menu item.
The 32650 icon identifier refers to a 'GICN' icon resource defined in your GRC file.

See all available flags inside the documentation: http://archicadapi.graphisoft.com/documentation/required-resources

Note that from ARCHICAD 20 'GICN' icon resources can be attached to menu items (previously you had to use 'GBMP'). The possible source image formats of 'GICN' icon resources are PNG and SVG (previously you had to use BMP).
Anonymous
Not applicable
Thank you so much !)