mouseDown and within

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sat Apr 23 07:48:16 EDT 2005


Hi Tom,

Menus are handled by the engine and unfortunately are not transcript 
statements :-( or :-)
Something like that (non tested) in the card script:

on mouseDown
   if "button" is in the target then
     CheckOtherButtons -- Æ
   end if
end mouseDown
---------------------------------------
on CheckOtherButtons
   if the mouse is up then exit CheckOtherButtons
   repeat with i = 1 to the number of btns
     if the mouseLoc is within the rect of btn i then
       set the hilite of btn i to true
   end repeat
   send "CheckOtherButtons" to me in 50 milliseconds
end CheckOtherButtons

But I would to turn your attention to another thing: I'm not sure such 
a behaviour is good ergonomics...
Best regards from Paris.

Le 23 avr. 05, ˆ 12:41, Thomas McGrath III a Žcrit :

> Thanks Eric,
>
> So my trapping the mouseDown message will break what I want to do 
> while the mouse is down?!!
>
> BUT when you mouseDown on a menu and then with it still down you nav 
> down to a sub menu it seems to still highlight text items. And the 
> same works in paint tools where you mouseDown a tool and sub to 
> another tool in a popup. Seems kinda the same...
>
> What kind of pending message is good for this and also is there a way 
> to get the button to 'highlight' without a mouseDown???
>
> Thanks again
>
> tom
>
> On Apr 23, 2005, at 4:11 AM, Eric Chatonet wrote:
>
>> Hi Tom,
>>
>> Once the mouse is down, the engine stops sending any message until 
>> the mouse is up.
>> Then some retroactive messages are sent (as mouseleave).
>> You can check this in the message watcher (where mouseStillDown is 
>> not shown).
>> So, the only way I see to do that would be using a pending message 
>> with a loop which would check other buttons status :-(
>>
>> Le 23 avr. 05, ˆ 03:56, Thomas McGrath III a Žcrit :
>>
>>> I have a few buttons and when the mouse is down over a button the 
>>> background turns blue. This is good. Now I want to have the other 
>>> buttons turn blue by still holding the mouseDown but moving it over 
>>> the other buttons and when it is over them that they will act like a 
>>> mouseDown has been sent to them.
>>>
>>> I have tried mouseDown, mouseStillDown, mouseWithin, mouseEnter etc.
>>>
>>> No luck,
>>>
>>> I might be able to do a mouseOver (SC) but prefer the mouseDown if 
>>> possible.


Amicalement,

Eric Chatonet.
----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
----------------------------------------------------------------
Web site		http://www.sosmartsoftware.com/
Email		eric.chatonet at sosmartsoftware.com/
Phone		33 (0)1 43 31 77 62
Mobile		33 (0)6 20 74 50 86
----------------------------------------------------------------



More information about the use-livecode mailing list