#!/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 "$@" 6 AnswerDialog2 2Managing Answer Dialogs ULucida Grande WLucida Grande ULucida Grande ULucida Grande UGeorgiaUGeorgia @ULucida Grande UVerdana @UVerdana UVerdana UCourier UCourier ULucida Grande UApple LiSung Light,Chinese U Baskerville UArial UBaskerville SemiboldUBaskerville Semibold WCochin WComic Sans MSULucida GrandeULucida GrandeULucida GrandeUGeorgia UComic Sans MSULucida Grande cREVOnline fingerprintHdaFCSjzLnZ_lyZX-3UUnA cREVGeneral debugObjects p`on preOpenStack set the style of this stack to "modeless" set the loc of this stack to the screenLoc end preOpenStack ------------------------------------ on preOpenCard put the scriptTextFont into tFont if tFont = empty then switch the platform case "MacOS" set the textFont of fld "Script" to "Courier" break case "Win32" set the textFont of fld "Script" to "Courier New" break default set the textFont of fld "Script" to "Helvetica" end switch else set the textFont of fld "Script" to tFont set the textSize of fld "Script" to 12 put "Enter a prompt here" into fld "Text" set the textFont of char 1 to -1 of fld "Text" to empty lock messages select text of fld "Text" unlock messages BuildCode -- enable btn "Show Dialog" end preOpenCard ------------------------------------ on selectionChanged BuildCode -- end selectionChanged ------------------------------------ on rawKeyUp BuildCode -- set the enabled of btn "Show Dialog" to fld "Text" <> empty set the enabled of btn "Copy" to fld "Script" <> empty pass rawKeyUp end rawKeyUp ------------------------------------ on BuildCode if fld "Text" = empty then put empty into fld "Script" else if the hilite of btn "Use HTML" then put the htmlText of fld "Text" into tPrompt replace quote with quote && "& quote &" && quote in tPrompt else put fld "Text" into tPrompt end if repeat with i = 1 to the number of lines of tPrompt if not the hilite of btn "Use HTML" and quote is in char 2 to -2 of line i of tPrompt then put char 2 to -2 of line i of tPrompt into tempText replace quote with quote && "& quote &" && quote in tempText put tempText into char 2 to -2 of line i of tPrompt end if if char 1 of line i of tPrompt = quote then put "quote &" && quote into char 1 of line i of tPrompt if char -1 of line i of tPrompt = quote then put quote && "& quote" into char -1 of line i of tPrompt if word 1 of line i of tPrompt <> "quote" then put quote & line i of tPrompt into line i of tPrompt if word -1 of line i of tPrompt <> "quote" then put line i of tPrompt & quote into line i of tPrompt if i > 1 then put " & cr & " before line i of tPrompt end repeat replace cr with " \" & cr in tPrompt put "put " before tPrompt put " into tPrompt" after tPrompt put cr & "answer" && the hilitedButtonName of grp "radio" && "tPrompt" && "with " after tPrompt if fld "Default" <> empty then if fld "Button3" <> empty then put quote & fld "Button3" & quote && "or " after tPrompt if fld "Button2" <> empty then put quote & fld "Button2" & quote && "or " after tPrompt put quote & fld "Default" & quote after tPrompt end if if fld "Title" <> empty then put " titled" && quote & fld "Title" & quote after tPrompt if the hilite of btn "Sheet" then put " as sheet" after tPrompt replace " &" && quote & quote & "" with empty in tPrompt replace quote & quote with quote && "& quote &" && quote in tPrompt put tPrompt & cr into fld "Script" revColorScript -- end if end BuildCode ------------------------------------------------ on revColorScript global gREVScriptColors if gREVScriptColors["if"] is empty then revSetupColors put field "script" into tScript put 1 into tCurrentWord lock screen set the textColor of word 1 to -1 of fld "script" to empty -- remove any colors in use repeat for each word w in tScript --block comment color if char 1 to 2 of w is "/*" then put true into tBlockComment end if if tBlockComment then if char 1 to 2 of w is "*/" then set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4" put false into tBlockComment else set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4" add 1 to tCurrentWord next repeat end if end if if char 1 of w is quote then set the textColor of word tCurrentWord of field "script" to empty add 1 to tCurrentWord next repeat end if if gREVScriptColors[token 1 of w] is not empty then set the textColor of token 1 of word tCurrentWord of field "script" to gREVScriptColors[token 1 of w] end if add 1 to tCurrentWord end repeat put min(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine if tOldLine is 0 then put max(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine put 0 into tLineNo repeat -- while tOldLine is not 0 if tOldLine is 0 then exit repeat add tOldLine to tLineNo put line tLineNo of tScript into tCurrentLine put the number of words in tCurrentLine into tNumWords repeat with tCurrentWord = 1 to tNumWords if char 1 of word tCurrentWord of tCurrentLine is "#" or char 1 to 2 of word tCurrentWord of tCurrentLine is "--" then put the number of words in tCurrentLine into tNumWords set the textColor of word tCurrentWord to tNumWords of line tLineNo of field "script" to "DarkOrchid4" exit repeat end if end repeat put min(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine if tOldLine is 0 then put max(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine end repeat unlock screen end revColorScript ------------------------------------------------ on revSetupColors global gREVScriptColors delete global gREVScriptColors put the cCustomColorsList of stack "revPreferences" into tColorsList put line 1 of the cBuiltInColors of stack "revPreferences" into tColor replace "command" with tColor in tColorsList repeat for each word w in the commandNames put tColor into gREVScriptColors[w] end repeat put line 2 of the cBuiltInColors of stack "revPreferences" into tColor replace "Control Structure" with tColor in tColorsList repeat for each word w in "if then else repeat for with while on end switch case getprop setprop try catch" put tColor into gREVScriptColors[w] end repeat put line 3 of the cBuiltInColors of stack "revPreferences" into tColor replace "Functions" with tColor in tColorsList repeat for each word w in the functionNames put tColor into gREVScriptColors[w] end repeat put line 4 of the cBuiltInColors of stack "revPreferences" into tColor replace "Property" with tColor in tColorsList repeat for each word w in the propertyNames put tColor into gREVScriptColors[w] end repeat put 1 into tCount put the cCustomWordList of stack "revPreferences" into tWordsList repeat for each line l in tWordsList put line tCount of tColorsList into gREVScriptColors[l] add 1 to tCount end repeat end revSetupColors ------------------------------------------------ on AnswerFramedPage pAction -- as an example; not used in this stack put "

