#!/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 "$@" E altMenuStack1on stripAndShip killImgs killTestStacks put "" into fld "menuFld" end stripAndShip on killImgs repeat with x = the number of imgs on this cd down to 1 if char 1 to 4 of the short name of img x = "menu" then delete img x end repeat end killImgs on killTestStacks if there is a stack "altTestMenu" then delete stack "altTestMenu" end killTestStacks on openStack end openStack on preOpenStack end preOpenStack on doit end doit a|BcConsNoCompilesForArchive5 currItem card id 1002 prevItem card id 1002cConsNoCompilesForSave1 UTahoma UtahomaUTahoma Wtahoma Wtahoma Utahoma UTahoma WTahomaWTahoma U Courier NewcREVGeometryCachestackID1093 cREVGeneral debugObjects @|BcREVGeometryCacheIDs113038945151010761130384390612105211303616679591006113038391093110481130389454373107711303852490871056113039151101110861130357880349100411303745304321019113039140774810821130362438390100911303894427291073113037191018210131130371914225101511303739228361017113039151099810831130382989959104011303899172531078113039153197110871130449669543109111303894456491074113038944863810751130451730922109311303761045441036cREVGeometrycachetotal24order   123456:;>?CETestEpon mouseDown if there is not a stack "altTestMenu" then answer information "Please Build Menu Stack first!" exit mouseDown end if popUp Stack "altTestMenu" end mouseDown f cREVGeneral revUniqueID 1130357880349 menuFld' {#on selectionChanged --> THIS HUNK OF CODE HELPS TO FIGURE OUT WHAT TABLE CELL YOU JUST CLICKED ON if the lockText of me is false then exit to top put word 2 of the clickLine into tRow put item 1 of the clickLoc into tXLoc subtract the left of me from tXLoc put the tabStops of me into tTabStops --> MAKE SURE THE LAST ITEM IN TABSTOPS IS > TXLOC --> JUST IN CASE THE TABSTOPS HAVE ONLY 1 ITEM --> CREATE tTabStops ITEMS repeat until last item of tTabStops > tXLoc put last item of tTabStops - item -2 of tTabStops into tIncrement put "," & last item of tTabStops + tIncrement after tTabStops end repeat put 1 into tCol repeat while item tCol of tTabStops < tXLoc add 1 to tCol end repeat set itemDel to tab if tCol = 1 then --> USER CLICKED IMAGE answer question "Import New Image?" with "Cancel" or "Clear" or "OK" if it is "Cancel" then unhiliteMe exit to top end if put "menu" & tRow into tImgName if there is an image tImgName then delete img tImgName if it is "OK" then answer file "Choose an image to import" if it is empty then exit to top put it into tPath create image tImgName set the loc of img tImgName to -1000,-1000 put URL ("binfile:" & tPath) into img tImgName end if put item 2 of line tRow of me into tMenuText put "

" & tMenuText & "

