Disabling MenuItems

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri Dec 9 12:25:10 EST 2005


Hi Dave,

I create a custom property set for each language.
Each menu is a custom property in the corresponding language custom  
property set.
Of course, the same menus are stored into custom properties that have  
the same name.
Then for instance:
If I want to disable the "Paste" item in its own language in the Edit  
menu in its own language:

put "uEdit" into tMenuName
do "put the" && the uLanguage of this stack & "[" & quote & tMenuName  
& quote & "] of this stack into tMenu"

This puts the right template menu in the right language for the edit  
menu in tMenu.
(the uLanguage of this stack is the current language)
Then I do the same for my reference in English:

do "put the uEnglish["& quote & tMenuName & quote & "] of this stack  
into tRefMenu"

Then to disable the "Paste" menu item in any language:

put "(" before line lineOffset("Paste", tRefMenu) of tMenu

So managing different languages adds a line only to the basic script  
(the one that gets the reference menu :-)

Have a great Week-end too :-)
Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/


Le 9 déc. 05 à 18:00, David Burgun a écrit :

> Hi Eric,
>
> How would you handle other languages (french, english, spanish etc) ?
>
> The problem I have with menu's is how to handle them if the text of
> the menu changes due to a language change. What I do at present is to:
>
> 1.  The menu item is passed to the menuPick handler in the current  
> language.
> 2.  Figure out the Offset on the Menu Button of the menu Item.
> 3.  Look up the English Text for this item.
> 4.  Use the English Text in switch statements, if statements etc.
>
> How would you handle this using your system???
>
> Thanks a lot and have a Great Weekend
> All the Best
> Dave




More information about the use-livecode mailing list