#!/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 "$@" windowlab 2 /on preOpenStack repeat with N = 1 to 4 unhilite of btn N of group _brushgroup end repeat set the uWindowCount of me to 1 set loc of me to the screenLoc end preOpenStack on editScript? if the optionKey is "down" then edit script of the target exit to top end if end editScript? c white ffffff ; uWindowCount 1 WindowLab U Lucida Grande U Arial U Arial U helvetica W helvetica U helvetica U helvetica U Lucida Grande cREVGeneral scriptChecksum _8XPXZ'X bookmarks handlerList preOpenStack editScript?tempScript prevHandler editScript?scriptSelection char 131 to 130script
on preOpenStack
repeat with N = 1 to 4
unhilite of btn N of group _brushgroup
end repeat
set the uWindowCount of me to 1
set loc of me to the screenLoc
end preOpenStack
on editScript?
if the optionKey is "down" then
edit script of the target
exit to top
end if
end editScript?
cREVGeometryCache stackID 1056 Phon enterInField send "mouseUp" to btn _makemask end enterInField on returnInField enterInField end returnInField on openField select the text of the target end openField --on exitField -- send "mouseUp" to btn _makemask --end exitField -- --on closeField -- exitField --end closeField ########## on mouseEnter if short name of the topstack = "windowlab" then if short name of the target is in "_livearea,_mask" then set the uAllowPaint of me to true if the hilitedButtonName of group _btns = "paint" then if the hilite of btn _e then set the eraser to 3 choose eraser tool else choose brush tool -- set the uCurrTool of me to the tool -- trackMouse end if end if else pass mouseEnter end mouseEnter --on trackMouse -- if not the uAllowPaint of me then -- killTracking -- exit trackMouse -- end if -- if not within(grc _livearea,the mouseLoc) and not within(img _mask,the mouseLoc) then -- choose browse tool -- else choose (the uCurrTool of me) -- send "trackMouse" to me in 10 milliseconds --end trackMouse --on mouseUp -- if short name of the target is in "_livearea,_mask" then resetMouse --end mouseUp on mouseMove if the uAllowPaint of me and \ not within(grc _livearea,the mouseLoc) and not within(img _mask,the mouseLoc)then resetMouse else pass mouseMove end mouseMove on resetMouse set the uAllowPaint of me to false repeat for each line L in the pendingmessages if "trackMouse" is in L then cancel item 1 of L end repeat if the tool <> "browse tool" then choose browse tool end resetMouse uAllowPaint false uCurrTool brush tool cREVGeneral scriptChecksum A^K{^e< bookmarks handlerList DenterInField returnInField openField mouseEnter mouseMove resetMousetempScript prevHandler closeFieldscriptSelection char 732 to 731scripton enterInField
send "mouseUp" to btn _makemask
end enterInField
on returnInField
enterInField
end returnInField
on openField
select the text of the target
end openField
--on exitField
-- send "mouseUp" to btn _makemask
--end exitField
--
--on closeField
-- exitField
--end closeField
##########
on mouseEnter
if short name of the topstack = "windowlab" then
if short name of the target is in "_livearea,_mask" then
set the uAllowPaint of me to true
if the hilitedButtonName of group _btns = "paint" then
if the hilite of btn _e then
set the eraser to 3
choose eraser tool
else choose brush tool
-- set the uCurrTool of me to the tool
-- trackMouse
end if
end if
else pass mouseEnter
end mouseEnter
--on trackMouse
-- if not the uAllowPaint of me then
-- killTracking
-- exit trackMouse
-- end if
-- if not within(grc _livearea,the mouseLoc) and not within(img _mask,the mouseLoc) then
-- choose browse tool
-- else choose (the uCurrTool of me)
-- send "trackMouse" to me in 10 milliseconds
--end trackMouse
--on mouseUp
-- if short name of the target is in "_livearea,_mask" then resetMouse
--end mouseUp
on mouseMove
if the uAllowPaint of me and \
not within(grc _livearea,the mouseLoc) and not within(img _mask,the mouseLoc)then
resetMouse
else pass mouseMove
end mouseMove
on resetMouse
set the uAllowPaint of me to false
repeat for each line L in the pendingmessages
if "trackMouse" is in L then cancel item 1 of L
end repeat
if the tool <> "browse tool" then choose browse tool
end resetMouse
cREVGeometryCacheIDs '1072854032044 10191072854032045 10211072854032046 10221072854032047 10231072854032048 10241072854032050 10551072854032049 10281072854032051 10331072854032052 10351072854032053 10361072854032054 10421072854032055 10431072854032056 10441072854032057 10451072854032058 10561072854032060 10471072854032059 10461072854032061 10391072854032062 10401072854032063 10411072854032064 10481072854032065 10491072854032066 10501072854032067 10511072854032068 10531072854032069 10541072854032031 10061072854032032 10071072854032033 10301072854032034 10091072854032035 10101072854032036 10201072854032037 10291072854032038 10131072854032039 10141072854032040 10161072854032041 10111072854032042 10121072854032043 1015 cREVGeometrycache order total 39 _livearea K@ 33 E E cREVGeneral revUniqueID 1072854032031 _mask Tlocal allowDrag on mouseDown if "windowlab" is in name of this stack then exit mouseDown put mouseH() & "," & mouseV() into allowDrag end mouseDown on mouseMove x,y if allowDrag is empty then exit mouseMove set topLeft of this stack to globalLoc(x-item 1 of allowDrag & "," & y-item 2 of allowDrag) end mouseMove on mouseUp put empty into allowDrag end mouseUp on mouseRelease mouseUp end mouseRelease O 1 PNG IHDR 1 ϋ gAMA =-f PLTE ٟ tRNS 0J ~IDATxб 0ð{d0tUSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSb************************************************************************************************************************************************************************************************************************************ : IENDB` cREVGeneral revUniqueID 1072854032032 _rectw )` 3 cREVGeneral revUniqueID 1072854032041 250 @ Black _recth )` 3 cREVGeneral revUniqueID 1072854032042 200 @ Black _circled )` 3 cREVGeneral revUniqueID 1072854032043 250 @ Black Build Window Ep)local showLoc on mouseUp editScript? # if the hilitedButtonName of group _btns <> "paint" then send "mouseUp" to btn _makemask put width of img _mask into W put height of img _mask into H put globalLoc(loc of this cd) into showLoc add 100 to item 2 of showLoc # ESTABLISH PROPERTIES FOR THE TEST STACK VIA THE TEMPLATE STACK put the destroyStack of the templateStack into D put the vis of the templateStack into V put rect of the templateStack into R put item 3 of the screenRect & "," & item 4 of the screenRect & ",0,0" into tRect put item 1 of tRect + W into item 3 of tRect put item 2 of tRect + H into item 4 of tRect set rect of the templateStack to tRect set the destroyStack of the templateStack to true set the vis of the templateStack to false if "_testwd" is in the mainStacks then \ set the uWindowCount of me to the uWindowCount of me + 1 put the uWindowCount of me into N # CREATE TEST WINDOW create stack ("_testwd" & N) set the defaultStack to ("_testwd" & N) copy img _mask of stack windowlab to stack ("_testwd" & N) set topLeft of img _mask to 0,0 set title of this stack to "TestWindow" show this stack set the destroyStack of the templateStack to D set the vis of the templateStack to V set rect of the templateStack to R choose browse tool # APPLY THE MASK AFTER THE WINDOW IS VISIBLE send "applyMask" && N to me in 20 milliseconds end mouseUp on applyMask N set windowShape stack ("_testwd" & N) to id of img _mask set loc of stack ("_testwd" & N) to showLoc end applyMask Black v k uWindowCount 2 cREVGeneral scriptChecksum 9&aIrevUniqueID 1072854032044 bookmarks handlerList mouseUp applyMasktempScript prevHandler applyMaskscriptSelection char 1551 to 1550scriptlocal showLoc
on mouseUp
editScript?
#
if the hilitedButtonName of group _btns <> "paint" then send "mouseUp" to btn _makemask
put width of img _mask into W
put height of img _mask into H
put globalLoc(loc of this cd) into showLoc
add 100 to item 2 of showLoc
# ESTABLISH PROPERTIES FOR THE TEST STACK VIA THE TEMPLATE STACK
put the destroyStack of the templateStack into D
put the vis of the templateStack into V
put rect of the templateStack into R
put item 3 of the screenRect & "," & item 4 of the screenRect & ",0,0" into tRect
put item 1 of tRect + W into item 3 of tRect
put item 2 of tRect + H into item 4 of tRect
set rect of the templateStack to tRect
set the destroyStack of the templateStack to true
set the vis of the templateStack to false
if "_testwd" is in the mainStacks then \
set the uWindowCount of me to the uWindowCount of me + 1
put the uWindowCount of me into N
# CREATE TEST WINDOW
create stack ("_testwd" & N)
set the defaultStack to ("_testwd" & N)
copy img _mask of stack windowlab to stack ("_testwd" & N)
set topLeft of img _mask to 0,0
set title of this stack to "TestWindow"
show this stack
set the destroyStack of the templateStack to D
set the vis of the templateStack to V
set rect of the templateStack to R
choose browse tool
# APPLY THE MASK AFTER THE WINDOW IS VISIBLE
send "applyMask" && N to me in 20 milliseconds
end mouseUp
on applyMask N
set windowShape stack ("_testwd" & N) to id of img _mask
set loc of stack ("_testwd" & N) to showLoc
end applyMask
cREVGeneral revUniqueID 1072854032038 W: cREVGeneral revUniqueID 1072854032039 H: h N cREVGeneral revUniqueID 1072854032040 Diameter: cREVGeneral revUniqueID 1072854032045 W: cREVGeneral revUniqueID 1072854032046 H: _elipsew )` 3 cREVGeneral revUniqueID 1072854032047 300 @ Black _elipseh )` 3 cREVGeneral revUniqueID 1072854032048 150 @ Black _clear ep on mouseUp editScript? lock screen select empty lock messages choose select tool drag from topLeft of img _mask to bottomright of img _mask delete choose browse tool end mouseUp Black v 9 Clear cREVGeneral scriptChecksum ʹ;5%VRV bookmarks revUniqueID 1072854032049handlerList mouseUptempScript scriptSelection char 11 to 10prevHandler mouseUpscripton mouseUp
editScript?
lock screen
select empty
lock messages
choose select tool
drag from topLeft of img _mask to bottomright of img _mask
delete
choose browse tool
end mouseUp
_makemask epon mouseUp editScript? send "mouseUp" to btn _clear set the filled to true set the brushColor to black set the lineSize to 0 put rect of img _mask into tRect switch the hilitedButtonName of group _btns case "rectangle" # DRAW FROM RIGHT TO LEFT TO ACCOUNT FOR 1 PIXEL BUG put item 1 of tRect + fld _rectw into R put item 1 of tRect into L subtract 1 from L put R into item 1 of tRect put L into item 3 of tRect put item 2 of tRect + fld _recth into item 4 of tRect if the thumbPos of scrollbar _radius > 0 then set the roundRadius to the thumbPos of scrollbar _radius choose round rect else choose rectangle tool break case "circle" put item 1 of tRect + fld _circled into item 3 of tRect put item 2 of tRect + fld _circled into item 4 of tRect choose oval tool break case "elipse" put item 1 of tRect + fld _elipsew into item 3 of tRect put item 2 of tRect + fld _elipseh into item 4 of tRect choose oval tool end switch drag from (item 1 of tRect,item 2 of tRect) to (item 3 of tRect,item 4 of tRect) # REMOVE EXTRANEOUS PIXEL ADDED TO ANY ROUNDED MASK if the hilitedButtonName of group _btns is in "circle,elipse" or \ the thumbPos of scrollbar _radius > 0 then fixCorner (item 1 of tRect & "," & item 2 of tRect) end if choose browse tool end mouseUp on fixCorner tRect set the eraser to 32 choose eraser tool click at item 1 of tRect,item 2 of tRect end fixCorner Black Sv k Preview Mask cREVGeneral scriptChecksum y.U+{MyS bookmarks revUniqueID 1072854032051handlerList mouseUp fixCornertempScript prevHandler fixCornerscriptSelection char 1421 to 1420script non mouseUp
editScript?
send "mouseUp" to btn _clear
set the filled to true
set the brushColor to black
set the lineSize to 0
put rect of img _mask into tRect
switch the hilitedButtonName of group _btns
case "rectangle"
# DRAW FROM RIGHT TO LEFT TO ACCOUNT FOR 1 PIXEL BUG
put item 1 of tRect + fld _rectw into R
put item 1 of tRect into L
subtract 1 from L
put R into item 1 of tRect
put L into item 3 of tRect
put item 2 of tRect + fld _recth into item 4 of tRect
if the thumbPos of scrollbar _radius > 0 then
set the roundRadius to the thumbPos of scrollbar _radius
choose round rect
else choose rectangle tool
break
case "circle"
put item 1 of tRect + fld _circled into item 3 of tRect
put item 2 of tRect + fld _circled into item 4 of tRect
choose oval tool
break
case "elipse"
put item 1 of tRect + fld _elipsew into item 3 of tRect
put item 2 of tRect + fld _elipseh into item 4 of tRect
choose oval tool
end switch
drag from (item 1 of tRect,item 2 of tRect) to (item 3 of tRect,item 4 of tRect)
# REMOVE EXTRANEOUS PIXEL ADDED TO ANY ROUNDED MASK
if the hilitedButtonName of group _btns is in "circle,elipse" or \
the thumbPos of scrollbar _radius > 0 then
fixCorner (item 1 of tRect & "," & item 2 of tRect)
end if
choose browse tool
end mouseUp
on fixCorner tRect
set the eraser to 32
choose eraser tool
click at item 1 of tRect,item 2 of tRect
end fixCorner
copyright White C * cREVGeneral revUniqueID 1072854032052 (WindowLab was built by Tactile Media -- www.tactilemedia.com instructions White = j cREVGeneral revUniqueID 1072854032053 )Click a Shape Profile button to create a *custom window mask. Click Build Window to +display a test window that uses your mask. +Drag your test window around the screen... +(Use command + W to close the test window) x. 9 cREVGeneral revUniqueID 1072854032054 Brush: brush1.gif @ S= FGIF89a ! , ǡP.t}yjMXS ; cREVGeneral revUniqueID 1072854032055 brush2.gif @ h@ 9GIF89a ! , `͍Z(˙ ; cREVGeneral revUniqueID 1072854032056 brush3.gif @ yC 0GIF89a ! , n Q ; cREVGeneral revUniqueID 1072854032057 u n cREVGeneral revUniqueID 1072854032059 Shape Profile _brushgroup on mouseUp editScript? hilite the target put short name of the target into B if last char of B is a number then set the brush to last char of B repeat with N = 1 to 4 if short name of btn N of me <> B then unhilite btn N of me end repeat end mouseUp / ( cREVGeneral revUniqueID 1072854032060 _6 B` 3 cREVGeneral revUniqueID 1072854032061 _7 B` 3 cREVGeneral revUniqueID 1072854032062 _8 B` 3 cREVGeneral revUniqueID 1072854032063 _e B` 3 cREVGeneral revUniqueID 1072854032064 K cREVGeneral revUniqueID 1072854032065 K h cREVGeneral revUniqueID 1072854032066 K h cREVGeneral revUniqueID 1072854032067 D * * ! ~ > 1 ~ > 1 cREVGeneral revUniqueID 1072854032068 _radius y Mon mouseUp send "mouseUp" to btn _makemask in 10 milliseconds end mouseUp # 50 cREVGeneral revUniqueID 1072854032069 brush4.gif @ A CGIF89a ! , ˡМrQ ms[}ۥEMZ ; cREVGeneral revUniqueID 1072854032058 ) i cREVGeneral revUniqueID 1072854032050 Corner Radius: _btns i Qon mouseUp enable btn _makemask send "mouseUp" to btn _makemask end mouseUp , j cREVGeneral revUniqueID 1072854032033 Rectangle @D 0 b cREVGeneral revUniqueID 1072854032034 Circle @D 0 b cREVGeneral bookmarks revUniqueID 1072854032035handlerList tempScript prevHandler scriptSelection char 1 to 0script Elipse @D 0 F cREVGeneral revUniqueID 1072854032036 Paint @D on mouseUp send "mouseUp" to btn _clear disable btn _makemask answer "Paint your own mask using the brushes & eraser!" & cr & cr &\ "Choose a brush and paint in the magenta space to create an irregular window mask..." put true into noHilites repeat with N = 1 to 4 if the hilite of btn N of group _brushgroup then put false into noHilites end repeat if noHilites then send "mouseUp" to btn 1 of group _brushgroup end mouseUp 01 F cREVGeneral scriptChecksum ЗH@revUniqueID 1072854032037 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 394 to 393script Non mouseUp
send "mouseUp" to btn _clear
disable btn _makemask
answer "Paint your own mask using the brushes & eraser!" & cr & cr &\
"Choose a brush and paint in the magenta space to create an irregular window mask..."
put true into noHilites
repeat with N = 1 to 4
if the hilite of btn N of group _brushgroup then put false into noHilites
end repeat
if noHilites then send "mouseUp" to btn 1 of group _brushgroup
end mouseUp