A minor enhancement: To continuously increment height or width of a new image or icon in response to mouseStillDown, replace the scripts of the Height/Width Adjustor images in Image Editor's Image Dimension group and the Icon Editor's Resize Grid group with...
Image Editor Height Adjustor--
Code: Select all
global mouse3State
local clickOffset
on mouseDown -- 8 Oct 21:RCC
put mouse(3) into mouse3State
put (item 2 of the mouseLoc)-(item 2 of the loc of me) into clickOffset
end mouseDown
on incrementField -- 8 Oct 21:RCC
if clickOffset = 0 then exit incrementField
if mouse3State is "down" then put 100 into theIncrement else put 1 into theIncrement
put the text of field "Image Height" into currentHeight
if clickOffset < 0 then add theIncrement to currentHeight else subtract theIncrement from currentHeight
if currentHeight < 1 then exit incrementField
set the text of field "Image Height" to currentHeight
end incrementField
on mouseStillDown buttonNumber -- 8 Oct 21:RCC
incrementField
put "up" into mouse3State -- Increment by 1 after the first 100 if right button is down
end mouseStillDown
on mouseUp -- 8 Oct 21:RCC
incrementField
put "up" into mouse3State
end mouseUp
Image Editor Width Adjustor--
Code: Select all
global mouse3State
local clickOffset
on mouseDown -- 11 Oct 21:RCC
put mouse(3) into mouse3State
put (item 1 of the mouseLoc)-(item 1 of the loc of me) into clickOffset
end mouseDown
on incrementField -- 11 Oct 21:RCC
if clickOffset = 0 then exit incrementField
if mouse3State is "down" then put 100 into theIncrement else put 1 into theIncrement
put the text of field "Image Width" into currentWidth
if clickOffset > 0 then add theIncrement to currentWidth else subtract theIncrement from currentWidth
if currentWidth < 1 then exit incrementField
set the text of field "Image Width" to currentWidth
end incrementField
on mouseStillDown buttonNumber -- 11 Oct 21:RCC
incrementField
put "up" into mouse3State -- Increment by 1 after the first 100 if right button is down
end mouseStillDown
on mouseUp -- 11 Oct 21:RCC
incrementField
put "up" into mouse3State
end mouseUp
Icon Editor Height Adjustor--
Code: Select all
local clickOffset
on mouseDown -- 11 Oct 21:RCC
put (item 2 of the mouseLoc)-(item 2 of the loc of me) into clickOffset
end mouseDown
on incrementField -- 11 Oct 21:RCC
constant gridRowSize = 32 -- Change this if you wish to build a larger grid
if clickOffset = 0 then exit incrementField
lock screen
put the loc of image "Icon Image" into savedLocation
get the text of field "Icon Dimensions"
put word 3 of it into currentHeight
if clickOffset < 0 then add 1 to currentHeight else subtract 1 from currentHeight
if currentHeight < 1 or currentHeight > gridRowSize then exit incrementField
put currentHeight into word 3 of it
set the text of field "Icon Dimensions" to it
set the height of image "Icon Image" to currentHeight
set the loc of image "Icon Image" to savedLocation
unlock screen
end incrementField
on mouseStillDown buttonNumber -- 11 Oct 21:RCC
incrementField
end mouseStillDown
on mouseUp -- 11 Oct 21:RCC
incrementField
end mouseUp
Icon Editor Width Adjustor-
Code: Select all
local clickOffset
on mouseDown -- 11 Oct 21:RCC
put (item 1 of the mouseLoc)-(item 1 of the loc of me) into clickOffset
end mouseDown
on incrementField -- 11 Oct 21:RCC
constant gridRowSize = 32 -- Change this if you build a larger grid
if clickOffset = 0 then exit incrementField
lock screen
put the loc of image "Icon Image" into savedLocation
get the text of field "Icon Dimensions"
put word 1 of it into currentWidth
if clickOffset > 0 then add 1 to currentWidth else subtract 1 from currentWidth
if currentWidth < 1 or currentWidth > gridRowSize then exit incrementField
put currentWidth into word 1 of it
set the text of field "Icon Dimensions" to it
set the height of image "Icon Image" to currentWidth
set the loc of image "Icon Image" to savedLocation
unlock screen
end incrementField
on mouseStillDown buttonNumber -- 11 Oct 21:RCC
incrementField
end mouseStillDown
on mouseUp -- 11 Oct 21:RCC
incrementField
end mouseUp