resize in browse mode
Bob Hartley
rev at armbase.com
Mon Dec 27 03:51:11 EST 2004
Hi Ken and others
This works partly
>Ah, that's the problem. In order to trap the mouse going down, you'll need
>to do one of the following:
>
>1) Temporarily lock the field by trapping the "mouseWithin" of the field,
>checking for the state of the alt (option) key and then unlocking the field
>when the mouse has been released (or moved out of the field); or
>
>2) Create a separate object at the lower-right corner of the open field
>(perhaps a transparent button) that can act as a "resizer". This object
>would move along with the field as it is resized.
>
>Here's an example of the first:
>
>on mouseStillDown
> if the optionKey is down then
> put the rect of me into tRect
> put the mouseH into item 3 of tRect
> put the mouseV into item 4 of tRect
> set the rect of me to tRect
> end if
>end mouseStillDown
>
>on mouseWithin
> if the optionKey is down then
> if the lockText of me is false then
> set the lockText of me to true
> end if
> else
> if the lockText of me is true then
> set the lockText of me to false
> end if
> end if
>end mouseWithin
>
>Does this work for you?
Almost.
It works for the action I saught but it now stops the earlier grab action
to move the field with control held (It will resize with alt)
The full ascript is
on mouseDown
if the controlKey is down then
grab me
end if
end mouseDown
if the optionKey is down then
put the rect of me into tRect
put the mouseH into item 3 of tRect
put the mouseV into item 4 of tRect
set the rect of me to tRect
end if
end mouseStillDown
on mouseWithin
if the optionKey is down then
if the lockText of me is false then
set the lockText of me to true
end if
else
if the lockText of me is true then
set the lockText of me to false
end if
end if
end mouseWithin
cheers
bob
>Ken Ray
>Sons of Thunder Software
>Web site: http://www.sonsothunder.com/
>Email: kray at sonsothunder.com
>
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list