#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" Modifying Card Dimensions 2 D/* Variation of a rev commonLib handler By Eric Chatonet 2/9/05 http://www.sosmartsoftware.com/ */ on preOpenStack set the style of this stack to "modeless" set the loc of this stack to the screenLoc end preOpenStack ------------------------------------------ on preOpenCard ChangeWindowSize fld "Width",fld "Height",fld "Delay" -- select text of fld "Height" end preOpenCard ------------------------------------------ on openCard set the label of this stack to the short name of this stack && "(card" && the number of this cd && "of 3)" end openCard ------------------------------------------ on enterInfield end enterInfield ------------------------------------------ on returnInField end returnInField ------------------------------------------ on KeyDown pKey if pKey is an integer then pass keyDown end KeyDown Main handler: ########################################## on ChangeWindowSize pWidth,pHeight,pDelay local tWidthTotal,tHeightTotal,tWidthFraction,tHeightFraction,tStackBottom,tStackRight,tTopLeft local tStart,tMillisecs,tWidthPosition,tHeightPosition ----- put pWidth - the width of this stack into tWidthTotal put pHeight - the height of this stack into tHeightTotal if tWidthTotal is 0 then put 0 into tWidthFraction else put pDelay / tWidthTotal into tWidthFraction if tHeightTotal is 0 then put 0 into tHeightFraction else put pDelay / tHeightTotal into tHeightFraction if tWidthFraction is 0 and tHeightFraction is 0 then exit ChangeWindowSize put the bottom of this stack into tStackBottom put the right of this stack into tStackRight put item 1 to 2 of the rect of this stack into tTopLeft put the milliseconds into tStart lock messages repeat put the milliseconds into tMillisecs if tWidthFraction is 0 then put 0 into tWidthPosition else put round((tMillisecs - tStart)/tWidthFraction) into tWidthPosition if tHeightFraction is 0 then put 0 into tHeightFraction else put round((tMillisecs - tStart)/tHeightFraction) into tHeightPosition set the rect of this stack to tTopLeft, tStackRight + tWidthPosition, tStackBottom + tHeightPosition if the milliseconds > tStart+pDelay then exit repeat end repeat set the rect of this stack to tTopLeft,tStackRight+tWidthTotal,tStackBottom+tHeightTotal unlock messages revUpdateGeometry -- if needed end ChangeWindowSize VT (Modifying Card Dimensions (card 1 of 3) U Lucida Grande W Lucida Grande U Lucida Grande AU Lucida Grande cREVGeometryCache stackID 1031 cREVGeneral scriptChecksum >hDy{ debugObjects handlerList UpreOpenStack preOpenCard openCard enterInfield returnInField KeyDown ChangeWindowSizebreakPoints scriptSelection char 101 to 100 bookmarks tempScript prevHandler ChangeWindowSizescript
/*
Variation of a rev commonLib handler
By Eric Chatonet
2/9/05
http://www.sosmartsoftware.com/
*/
on preOpenStack
set the style of this stack to "modeless"
set the loc of this stack to the screenLoc
end preOpenStack
------------------------------------------
on preOpenCard
ChangeWindowSize fld "Width",fld "Height",fld "Delay" --
select text of fld "Height"
end preOpenCard
------------------------------------------
on openCard
set the label of this stack to the short name of this stack && "(card" && the number of this cd && "of 3)"
end openCard
------------------------------------------
on enterInfield
end enterInfield
------------------------------------------
on returnInField
end returnInField
------------------------------------------
on KeyDown pKey
if pKey is an integer then pass keyDown
end KeyDown
Main handler:
##########################################
on ChangeWindowSize pWidth,pHeight,pDelay
local tWidthTotal,tHeightTotal,tWidthFraction,tHeightFraction,tStackBottom,tStackRight,tTopLeft
local tStart,tMillisecs,tWidthPosition,tHeightPosition
-----
put pWidth - the width of this stack into tWidthTotal
put pHeight - the height of this stack into tHeightTotal
if tWidthTotal is 0 then put 0 into tWidthFraction
else put pDelay / tWidthTotal into tWidthFraction
if tHeightTotal is 0 then put 0 into tHeightFraction
else put pDelay / tHeightTotal into tHeightFraction
if tWidthFraction is 0 and tHeightFraction is 0 then exit ChangeWindowSize
put the bottom of this stack into tStackBottom
put the right of this stack into tStackRight
put item 1 to 2 of the rect of this stack into tTopLeft
put the milliseconds into tStart
lock messages
repeat
put the milliseconds into tMillisecs
if tWidthFraction is 0 then put 0 into tWidthPosition
else put round((tMillisecs - tStart)/tWidthFraction) into tWidthPosition
if tHeightFraction is 0 then put 0 into tHeightFraction
else put round((tMillisecs - tStart)/tHeightFraction) into tHeightPosition
set the rect of this stack to tTopLeft, tStackRight + tWidthPosition, tStackBottom + tHeightPosition
if the milliseconds > tStart+pDelay then exit repeat
end repeat
set the rect of this stack to tTopLeft,tStackRight+tWidthTotal,tStackBottom+tHeightTotal
unlock messages
revUpdateGeometry -- if needed
end ChangeWindowSize
` T cREVGeometryCacheIDs 1107987138362 10181107254754961 10051114202839157 10311107986853840 10161108032018347 10291107962097453 10171107255065969 10141107254942238 10101107254942240 10121107254942239 10081107254942241 10111107255065958 10131107254822636 1006 cREVGeometrycache total 13order cREVGeneral scriptChecksum ُ B~ bookmarks handlerList tempScript prevHandler preOpenCardscriptSelection char 1 to 0script ` &