" into tHtml set the htmlText of line tRow of me to tHtml else put item tCol of line tRow of me into tClickedText put item 1 of line tRow of me into tUserID ask "New value:" with tClickedText if the result is "Cancel" then set the hilitedlines of me to "" exit to top end if put it into tNewValue put tNewValue into item tCol of line tRow of me end if send "unhiliteMe" to me in 30 milliseconds end selectionChanged on unhiliteMe put the htmlText of me into tHtml set the htmlText of me to tHtml end unhiliteMe @ hilitelinesdX cREVGeneral revUniqueID 1130361667959 breakPoints   Strongly Agree @menu1   Somewhat Agree @menu2  No Opinion @menu3   Somewhat Disagree @menu4   Strongly Disagree @menu5   - Comment @menu7   -  LinkresetEp'on mouseUp stripAndShip end mouseUp yf cREVGeneral revUniqueID 1130362438390  Label Field g cREVTable currentviewNumber of Menu Items: cREVGeneral revUniqueID 1130371910182 Number of Menu Items:Build Menu StackEp--> all handlers on mouseUp buildMenu end mouseUp on buildMenu killTestStacks create stack "altTestMenu" set the backColor of it to white set the script of it to the script of btn "MenuStackScript" of stack "altMenuStack" set the defaultStack to "altTestMenu" create group "main" set the script of it to the script of btn "MainGroupScript" of stack "altMenuStack" set the showBorder of this cd to true set the borderWidth of this cd to 1 set the threeD of this cd to false copy grc "iconBar" of stack "altMenuStack" to stack "altTestMenu" copy grc "MenuHilite" of stack "altMenuStack" to stack "altTestMenu" set the defaultStack to "altMenuStack" put fld "numMenus" into tNumMenus set the itemDel to tab put 3 into tTop put 0 into tLeft put 5 into tVertMargin put 2 into tHorizMargin #add tVertMargin to tTop add tHorizMargin to tLeft put calcMaxImgWidth() into tMaxImgWidth put calcMaxTextWidth() into tMaxTextWidth put tMaxImgWidth + tMaxTextWidth into tMenuWidth # put fld "indent" into tNumSpaces repeat with x=1 to tNumMenus put item 2 of line x of fld "menuFld" into tMenuName --> CHECK FOR SEPARATOR if tMenuName is "-" then copy grc "tempSep" to stack "altTestMenu" set the defaultStack to "altTestMenu" put the bottom of the last field into tBot set the top of the last grc to tBot +2 add the height of the last grc + 4 to tTop put the right of last fld into tLastBtnRight put tLastBtnRight -(tMaxImgWidth + (tHorizMargin*2)) into tSepWidth set the width of last grc to tSepWidth set the right of last grc to the right of last field + tHorizMargin set the defaultStack to "altMenuStack" next repeat end if set the defaultStack to "altTestMenu" create group tMenuName in group "main" set the margins of group tMenuName to 0 set the defaultStack to "altMenuStack" put "menu" & x into tImgName put 18 into tImgHeight if there is an img tImgName then put max (the height of img tImgName +4,tImgHeight) into tImgHeight copy img tImgName to grp tMenuName of stack "altTestMenu" set the topLeft of img tImgName of stack "altTestMenu" to tLeft +2,tTop+2 end if # copy btn "btnTemplate" to grp tMenuName of stack "altTestMenu" copy fld "btnTemplateFld" to grp tMenuName of stack "altTestMenu" copy btn "btnTemplate2" to grp tMenuName of stack "altTestMenu" set the name of fld "btnTemplateFld" of stack "altTestMenu" to tMenuName set the name of btn "btnTemplate2" of stack "altTestMenu" to tMenuName set the textfont of fld tMenuName of stack "altTestMenu" to "Tahoma" set the textSize of fld tMenuName of stack "altTestMenu" to "11" # set the label of fld tMenuName of stack "altTestMenu" to drawSpaces(tNumSpaces)& tMenuName set the tabStops of fld tMenuName of stack "altTestMenu" to tMaxImgWidth put tab & tMenuName into fld tMenuName of stack "altTestMenu" set the height of fld tMenuName of stack "altTestMenu" to tImgHeight set the width of fld tMenuName of stack "altTestMenu" to tMenuWidth set the topLeft of fld tMenuName of stack "altTestMenu" to tLeft,tTop set the rect of btn tMenuName of stack "altTestMenu" to the rect of fld tMenuName of stack "altTestMenu" add tImgHeight to tTop end repeat --> RESIZE STACK set the defaultStack to "altTestMenu" put the bottom of fld tMenuName +3 into tHeight put the right of fld tMenuName + tHorizMargin into tWidth put the topLeft of stack "altMenuStack" into tTL set the resizable of stack "altTestMenu" to false set the width of stack "altTestMenu" to tWidth set the height of stack "altTestMenu" to tHeight set the topLeft of stack "altTestMenu" to tTL set the layer of grc "iconBar" to bottom set the rect of grc "iconBar" to 0,0,tMaxImgWidth + (tHorizMargin*2),tHeight set the layer of grc "MenuHilite" to top set the rect of grc "MenuHilite" to the rect of fld 1 answer information "Click the Test button to popup menu stack" end buildMenu function calcMaxImgWidth put fld "numMenus" into tNumMenus put 0 into tMaxWidth repeat with x = 1 to tNumMenus put "menu" & x into tImgName if there is an img tImgName then put max(the width of img tImgName,tMaxWidth) into tMaxWidth end if end repeat return tMaxWidth end calcMaxImgWidth function calcMaxTextWidth put fld "numMenus" into tNumMenus put 0 into tMaxWidth set itemDel to tab repeat with x = 1 to tNumMenus put item 2 of line x of fld "menuFld" into tName put tName into fld "testWidth" put the formattedwidth of fld "testWidth" into tW put max(tW,tMaxWidth) into tMaxWidth end repeat return tMaxWidth end calcMaxTextWidth --function calcSpaceWidth -- put " " into fld "testWidth" -- put the formattedwidth of fld "testWidth" into t -- return (t/30) --end calcSpaceWidth function drawSpaces pNumber repeat pNumber times put space after t end repeat return t end drawSpaces fcConsLastHandlerNamebuildMenu commandcConsLastHandlerScroll436 cREVGeneral revUniqueID 1130373922836 breakPoints  Label Field ~dX cREVTable currentview

