The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: ejrolon, Barry Kelly, Karl Ottenstein, LaszloNagy, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy, rmasaki

By Martin Walter
#308079
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"
}
By dushyant
#308109
Hi Martin,
I just tried indexing your way (starting from 1 for the main menu), but I'm still not getting the menu-icon.

Dushyant Basson
By dushyant
#308278
In your attached example,
DG_Test.grc has: "DG Functions^10000"
But DG_TestFix.grc has no identifier with 10000.
User avatar
By Ralph Wessel
#308283
Martin Walter wrote:
Sat Mar 07, 2020 2:41 pm
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"
}
Those aren't indices – they're just comments. The compiler ignores them, so they could contain nothing or not be there at all. We put them in as an easy visual check when referencing the menu items in code, i.e. ensuring the code aligns to the resources.
By dushyant
#308289
What guides the indenting of sub-menus? How to control which sub-menu can further have its own sub-menus?
User avatar
By Ralph Wessel
#308291
If you're adding a custom menu, the number of items in the resource determines if it's a single menu item of a submenu. If there's only 2 items, the first is the main menu and the second is the menu item. If more than 2, the first is them main menu, the second is the submenu and any additional items are listed under the submenu. You can't nest menus any deeper than that.
For example:
Code: Select all
'STR#' 32510  "Nested Menu" {
	"Main Menu"
	"Submenu"
	"Item 1"
	"Item 2"
	"Item 3"
}


'STR#' 32511  "Single Item" {
	"Main Menu"
	"Item 1"
}
The single menu item and submenu above will both appear under the menu "Main Menu".