capellan2000 at yahoo.com
Sun Feb 27 23:22:52 EST 2005
on Sun, 27 Feb 2005
Martin Blackman wrote:
> You could have something like the following in a
> or stack script.
> The button "Context" must be a popup menu button
> and be sure to set its menumousebutton property
> to 0 to prevent strange behaviour. Put it
> somewhere on the card and set its visible to false.
Excellent example, Martin!!! :-)
You will put the button in a group and reuse it
in every card where you need it.
The group needs a name (like "sharedResources")
and have set to true their "backgroundbehavior"
property. If you wish, hide the group or place
out of the visible screen locations.
-- Martin Blackman code, with button inside a group
if there is a button "Context" then
set the traversalon of btn "Context" to false
-- prevents losing selection
place bg "sharedResources" onto this card
on mouseDown theButton
if (theButton is 3) and (word 1 of the target =
-- prepare the menu if desired, eg:
-- set the enabled of menuitem 2 of btn "Context" to
-- the cAcceptPaste of the target
popup button "Context"
-- you could popup a stack too, if you wish.
-- See the documentation about "popup"
I'm sure these additions could be rewritten
with more elegance, but you get the idea!
Keep up your good code!!!
Visit my site:
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
More information about the Use-livecode