Is it possible to identify when the cursor is within a group?

Alex Tweedly alex at tweedly.net
Thu Jul 15 19:21:47 EDT 2004


At 15:38 15/07/2004 -0600, Devin Asay wrote:

>How about this, off the top of my head, not tested:
>
>on mouseEnter -- in the card script
>   get the name of target
>   if it contains "group" and the number of target = number of groups then
>     -- do stuff here
>   end if
>end mouseEnter

Unfortunately, that doesn't seem to work. It looks as though group controls 
don't receive either mouseEnter or mouseMove messages (in their own right - 
they do receive them when the target is a control within the group).

Depending on how many groups you are likely to have you could do something 
along the lines of

on mouseMove
   get the number of controls of the target
   repeat with x = 1 to it
     if the name of control x contains "group" then
       if mouseLoc() is within the rect of control x then
         put x & cr into msg    -- do your real work here
       else
         put "" into msg
       end if
     end if
   end repeat

end mouseMove

-- Alex Tweedly.

>On Jul 15, 2004, at 1:40 PM, Howard Bornstein wrote:
>
>>I create groups on the fly. I want to be able to tell when the cursor is 
>>within one of them (so the user can move the whole group). It seems that 
>>a group only knows the mouse is within it if the mouse is over one of the 
>>*objects* in the group. If I turn on the group border, I'd like to know 
>>that the mouse is within the groups border whether it's over an object in 
>>the group or not.
>>
>>I know I can test to see if the mouse is within the rect of the group, 
>>but this only works if I already know the group's name. What I'd like to 
>>be able to do is move the cursor over any part of the group (anywhere 
>>within the group's rectangle) and be able to identify the name of the group.
>>
>>Does anyone know how to do this?
>>
>>
>>Regards,
>>
>>Howard Bornstein
>>-----------------------
>>D E S I G N   E Q
>>www.designeq.com
>>_______________________________________________
>>use-revolution mailing list
>>use-revolution at lists.runrev.com
>>http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>Devin Asay
>Humanities Technology and Research Support Center
>Brigham Young University
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004

-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004


More information about the use-livecode mailing list