This page uses frames:" & cr & "Can't retrieve relevant data from such an architecture." \ & cr & cr & "To" && pAction && "this reference manually:" & cr \ & cr & "1. Create a .txt file" \ & cr & "2. Put the URL into the first line of it" \ & cr & "3. Paste the contents of the page" \ & cr & "4. Name the file as you wish" \ & cr & "5. Drop the file into your local folder

" into tPrompt replace cr with "

" & cr & "

" in tPrompt -- that is the trick :-) answer error tPrompt as sheet end AnswerFramedPage  cREVGeneralscriptChecksumfIm5d bookmarks handlerListkpreOpenStack preOpenCard selectionChanged rawKeyUp BuildCode revColorScript revSetupColors AnswerFramedPage breakPoints tempScript prevHandler BuildCodescriptSelectionchar 785 to 784scripts

on preOpenStack

set the style of this stack to "modeless"

set the loc of this stack to the screenLoc

end preOpenStack

------------------------------------

on preOpenCard

put the scriptTextFont into tFont

if tFont = empty then

switch the platform

case "MacOS"

set the textFont of fld "Script" to "Courier"

break

case "Win32"

set the textFont of fld "Script" to "Courier New"

break

default

set the textFont of fld "Script" to "Helvetica"

end switch

else set the textFont of fld "Script" to tFont

set the textSize of fld "Script" to 12

put "Enter a prompt here" into fld "Text"

set the textFont of char 1 to -1 of fld "Text" to empty

lock messages

select text of fld "Text"

unlock messages

BuildCode -- 

enable btn "Show Dialog"

end preOpenCard

------------------------------------

on selectionChanged

BuildCode -- 

end selectionChanged

------------------------------------

on rawKeyUp

BuildCode -- 

