cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

In ACL language, how to activate a customized menu depending on the context

SOLVED
Level 8

In ACL language, how to activate a customized menu depending on the context

Hello,

Under Arbortext Editor and  with ACL language, I would like to activate a customized menu (grayed or not) depending on the context. For example, if the cursor of the mouse is in a specific tag, the customized menu is activated. If not, the menu is disabled (grayed).

1 ACCEPTED SOLUTION

Accepted Solutions

Re: In ACL language, how to activate a customized menu depending on the context

Hello,

 

We can use this function to active or not the menu:

function activeMenu() {
if (in_context("tagname") != 1) {
return 0;
}
return 1;
}

 

and use the command lines to add the menu:

menu_add -menu -before .Help 'TEST';

menu_add .TEST. "TEST1" -cmd { test() } \
-active "activeMenu() == 1";

 

Best regards

David G

1 REPLY

Re: In ACL language, how to activate a customized menu depending on the context

Hello,

 

We can use this function to active or not the menu:

function activeMenu() {
if (in_context("tagname") != 1) {
return 0;
}
return 1;
}

 

and use the command lines to add the menu:

menu_add -menu -before .Help 'TEST';

menu_add .TEST. "TEST1" -cmd { test() } \
-active "activeMenu() == 1";

 

Best regards

David G