Paint tools and image creation
mark at livecode.com
Wed Aug 23 06:04:53 EDT 2017
On 2017-08-22 20:31, Richard Gaskin via use-livecode wrote:
> Mark Waddingham wrote:
>> Basically, only the browser, pointer and help tools will recurse into
>> groups - the paint tools will not....
> ...nor drawing tools or object tools (eg field or button).
Well that's a slightly different case here - although perhaps it
explains why things are as they are.
There is explicit code which stops tools doing anything inside groups -
only the group ever receives 'mouse focus' when in one of the
drawing/object/painting tools. It *does not* recurse into children.
Thinking about it, this does make some sense; although when combined
with the 'auto-create an image if no top-level one exists', things start
to make slightly less sense.
Of course, one option (which is actually quite obvious - I think it
would work) would be to allow a tool property on images. It seems
slightly crazy that (essentially), if you switch to a paint tool you can
edit any non-referenced top-level image! Surely any app would want some
control over that (outside of the IDE, perhaps)...
> Any opportunity here to generalize the solution to accommodate this?
> tool property for groups/creating objects in groups interactively
I think that is a slightly different case to this.
Indeed, it is orthogonal to tool of image - the tool of a group could be
any tool which manipulates objects (including creation), as a group
contains objects; the tool of an image could be any tool which
manipulates pixels, as an image is a collection of pixels.
I fear that these two parts of code are quite distinct, however, so it
isn't a case of do one and get the other free... The image one is
probably quite straight-forward (although, I could well be wrong); the
group one (judging by the code I delved into y'day) not so
P.S. This idea might also give a much better way to do the 'editMode' of
graphics - i.e. a tool property which determines the mouse interactions
within the graphic. I wish I had seen that potential pattern years ago
when we added editMode...
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
More information about the Use-livecode