Adjusting Edit Menu items
pete at lcsql.com
Sun May 13 17:39:19 EDT 2012
Thanks Jacque, that's sounds good but couple of questions.
You gave me the advice about locking/unlocking menus a few months back when
I was trying to manipulate the File Menu so I do have a menu group
mouseDown handler in place.
I discovered then that there's a problem with those group mouseDown
handlers on a Mac - it's impossible to tell which menu was clicked because
"target" and "me" both return the name of the menu group, not the menu that
was clicked, so you end up adjusting menus when they don't need adjusting.
To complicate matters more, on Windows, the target does return the menu
I'll go ahead and add the Edit menu processing to the mouseDown and
hopefully it will be pretty quick.
If an Edit menu item is disabled, does it's Mac command key and Windows
shortcut key equivalent still work? If not, that would be an issue with
this approach unless I watch for those keys as well as using a mouseDown
lcSQL Software <http://www.lcsql.com>
On Sun, May 13, 2012 at 12:37 PM, J. Landman Gay
<jacque at hyperactivesw.com>wrote:
> On 5/13/12 2:27 PM, Peter Haworth wrote:
>> What I have so far, which seems to work, is:
>> - on preOpenCard, check for the clipboard containing text and
>> enable/disable Paste accordingly
>> - a mouseMove handler for any editable fields that checks the selectedtext
>> and enables/disables the Edit menu cut/copy/clear items appropriately.
>> I guess I'm just wondering if mouseMove is the standard way to do this. I
>> wanted to use mouseUp but apparently mouseUp doesn't get sent to unlocked
>> text fields.
> Typically all the menu settings are adjusted in a mouseDown handler in the
> menu group script. It's nearly impossible to track everything as it
> happens. Just set up the menus when the user is actually interacting with
> On OS X, menu manipulations are slow, so be sure to "lock menus", do the
> alterations, and then "unlock menus" in your mousedown script.
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the Use-livecode