Image Text

 cREVGeneral revUniqueID 1130374530432 Image Text  numMenusip6on closeField if not isNumber(the text of me) then answer warning "Please use a number!" put 5 into me end if put the text of me into tMenuLines put the number of lines in fld "menuFld" into tFldLines if tFldLines > tMenuLines then answer question "Shorten List to " & tMenulines & " lines?" with "Cancel" or "OK" if it is "Cancel" then put the number of lines in fld "menuFld" into me exit to top end if repeat with x = tFldLines down to tMenuLines +1 delete line x of fld "menuFld" end repeat else --> ADD MORE LINES repeat with x = tFldLines to tMenuLines -1 put cr & tab after fld "menuFld" end repeat end if resizeFld end closeField on exitField closeField end exitField on resizeFld --> RESIZE FLD put the topLeft of fld "menuFld" into tTL put the botRight of fld "menuFld" into tBR put the number of lines of fld "menuFld" into tNum --> 18 IS LINEHEIGHT; 6 IS ?FACTOR put tNum * 18 + 6 into tH set the height of fld "menuFld" to tH set the topLeft of fld "menuFld" to tTL --> RESIZE STACK put the width of this stack into tW put the top of this stack into tT put the left of this stack into tL put the bottom of fld "menuFld" + 5 into tB set the rect of this stack to tL,tT,tL + tW,tT + tB end resizeFld g cREVGeneral revUniqueID 1130371914225 breakPoints  9 MenuStackScriptEp--> all handlers on openStack end openStack on preOpenStack end preOpenStack on openCard if the menuAccessMethod of this stack is "mouse" then set the menuAccessMethod of this stack to "" set the prevItem of this stack to (the currItem of this stack) set the currItem of this stack to "" else set the prevItem of this stack to (the currItem of this stack) set the currItem of this stack to (line 1 of the itemList of this stack) end if end openCard setProp CurrItem what if what <> "" then set the backgroundColor of group what to 181,190,214 set the opaque of group what to true put the rect of group what into tRect set the rect of grc "MenuHilite" to (item 1 of tRect),(item 2 of tRect),(item 3 of tRect),(item 4 of tRect) show grc "MenuHilite" end if pass CurrItem end CurrItem setProp PrevItem what if what <> "" then set the opaque of group what to false set the backgroundColor of group what to "" hide grc "MenuHilite" end if pass PrevItem end PrevItem on ExecuteMenuItem pwhat answer information "The item you selected was: '" & pwhat & "'" & cr & cr & "(Replace the code in the 'ExecuteMenuItem' handler in this stack's script with your own.)" end ExecuteMenuItem RcConsLastHandlerNameopenCard messagecConsLastHandlerScroll0 cREVGeneral revUniqueID 1130376104544 breakPoints MainGroupScriptEp--> all handlers on mouseEnter put the currItem of this stack into cItem set the prevItem of this stack to cItem put the short name of the owner of the target into newItem set the currItem of this stack to newItem end mouseEnter on mouseUp set the prevItem of this stack to (the currItem of this stack) ExecuteMenuItem (the short name of the owner of the target) end mouseUp RcConsLastHandlerNamemouseUp messagecConsLastHandlerScroll0 cREVGeneral revUniqueID 1130382989959  MenuHiliteC$$kk cREVGeneral revUniqueID 1130383910931IconBarJ@@y fillColor 222,219,214 cREVGeneral revUniqueID 1130384390612  testWidth)hu(w cREVGeneral revUniqueID 1130385249087  Link1menu1 @9DGIF89a9!,9ڋ޼H扦ʞ; cREVGeneral revUniqueID 11303894427292menu2 @9DGIF89a9!,9ڋ޼H扦ʞ; cREVGeneral revUniqueID 11303894456493menu3 @9DGIF89a9!,9ڋ޼H扦ʞ; cREVGeneral revUniqueID 11303894486384menu4 @9DGIF89a93!,9ڋ޼H扦ʞ; cREVGeneral revUniqueID 11303894515105menu5 @9DGIF89a9!,9ڋ޼H扦ʞ; cREVGeneral revUniqueID 11303894543736tempSepK@R8 cREVGeneral revUniqueID 1130389917253:togglePaletteModeA*on mouseUp if the mode of this stack is 1 then palette this stack else toplevel this stack end if end mouseUp @ cREVGeneral revUniqueID 1130391407748 ;vers on mouseUp if the shiftKey is down then ask "New Version:" with me if it is empty then exit mouseUp put it into me set the altVers of img "altPlug.png" to it end if end mouseUp +$ cREVGeneral revUniqueID 1130391510998 v0.12> altPlug.png D altVersv0.12altOpenVisibletruealtPlugFileNamealtMenuStack.rev altOnClickMedoIt altUpdateURL8http://www.gadgetplugins.com/altplugins/altMenuStack.txtMenu Stack BuilderPNG  IHDR gAMA7tEXtSoftwareAdobe ImageReadyqe<!IDATxڼV=s1}+ _a Zi/T`ZZ~CT?`l *` vN+Ve;K9=}RT=40T I>N50=D3m0ippCqڌUq#+BPZ&W` _{M# mkæy,QN "fqdN"ⴈ= b/Δ$8Ū I] 1$r:DRU#.jj *`9lB92:h4>{l#90o[A ow Vc~nΏѺR>@eڨG&@9N0?E =Fl"r. }țb do}|>E;6'mFQ)`Nv,jݗoj꟬F [#~gZSWtj^V{b98sKbcsn߸{eyOP%hZB:e2]x팴_F1vqeǞJlU_K"AW,VB-iicTgܶ [Xs0u&uvvy=UD+څf%@T_*Jg)si)ˠ L(H:8NLaAVɵhPY6H SK>.o}X\\OӇS1S)b%r%u,I"u all handlers @(dcConsLastHandlerNamecConsLastHandlerScroll0 cREVGeneral revUniqueID 1130449669543 Label:E btnTemplate2`-R cREVGeneral revUniqueID 1130451730922