sheet not blocking?

Ken Ray kray at sonsothunder.com
Mon Sep 11 21:39:36 EDT 2006


On 9/11/06 7:11 PM, "Stephen Barncard" <stephenREVOLUTION at barncard.com>
wrote:

> No, but I've had issues with other modal dialogs I've created in
> regard to mouseclicks somehow 'clicking through' to a field below.
> 
> Ken Ray has got me out of the box, making new interfaces. In this
> case I've been experimenting with using a group as a dialog, but of
> course the problem is that execution continues. I'd somehow have to
> figure a way to fake the modality (limiting the cursor?, wait with
> messages?).

Thanks for the nod, Stephen. I think you can do what other environments that
don't have true dialogs (like Flash for example) do:

1) Design a group to be your dialog and set it at the highest layer (for my
example below, I called it "dlog". Make sure you have a way to "dismiss" it
(like an OK or Cancel button, etc.). Set the script of this button to:

  on mouseUp
    set the dialogData to "got it"
    do "hide" && (the long name of owner of me)  -- refs the group
    hide btn "Cover"
  end mouseUp

2) Create a transparent button with its autohilite, border, opaque, etc.
turned off that fills the card and set its layer to be just behind the
dialog group. Give it a name. (I called it "Cover") Hide the button.

3) Set the script of the object that calls your dialog to something like
this:

  on mouseUp
    show btn "Cover"
    set the dialogData to ""  -- or you can use a global or other container
    show group "dlog"
    wait until (the vis of group "dlog" is false) with messages
    answer the dialogdata
  end mouseUp

4) Hide the dialog group.

Now if you click on the object that opens the dialog, it will open and only
respond to clicks in the dialog group. When you click the dismissal button,
it moves on and answers the dialogData (in this case it would answer "got
it".

You can adapt this to your needs any way you want...

Enjoy!

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list