Disabling MenuItems

David Burgun dburgun at dsl.pipex.com
Fri Dec 9 12:00:21 EST 2005


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

>Salut Rob,
>
>It's the reason why I told you that I prefer to use a menu template 
>stored into a custom property *without* any "(" , "!c", etc.
>Then I put the custom property into a variable and don't worry about 
>the current status of any menu item :-)
>None item, using this way, can be *already* disabled: I always use a 
>*fresh* menu and rebuild it at each call.
>It's very fast to disable, put a checkmark and so on (I have some 
>pop-up with until 5 rows and hundreds of menu items that need 300 
>lines of code to be built from the template: they appear 
>instantaneously :-)
>This way of doing eliminates all kind of error and makes completely 
>safe your menus handling.
>Just try it!
>
>Le 8 déc. 05 à 16:47, Rob Cozens a écrit :
>
>>>put "(" before line lineOffset("Paste", tMenu) of tMenu
>>>Very fast an reliable.
>>
>>What if the item is already disabled?  That's why my logic checks 
>>the char before adding a "(" on disable or blindly deleting char 1 
>>to enable.
>
>Best Regards from Paris,
>Eric Chatonet
>----------------------------------------------------------------------------------------------
>http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/
>
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your 
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list