mouse over the border of a control?

Ken Norris pixelbird at interisland.net
Thu Mar 25 01:08:17 EST 2004


Hi Doug,

> Date: Wed, 24 Mar 2004 18:48:45 +0900
> From: Doug Lerner <doug at webcrossing.com>
> Subject: mouse over the border of a control?
> 
> I know there is "is within" to detect whether a mouse is within the
> rectangle of a control. Is there something for detecting whether a mouse is
> over the border of a control?
> 
> Or over one of the anchor points (resize anchors) for a control?
---------
Looks like no one responded to your query yet, so I'll take a quick shot
with what I think.

AFAIK objects don't really have borders, but rather thresholds. The mouse is
either in or out, i.e., there is no space 'between' pixels.

The borderline you see around an object (provided it _has_ a borderline) is
actually part of the object, not some kind of no-man's-land, therefore if
the mouse is 'over' the borderline, it is within the object, while if it is
over the next pixel outside the borderline, it is outside the object.

"Resize anchors" are what I believe I call drag handles, and provide some
tolerance. If the mouse is over (IOW, the mouseLoc is within the rect of)
any of the 64 pixels (8x8 grid) that make up a drag handle of a selected
object, you can drag the corner or side.

The only way I can think of to tell if the mouse is within a drag handle
area is to get the height and width of the object and calculate the offset
relative to the mouseLoc coordinates.

HTH,
Ken N.



More information about the use-livecode mailing list