set the enabled of btn "Show Dialog" to fld "Text" <> empty

set the enabled of btn "Copy" to fld "Script" <> empty

pass rawKeyUp

end rawKeyUp

------------------------------------

on BuildCode

if fld "Text" = empty then put empty into fld "Script"

else

if the hilite of btn "Use HTML" then

put the htmlText of fld "Text" into tPrompt

replace quote with quote && "& quote &" && quote in tPrompt

else

put fld "Text" into tPrompt

end if

repeat with i = 1 to the number of lines of tPrompt

if not the hilite of btn "Use HTML" and quote is in char 2 to -2 of line i of tPrompt then

put char 2 to -2 of line i of tPrompt into tempText

replace quote with quote && "& quote &" && quote in tempText

put tempText into char 2 to -2 of line i of tPrompt

end if

if char 1 of line i of tPrompt = quote then put "quote &" && quote into char 1 of line i of tPrompt

if char -1 of line i of tPrompt = quote then put quote && "& quote" into char -1 of line i of tPrompt

if word 1 of line i of tPrompt <> "quote" then put quote & line i of tPrompt into line i of tPrompt

if word -1 of line i of tPrompt <> "quote" then put line i of tPrompt & quote into line i of tPrompt

if i > 1 then put " & cr & " before line i of tPrompt

end repeat

replace cr with " \" & cr in tPrompt

put "put " before tPrompt

put " into tPrompt" after tPrompt

put cr & "answer" && the hilitedButtonName of grp "radio" && "tPrompt" && "with " after tPrompt

if fld "Default" <> empty then

if fld "Button3" <> empty then put quote & fld "Button3" & quote && "or " after tPrompt

if fld "Button2" <> empty then put quote & fld "Button2" & quote && "or " after tPrompt

put quote & fld "Default" & quote after tPrompt

end if

if fld "Title" <> empty then put " titled" && quote & fld "Title" & quote after tPrompt

if the hilite of btn "Sheet" then put " as sheet" after tPrompt

replace " &" && quote & quote & "" with empty in tPrompt

replace quote & quote with quote && "& quote &" && quote in tPrompt

put tPrompt & cr into fld "Script"

revColorScript -- 

end if

end BuildCode

------------------------------------------------

on revColorScript

global gREVScriptColors

if gREVScriptColors["if"] is empty then revSetupColors

put field "script" into tScript

put 1 into tCurrentWord

lock screen

set the textColor of word 1 to -1 of fld "script" to empty -- remove any colors in use

repeat for each word w in tScript

--block comment color

if char 1 to 2 of w is "/*" then

put true into tBlockComment

end if

if tBlockComment then

if char 1 to 2 of w is "*/" then

set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4"

put false into tBlockComment

else

set the textColor of word tCurrentWord of fld "script" to "DarkOrchid4"

add 1 to tCurrentWord

next repeat

end if

end if

if char 1 of w is quote then

set the textColor of word tCurrentWord of field "script" to empty

add 1 to tCurrentWord

next repeat

end if

if gREVScriptColors[token 1 of w] is not empty then

set the textColor of token 1 of word tCurrentWord of field "script" to gREVScriptColors[token 1 of w]

end if

add 1 to tCurrentWord

end repeat

