A modest proposal for a new property

Quentin Long cubist at aol.com
Tue Sep 26 02:24:35 EDT 2017

In the past few List digests, there's been some discussion of practical issues regarding when a click does or doesn't count as clicking *on* a particular item. So, here's a proposed addition to LiveCode…


Name: clickableRegion

Recognized abbreviation: clickReg

"clickableRegion" is a proposed property of anything in a stack that might a user might reasonably be expected to click on—controls, that is. We're talking buttons, fields, graphics, images, yada yada yada.

The clickableRegion of a control is a return-delimited list of points that define a region of the screen. Since clickableRegion is a property of a control, the engine's internal representation of these points should probably use the location of the control as the origin (the 0,0 point) for the clickableRegion's points.

Any click whose clickLoc is within the area defined by a control's clickableRegion, will be treated by the engine as if it were a click on that control.

The default value of a control's clickableRegion should be determined by that control's visible-on-screen pixels—for fields, this should be the field's rectangle; for graphics, this should be the points of the graphic; and so on and so forth.

The clickableRegion property should be both get-able and set-able. If you clear the clickableRegion (such as by setting it to ""), it should revert back to its default value.

Since clickableRegion can be set to arbitrary values, it may well happen that 2 or more controls have overlapping clickableRegions. This may not be a problem if the engine can simply make use of whatever magic it does when it handles clickLocs which fall within the rects of 2+ overlapping buttons. If the engine's existing 'click-disambiguation' machinery does not suffice to determine which control an ambiguous click is meant for, go with the control that has the highest-value layer property.



"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"
Read the webcomic at [ http://www.atarmslength.net ]!
If you like "At Arm's Length", support it at [ http://www.patreon.com/DarkwingDude ].

More information about the Use-livecode mailing list