Disabling MenuItems
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Fri Dec 9 11:41:56 EST 2005
Rob,
As included in a library, your scripts look very good.
The solution I was talking about (that combines coding and custom
property) would not be suitable within a library:
A library assumes nothing but usual handling and then has directly an
effect on the menu button contents.
But as for me, I'll go on with the architecture I told you about :-)
Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------
----------------------
http://www.sosmartsoftware.com/ eric.chatonet at sosmartsoftware.com/
Le 9 déc. 05 à 16:53, Rob Cozens a écrit :
> Eric,
>
>> This way of doing eliminates all kind of error and makes completely
>> safe your menus handling.
>
> My disableMenuItems & enableMenuItems handlers will be included in
> the next release of Serendipity Library:
>
> on disableMenuItems menuButtonId, itemNumberList
> get the text of button id menuButtonId
> repeat for each item menuItemNumber in itemNumberList
> if char 1 of line menuItemNumber of it <> "(" then put "("
> before line menuItemNumber of it
> end repeat
> set the text of button id menuButtonId to it
> end disableMenuItems
>
> on enableMenuItems menuButtonId, itemNumberList
> get the text of button id menuButtonId
> repeat for each item menuItemNumber in itemNumberList
> if char 1 of line menuItemNumber of it = "(" then delete char 1
> of line menuItemNumber of it
> end repeat
> set the text of button id menuButtonId to it
> end enableMenuItems
>
> Since these are meant for gereral purpose use by other developers,
> it cannot be guaranteed that a referenced menuItem is not already
> in the desired state.
>
> BTW, I changed the itemNumberList format from return-delimited
> lines to comma-delimited items, because it's easier to script:
>
> disableMenuItems 1004,"11,13"
>
> than
>
> disableMenuItems 1004, "11"&return&"13"
>
> especially when there are many menuItems involved.
>
> With these handlers in Serendipity Library, I can now do all my
> menu setup at preOpenStack.
>
> Rob Cozens CCW
> Serendipity Software Company
>
> "And I, which was two fooles, do so grow three;
> Who are a little wise, the best fooles bee."
>
> from "The Triple Foole" by John Donne (1572-1631)
> _______________________________________________
> 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