put min(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine

if tOldLine is 0 then put max(lineoffset("#", tScript), lineoffset("--", tScript)) into tOldLine

put 0 into tLineNo

repeat -- while tOldLine is not 0

if tOldLine is 0 then exit repeat

add tOldLine to tLineNo

put line tLineNo of tScript into tCurrentLine

put the number of words in tCurrentLine into tNumWords

repeat with tCurrentWord = 1 to tNumWords

if char 1 of word tCurrentWord of tCurrentLine is "#" or char 1 to 2 of word tCurrentWord of tCurrentLine is "--" then

put the number of words in tCurrentLine into tNumWords

set the textColor of word tCurrentWord to tNumWords of line tLineNo of field "script" to "DarkOrchid4"

exit repeat

end if

end repeat

put min(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine

if tOldLine is 0 then put max(lineoffset("#", tScript, tLineNo), lineoffset("--", tScript, tLineNo)) into tOldLine

end repeat

unlock screen

end revColorScript

------------------------------------------------

on revSetupColors

global gREVScriptColors

delete global gREVScriptColors

put the cCustomColorsList of stack "revPreferences" into tColorsList

put line 1 of the cBuiltInColors of stack "revPreferences" into tColor

replace "command" with tColor in tColorsList

repeat for each word w in the commandNames

put tColor into gREVScriptColors[w]

end repeat

put line 2 of the cBuiltInColors of stack "revPreferences" into tColor

replace "Control Structure" with tColor in tColorsList

repeat for each word w in "if then else repeat for with while on end switch case getprop setprop try catch"

put tColor into gREVScriptColors[w]

end repeat

put line 3 of the cBuiltInColors of stack "revPreferences" into tColor

replace "Functions" with tColor in tColorsList

repeat for each word w in the functionNames

put tColor into gREVScriptColors[w]

end repeat

put line 4 of the cBuiltInColors of stack "revPreferences" into tColor

replace "Property" with tColor in tColorsList

repeat for each word w in the propertyNames

put tColor into gREVScriptColors[w]

end repeat

put 1 into tCount

put the cCustomWordList of stack "revPreferences" into tWordsList

repeat for each line l in tWordsList

put line tCount of tColorsList into gREVScriptColors[l]

add 1 to tCount

end repeat

end revSetupColors

------------------------------------------------

on AnswerFramedPage pAction -- as an example; not used in this stack

put "<p><b>This page uses frames:</b>" & cr & "Can't retrieve relevant data from such an architecture." \

& cr & cr & "To" && pAction && "this reference manually:" & cr \

& cr & "<i>1. Create a .txt file" \

& cr & "2. Put the URL into the first line of it" \

& cr & "3. Paste the contents of the page" \

& cr & "4. Name the file as you wish" \

& cr & "5. Drop the file into your local folder</i></p>" into tPrompt

replace cr with "</p>" & cr & "<p>" in tPrompt -- that is the trick :-)

answer error tPrompt as sheet

end AnswerFramedPage

#.!%@  345'6 Show DialogEp`on mouseUp BuildCode -- C do fld "Script" put "it variable contains:" && it end mouseUp d cREVGeneral scriptChecksumBsW;: handlerListmouseUp breakPointsscriptSelection char 19 to 18 revUniqueID 1113288937307 bookmarks tempScript prevHandlermouseUpscript2

on mouseUp

BuildCode -- C

do fld "Script"

put "it variable contains:" && it

end mouseUp

Script)h @#KV cREVGeneral revUniqueID 1113288980608  .put "

Enter a prompt here

