Restricting graphics to a field?

Jan Schenkel janschenkel at yahoo.com
Fri Jan 16 01:41:33 EST 2004


--- Wouter <wouter.abraham at pi.be> wrote:
> 
> Hi,
> 
> I mean an image on top of a field.
> 
> Some changes to avoid the problem caused by  the
> transparency
> and the opaque condition of the image (which can
> crash the app
> occasionally or often)
> The field will catch the mousemove as the image gets
>  a transparent 
> condition
> when drawing only one pixel.
> As there is still an unresolved bug with the select
> tool it is not 
> usable
> in this handler.
> The spray can tool is tricky too, but can be used
> with this change.
> In revolution the erasor tool and the spray can tool
> will not show 
> their icon
>   when chosen by script, in metacard they do.
> (when using drawing tools, the overhead in
> revolution is enormous 
> compared to metacard)
> 
> 
> Make the image and the "underlying" field the same
> size.
> Set the scripts of both to (I know its kind of dirty
> but is simple and 
> only for demo):
> 
> on mousemove
>    if the mouseloc is within the rect of img "xxx" 
> then
>      if the mouse is not down then
>       put the hilitedbuttonname of group "tool" into
> a
>       if a is "spray can" then choose spray can tool
>        else  choose  a  tool
>        checkformousewithin
>      end if
>    end if
> end mousemove
> 
> and set the script of the card to:
> 
> on checkformousewithin
>    if  the mouseloc is within the rect of img "xxx"
> or the mouse is down 
> then
>      send "checkformousewithin" to me in 100
> millisecs
>    else
>      choose browse tool
>    end if
> end checkformousewithin
> 
> Greetings,
> WA
> 

Hi Wouter,

The problem in combining the above approach with the
graphic tool (or buton/field tool for that matter), is
that as soon as you leave the canvas rectangle, the
graphic control is closed and non-resizable.
The behaviour an end-user would expect, is that the
graphic control is bound to the canvas rectangle, but
can be "finished" while the cursor is outside the
canvas rectangle.
And I'm not sure how to implement that : the graphic
control "officially" doesn't exist yet during creation
-- the newGraphic message is only sent when you let
go/choose the browse tool from the script.

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus


More information about the use-livecode mailing list