resize in browse mode
Ken Ray
kray at sonsothunder.com
Sun Dec 26 19:26:16 EST 2004
On 12/26/04 5:21 PM, "Bob Hartley" <rev at armbase.com> wrote:
>> Is the field open (i.e. you can type into it)? Because I tried this with the
>> field locked (the lockText is true) and it worked for me. If the field is
>> open, do you need to keep it open? If so, you'll need to overlay some object
>> in the "resizing" area that you want in order to be able to trap the mouse
>> doing down.
>
>
> Yes the field needs to be open.
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?
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