" into tPrompt @blue * Aanswer info tPrompt with "Cancel" or "OK" titled "Test" as sheet @blue  @brown # @blue; `hLva$ESSS.png  Hon mouseDown revGoUrl "http://www.sosmartsoftware.com" end mouseDown "-PNG  IHDR". pHYs.#.#x?v 9iCCPPhotoshop ICC profilexڝwTTϽwz0z.0. Qf Ml@DEHb!(`HPb0dFJ|yyǽgs{.$O./ 'z8WGбx0Y驾A@$/7z HeOOҬT_lN:K"N3"$F/JPrb[䥟}Qd[Sl1x{#bG\NoX3I[ql2$ 8xtrp/8 pCfq.Knjm͠{r28?.)ɩL^6g,qm"[Z[Z~Q7%" 3R`̊j[~: w!$E}kyhyRm333: }=#vʉe tqX)I)B>== <8Xȉ9yP:8p΍Lg kk Ѐ$t!0V87`ɀ2A. @JPA#h'@8 .: ``a!2D!UH 2 dA>P ECqB**Z:]B=h~L2  5pN:|ó@ QC !H,G6 H9R ]H/r Aw( Q(OTJCm@*QGQ-(j MF+ 6h/*t:].G7Зw7 Xa<1:L1s3bXyeb~19 vGĩp+5qy^ oó|= ?'Htv`Ba3BDxHxE$Չ"XAP44077&9$An0;T2421t.54ld+s;# V]=iY9FgM֚k&=%Ō:nc1gcbcfX.}lGv{c)LŖN퉛w/p+/<j$.$%&㒣OdxTԂԑ4i3|o~C:&S@L u[Uo3C3OfIgwdO|;W-wsz 17jl8c͉̈́3+{%lKWr[ $ llGmnacOkE&EEY׾2⫅;K,KhtiN=e²{^-_V^Oo§s]?TWީrjVQ=w}`嚢zԶiו8>k׍ E  [ly邟~_Y53rW򯎼^{7so}x>|쇊z>yzgAMA|Q cHRMz%u0`:o_F"IDATxbax& O?"?z$<@,X< dz,,2{H?Hk4^B˧̌<4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y^<ӇXyy~~{'6~u+h ë >q^!eV w2{*wξ ?pf/+po?>+a%,-G!xs{ UziN:Lȉj?bFbFZ`X!C_5 lfUHv#H{ y*ϊa-Xc \|(:mJ[}pwwK\ӻ^7#`@jE f{&0HaOeR^b:"8r G#Rτ%P>-Z[XhWCC VAGL[X _DGY36ؘs`AX@z?6e_4B+LI=88hY X"=G1"978H3X˄ ۦ { nfh !l8t~C)yyޞoՙoo-Hu,k-Te5ʈfFK\{Hpehu?" GDÆGZK'h?D⡕B>,,7ug'H= `ı} /Q@60,lk1'!l"F?M!H \2nha?h"?͈+#Ă'?[BX?Z'$V} e@)ii@:TZVJ@, \͌o'zM[{@D}3<bhT``4Ӥ(IENDB` cREVGeneralscriptChecksum`}^.e revUniqueID 1113291554833 bookmarks handlerList mouseDown tempScript prevHandlerscriptSelection char 13 to 12script

on mouseDown

revGoUrl "http://www.sosmartsoftware.com"

end mouseDown

 Commands i%~  cREVGeneral revUniqueID 1113297858120  Text)`@#Y"y cREVGeneral bookmarks revUniqueID 1113292456037 handlerListscriptSelection char 4 to 4 prevHandler tempScriptscript  Enter a prompt here `4Zh*a$ InfoIconbB@]#" cREVGeneral revUniqueID 1113293876997   warningIconbB@"#  cREVGeneral revUniqueID 1113294094450   ErrorIconbB@!"  cREVGeneral revUniqueID 1113294123655  Radioi+on mouseUp BuildCode -- C end mouseUp e]o cREVGeneralscriptChecksum|Tzn` bookmarks revUniqueID 1113294653773 handlerListmouseUpscriptSelection char 29 to 28 prevHandler tempScriptscript

on mouseUp

BuildCode -- C

end mouseUp

info`@ia cREVGeneral revUniqueID 1113293867980 warning`@i cREVGeneral revUniqueID 1113294609789 error`@i cREVGeneral revUniqueID 1113294613623   Label Field gd cREVGeneral revUniqueID 1113297501615 Default Button: Default)p$on returnInField end returnInField @gd cREVGeneralscriptChecksumSMDƨ( revUniqueID 1113297502304 bookmarks handlerList returnInField tempScript prevHandler returnInFieldscriptSelection char 35 to 34scriptj

on returnInField

end returnInField

 OK  Label Field d cREVGeneral revUniqueID 1113297502466 Button 2: Button2)p$on returnInField end returnInField @d cREVGeneralscriptChecksumSMDƨ( revUniqueID 1113297502652 bookmarks handlerList returnInField tempScript prevHandlerscriptSelection char 35 to 34scriptj

on returnInField

end returnInField

 Cancel  Label Field d cREVGeneral revUniqueID 1113297502805 Button 3: Button3)p$on returnInField end returnInField @d cREVGeneralscriptChecksumSMDƨ( revUniqueID 1113297503005 bookmarks handlerList returnInField tempScript prevHandlerscriptSelection char 35 to 34scriptj

on returnInField

end returnInField

 Sheet`eeon mouseUp --set the enabled of grp "Title" to not the hilite of me BuildCode -- C end mouseUp )Display as sheet (Mac OS X) cREVGeneralscriptChecksum5OY0d7͠ revUniqueID 1113297775725 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 16 to 15script

