popup command: bug please confirm?

David Bovill david at openpartnership.net
Sat Jul 7 07:23:18 CDT 2007


This is a strange one and I'd suggest serious bug - can anyone confirm or
suggest a work around?

I've created a test stack here:

go to stack url "http://quality.runrev.com/qacenter/attachment.cgi?id=828"
>

which is an attachment to this bug report:

http://quality.runrev.com/qacenter/show_bug.cgi?id=5219


If you download this test stack (or just read on) - try clicking on the
player and selecting or cancelling the menu - you get the card script
triggered and there is no way to stop / block it? If you select and ungroup
the player the card script is no longer triggered.

You can build this demo up step by step as follows which proves it is
nothing to do with scripts in the demo stack but the way messages are sent
with an empty unscripted, non-background behavior group:

Create a blank stack and add a control - in my example it is a player. Add
the following script to the control:

on mouseDown
>     put the long id of btn "_Player menu" into mButton
>     popup mButton
> end mouseDown
>

So you'll need to create a  pull down button for the menu called "_Player
menu".

Now place this simple script on the card:

on mouseDown
    put the target
end mouseDown

Test it out. Choosing a menu item, or just selecting the menu and then
cancelling does what is expected - the card script is NOT triggered.

Now simply select the (player) control and group it - do nothing else - no
script in the group - no other changes.

Now test it, and at least here on OSX and I suspect on all platforms a
mousedown message gets sent to the card - and it is not possible to block
this mousedown message. For instance an attempt to put:

on menuPick  pChosen, pPrevChosen
>     -- block
> end menuPick
>
> on mouseDown pMouseBtnNum
>     -- block
> end mouseDown
>

In the btn "_Player menu" and the new group script fails to make a
difference - the only thing that fixes this is un-grouping the player
control. Can anyone confirm this bug on other platforms? It makes it
impossible to have a popup menu triggered at the card script level or above
and have different ones for controls.

Looking for a workaround so that controls can be added to a card. I want the
controls to have their own popup menus and the card to have a different one
- so that if a user clicks on the card background another menu gets
triggered. The only way I can think of doing this is to have and maintain a
transparent button on the card  behind all the controls - which is ugly.
There is no way to detect i the card script as every mousedown message
appears to come from the card.



>



More information about the use-livecode mailing list