cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Martin Walter
Enthusiast

Add menu icon

I would like to add an icon to my menu entries:
How can I do this?
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
1 Solution

Accepted Solutions
Martin Walter
Enthusiast
I finally solved the problem for me.
The indexes are the problem. It is not working this way:
'STR#' ID_MENU_STRINGS_NEW "Menu strings" {
/* [    ] */		"Planersoftware 2.0"
/* [  1] */		"Erstelle neues Fenster oder Tür^32101"
}
But this way:
'STR#' ID_MENU_STRINGS_NEW "Menu strings" {
/* [  1] */		"Planersoftware 2.0"
/* [  2] */		"Erstelle neues Fenster oder Tür^32101"
}
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD

Go to post

17 Replies 17
Add the icon resource ID in the menu item resource like this:
"Help^32529"
Ralph Wessel BArch
Central Innovation
Martin Walter
Enthusiast
I can't get it working.
No icon pictures show in my menu.

But the image is compiled correctly because in the RO directory appears a buttonVekaCreate&96.ico file.

This is my code:
------------------------------------
in RegisterInterface (void):

err = ACAPI_Register_Menu(ID_MENU_STRINGS1, ID_STATUS_STRINGS1, MenuCode_UserDef, MenuFlag_Default);
------------------------------------
in file .grc:

'STR#' ID_MENU_STRINGS1 "Menu strings" {
/* [  1] */		"WinDoPlan"
/* [  2] */		"Neues Fenster oder Tür^33000"
}
--------------------------------------
in file ...fix.grc:

'GICN' 33000 "buttonVekaCreate icon" {
    "buttonVekaCreate"
}
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
How about the format and naming of your source images?
Ralph Wessel BArch
Central Innovation
Martin Walter
Enthusiast
I'm working on windows and saved the images into the folder ..\RFIX\Images\
as .png
e.g. buttonVekaCreate.png

and my command for compiling the resources is taken from the examples:
..\APIDevelopmentKit23\Tools\Win\ResConv.exe" -m r -D WINDOWS -T W -q utf8 1252 -i "RINT\$(ProjectName).grc" -D _DEBUG -o "$(OutDir)\RO\$(ProjectName).grc.rc2
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
Are you able to confirm that the resources and images are correctly embedded in the built add-on?
Ralph Wessel BArch
Central Innovation
Martin Walter
Enthusiast
the file ArchicadPluginFix.grc.rc2 in the RO folder looks like this:


//nclude "DGDefs.h"

/*---- This file was created by GRC compiler --------------------------------------------*/
/*                                                                                       */
/*     Source file: RFIX\ArchicadPluginFix.grc              Code table: NUL              */
/*                                                                                       */
/*---- Version 2.0 - Windows ------------------------------ (c) 1996-2019 by GRAPHISOFT -*/


#include "MDIDs_APICD.h"

32500 MDID
BEGIN
	8, 0,
	0L + 707017037,
	0L + 4022811608
END

I33000&96	ICON "buttonVekaCreate&96.ico"

I33001&96	ICON "buttonVekaChange&96.ico"

I33002&96	ICON "buttonVekaSettings&96.ico"
-------------------------------------

so the icons are created
and I find the files in the RO folder:
buttonVekaChange&96.ico
buttonVekaCreate&96.ico
buttonVekaSettings&96.ico


what else can I check?
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
Martin Walter
Enthusiast
Obviously this is a BUG in Archicad API.
For the second level menu items the icons are working.
But not for the first level:

'STR#' DGTEST_MENU_STRINGSID "Menu strings" {
/* [   ] */		"Test"
/* [   ] */		"DG Functions^10000"
/* [  1] */			"Fill Settings^EL^10000"
/* [  2] */			"Library Browser^EL^10080"
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
dushyant
Enthusiast
I am also facing the same issue - not able to get the icon at that level. And looking at ArchiCAD's default menus, icons are visible at that level. So it seems it should be possible..
I don't think the API allows you to set the icon for the parent item of a sub-menu
Ralph Wessel BArch
Central Innovation

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!