on mouseUp

--set the enabled of grp "Title" to not the hilite of me

BuildCode -- C

end mouseUp

Titlei*1 cREVGeneral revUniqueID 1113298787159  Label Field #@ cREVGeneral revUniqueID 1113297647468 Title: Title)p%on returnInField end returnInField @#" cREVGeneralscriptChecksum|x..Sv9)S ` revUniqueID 1113297647513 bookmarks handlerList returnInField tempScript prevHandler returnInFieldscriptSelection char 17 to 16scriptz

on returnInField

end returnInField

 Test  StyleLabel v. cREVGeneral revUniqueID 1113298182143 <(Use the Rev Text menu to set text styles, fonts and sizes)!CopyEpon mouseUp put the selectedChunk into tChunk select text of fld "Script" copy wait 20 milliseconds if tChunk = empty then select empty else do "select" && tChunk end mouseUp F-2 cREVGeneralscriptChecksumTX ^cs7Kdx% revUniqueID 1113299326432 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 48 to 47scriptV

on mouseUp

put the selectedChunk into tChunk

select text of fld "Script"

copy

wait 20 milliseconds

if tChunk = empty then select empty

else do "select" && tChunk

end mouseUp

# Tab Menu}lon menuPick pItem lock screen set the visible of fld "Info" to pItem = "Discussion" set the visible of btn "Use HTML" to pItem <> "Discussion" set the visible of btn "Print" to pItem = "Discussion" if pItem = "Discussion" then hide fld "StyleLabel" else set the visible of fld "StyleLabel" to the hilite of btn "Use HTML" unlock screen end menuPick ~Action Discussion cREVGeneralscriptChecksum!ˉbMSl|# bookmarks revUniqueID 1113300355119 handlerListmenuPickscriptSelectionchar 211 to 210 prevHandlermenuPick tempScriptscript

on menuPick pItem

lock screen

set the visible of fld "Info" to pItem = "Discussion"

set the visible of btn "Use HTML" to pItem <> "Discussion"

set the visible of btn "Print" to pItem = "Discussion"

if pItem = "Discussion" then hide fld "StyleLabel"

else set the visible of fld "StyleLabel" to the hilite of btn "Use HTML"

unlock screen

end menuPick

% Label Field #4d cREVGeneral revUniqueID 1113300832798 Code:@ Flche2.png  PNG  IHDR Kpl_ pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb?,Xv$ϯ.?~~e'P#@11 @?~23_k_?V@p /÷>|()%ţ,%-F2\@ *n w JU牓/_ o_ū(II` b`AM]Nk5 _ ,?d+@021~K?@fӬ ~W XXY};w<||| ߿}Kw^W@koǑ74;Gڷo_߿uLL7qe`&Fqϟ_sPuFFfbA8`(10r=zk~ TxNP`=l|,IENDB` cREVGeneral revUniqueID 1113305569943. Use HTMLhEon mouseUp lock screen set the visible of fld "StyleLabel" to the hilite of me if not the hilite of me then set the textStyle of char 1 to -1 of fld "Text" to plain end if BuildCode -- C unlock screen end mouseUp ). cREVGeneralscriptChecksum2O^Z'`ͺ{`E revUniqueID 1113312698287 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelectionchar 202 to 201script

on mouseUp

lock screen

set the visible of fld "StyleLabel" to the hilite of me

if not the hilite of me then

set the textStyle of char 1 to -1 of fld "Text" to plain

end if

BuildCode -- C

unlock screen

