I was thinking it might have something to do with how the IDE figures out wether a stack is 'dirty' and needs to be saved or not. Perhaps just 'tickling' the auto-created image is all that is needed? By setting any property on the image control the IDE would then know the image control has been modified and along with that its parent stack too and be marked by the IDE as 'dirty'? That's a theory I have yet to test. I do know that cutting the IDE created image and pasting in place again is enough to make the IDE save the stack including the newly created painting.tperry2x wrote: ↑Mon Jun 10, 2024 3:53 pm Yes, it creates a paintimage if you select the paint tools. It doesn't create new ones if one already exists (it exits if one is already on the target card).
Yes, I don't know what was 'unsuitable' about the LCC created one. I don't think it's an engine problem, as otherwise we'd probably not be able to create a new paint image at all.
My thinking it's some property that is not being applied, but I couldn't track down how the original is supposed to be creating the image. A lot of that I did a complete rewrite on anyway, so it made sense.
Anyway, until there's something better, I've added the fix to my ideToolChanged handler, but changed it slightly:
Code: Select all
constant kPolygonMenu = "Line Tool\nRectangle Tool\nRounded Rectangle Tool\nOval Tool\nRegular Polygon Tool\nPolygon Tool" -- line tool added here - OXT
on ideToolChanged
local tTool
put the tool into tTool--;put tTool -- for debuggging - Paul
set the itemdelimiter to "\n"
if tTool is among the items of kPolygonMenu then
put "paint polygon shape tool" into tTool
end if
if tTool is among the items of kPolygonMenu or tTool = "brush tool" or tTool = "pencil tool" or tTool = "spray tool" then
put hCreateSuitableImage (tTool) into tImgCmd
send tDoImgCmd to me in 1 ticks
end if
...