end mouseUp

 error rduit.png B##PNG  IHDR##ٳY pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb`@ lwd` # Ģ@, 3f12cvRARb9xAfr1D59UX9Cd %IB9 4:!@ :wAwt4s @1kG !cjCO3@:aԸ&s|^\4rZ@1q/A>r1c:ʕ+ 1ȍ@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ning rduit.png 2##ӉPNG  IHDR##ٳY pHYs  gAMA|Q cHRMz%u0`:o_FIIDATxb` 01l_;ߡK{b|@Ĝ@ RUK?@ dNj.gŤX &r@L$ ӭ#,'ma,M v29C HrjfpAVm.)ļPǰb":T9 p@;o^fu 1d@!y?:U8 5N'lyԀu@1es%Pǀr;9@8o 6H (wcUZW 64Q.A ʩ'~PE B )Kת+B :Fl5 [w $&4!)P9 L+ma ֿ TY]Y$0t|Py`jq @!қ &rI !ʖ_HaPu*R'ʂ ,L/1Uh&Dz#+t w?쯇H!xZd@au+01DuL&Po'i 0Ce>D cρx 6#u%y :$@a8x5+3pAl8 0<``0͈  &re . "[d~ ,gI;ć@1a s@f| 8@1,RB ie n vB059K00:w #(T :UCA åvf1:I+ AjX(2*A$?*vb @H5+H `$^a.@+ 4_2WH}jBCVjOA  L>݂`$-:`!N8 s>v!TC L 5/Q`Er@,Oeʘ?A>!R_Ԯ ѷo W+92r\ ՜iSEq?_sg5Za\1WQ/_x~V*v3?ǞB=#?b"pC:b%TeGP# 9 X3&(;41S1;E@K g"U(r@,H.%3Rvc3`(&bă<-H Mp6w2IENDB` cREVGeneral revUniqueID 1113317835864 3 Label Field #DG cREVGeneral revUniqueID 1113318486981 Prompt: 4 Label Field DG cREVGeneral revUniqueID 1113318514005 Icon: 5 Label Field DG cREVGeneral revUniqueID 1113318538912 Buttons: 'Info!pon rawKeyUp end rawKeyUp @#4U cREVGeneralscriptChecksum]Q3U bookmarks revUniqueID 1113305374452 handlerListrawKeyUpscriptSelection char 25 to 24 prevHandlerrawKeyUp tempScriptscript`

on rawKeyUp

end rawKeyUp

 #How-To stack #014 by Eric Chatonet "  4/12/05 Initial release   (5/15/05 Text font issue on Win32 fixed   45/27/05 Modified for Tutorial Picker compatibility  , A7/31/05 Added fonts and sizes handling by the HTML code builder   7 ( Added quotes handling in prompt text TThis stack shows how to manage answer dialogs (with HTML formatting or not). Enjoy! S The Rev "built-in" Answer dialog is a simple stack you can see in the Application Browser (menu Tools) if you have checked the Revolution Ui Elements in Lists option in the View menu. ` ` e     lAnswer dialog is a substack of the Home stack, the License.rev file in the Rev main folder on your desktop. # # ' 3 >- RThis means that you can carefully edit the scripts of this stack for learning :-) Q But...   6First, play with the code builder in the Action pane! 5 ~The correct code is created and colorized on the fly. So, you can easily understand it by switching or changing the settings.  About the text edition area @1600   Use the Rev Text menu to apply text style(s), text font ot text size to any part of your prompt when the Use HTML option is checked. In all cases, to get a satisfactory layout:   Y i q? . - Add some extra carriage return if needed.  * D - Don't hesitate to split long lines: depends on your Rev version.  @  About buttons names @1600   9Rev Answer dialog allows specifying up to seven buttons. jHere only three are provided since it would not be a good idea to display more... for good ergonomics :-) |If the default button name is not filled in, the dialog displays a single button named OK: it is the Rev default behaviour.  About the icons @1600   You can specify the icon which will be displayed on the left side of the dialog box with the first parameter: info, warning or error (without quotes). If you don't specify an icon, none is displayed. n n r t {  C With Mac OS X, you can customize the displayed icons by addressing 2 global variables: gRevAppIcon and gRevAppSmallIcon (see the docs for more details). W W b g w!  About the "As Sheet" option @1600   This Mac OS X option has no effect on a previous Mac OS, Unix, or Windows system where the dialog is always displayed as a modal dialog box. # # glossary/Mac_OS.xml1 7 glossary/Unix.xml9 = glossary/Windows.xmlB V% glossary/modal_dialog_box.xml{ LWhen specifying as sheet, current title settings are ignored with Mac OS X. glossary/modal_dialog_box.xml   3   About the "Title" option @1600   `Win and Linux users are in the habit of naming such dialogs but it is not the case with Mac OS. dSo, purists will test the platform and display different dialogs according to the current platform. wWhen the as sheet option is used, the titled option is ignored on a Mac OS X system but will appear on another system.    & ,J U------------------------------------------------------------------------------------ @T @ Building prompts  JThe provided code builder produces only static dialogs (i.e. fixed text). xOften, you will need to build a dynamic prompt by concatenating quoted text, variables and/or properties. For instance: @ @ F1 3 put fld "Name" && "is unavailable." into tPrompt @blue , ' answer tPrompt with "Sorry" as sheet @blue  @brown  @blue! @blue -Here the prompt depends on a field contents. VIf this field contains "Jones", the displayed prompt will be "Jones is unavailable.". vNevertheless, you can use the provided code builder to prepare a dialog and then add any valid container to the code. +When building a prompt, rules are simple : 2 Quote always any text (including objects names) @1600 0 n Concatenate different containers by using "&" or "&&" (the last one adds a space while the first does not). @1600 g h eNote that it is always more readable to use a variable (named here tPrompt) when building your code. d  xMore advanced users will find a handler named AnswerFramedPage in the script of this card which might interest them ;-) . . >9 U------------------------------------------------------------------------------------ @T Managing the user answer  ^An answer dialog is automatically dismissed when the user clicks on any button in the dialog. GIf there is a single button in your dialog, you have nothing to do ;-) aThe name of the button onto which the user clicked is placed by the engine into the it variable. T T V tWhen more than one button was specified, you have only to get the contents of the it variable and act consequently: R R T ' answer tPrompt with "Cancel" or "OK" @blue  @brown   if it = "Cancel" then @brown  @brown  -- your instructions @brown @hh"" DarkOrchid4  else @brown  -- your instructions @brown @hh"" DarkOrchid4 end if @brown  @brown @brown And more: 7 answer tPrompt with "Cancel" or "Dismiss" or "Go On" @blue  @brown   if it = "Cancel" then @blue @brown  @brown  -- your instructions @blue @brown @hh"" DarkOrchid4  else if it = "Dismiss" then @blue @brown  @brown  -- your instructions @blue @brown @hh"" DarkOrchid4  else @blue @brown  -- your instructions @blue @brown @hh"" DarkOrchid4 end if @blue @brown  @brown @brown }You can use a switch control structure as well (with xTalks like Transcript, you can tell the story in one way or another): 7 answer tPrompt with "Cancel" or "Dismiss" or "Go On" @blue  @brown  switch it  @brown   case "Cancel" then  @brown  @brown  -- your instructions @blue @brown @hh"" DarkOrchid4 break @brown @blue  case "Dismiss" then  @brown  @brown  -- your instructions @blue @brown @hh"" DarkOrchid4 break @brown @blue  case "Go On" then  @brown  @brown  -- your instructions @blue @brown @hh"" DarkOrchid4 break @brown @blue default @blue @red 3 AnswerErr -- custom handler for error trapping  @hh"" DarkOrchid4$ end switch @brown  @brown ]Sometimes, if the user clicks on a cancel button, you will want to abort the running script: 7 answer tPrompt with "Cancel" or "Dismiss" or "Go On" @brown @blue  @brown  $ if it = "Cancel" then exit to top @brown  @brown @blue  @red  3 -- your instructions for Dismiss and Go On cases @brown @hh"" DarkOrchid4 @hh"" DarkOrchid4 @hh"" DarkOrchid4" @hh"" DarkOrchid4' @hh"" DarkOrchid4, @hh"" DarkOrchid4 U------------------------------------------------------------------------------------ @T Digging into the docs   Answer command @1600    It keyword @1600    & operator @1600     if control structure @1600     switch control structure @1600     exit control structure @1600    < gRevAppIcon and gRevAppSmallIcon keywords (Mac OS X only) @1600     " ( `g56PrintEpAon mouseUp revPrintField the name of field "Info" end mouseUp %R cREVGeneralscriptChecksum4p0G! bookmarks revUniqueID 1113391824819 handlerListmouseUpscriptSelection char 53 to 52 prevHandlermouseUp tempScriptscript

on mouseUp

revPrintField the name of field "Info"

end mouseUp