#!/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 "$@" $Managing Entry Boxes3"Q/* Entry box stack By Eric Chatonet 9/14/06 http://www.sosmartsoftware.com/ */ on preOpenStack set the style of this stack to "modeless" set the loc of this stack to the screenLoc select after text of fld "Entry Box" end preOpenStack Managing Entry Boxes ULucida Grande ULucida Grande WLucida Grande WLucida Grande WCourier UCourier UCourier UGeorgiaUGeorgia UTahomaPulldown MenucREVGeometryCachestackID1060 cREVOnline cREVGeneralscriptChecksum]yfq debugObjects bookmarks handlerList preOpenStack tempScript prevHandler preOpenStackscriptSelectionchar 221 to 220scriptt

/*

Entry box stack

By Eric Chatonet

9/14/06

http://www.sosmartsoftware.com/

*/

on preOpenStack

set the style of this stack to "modeless"

set the loc of this stack to the screenLoc

select after text of fld "Entry Box"

end preOpenStack

 @ cREVGeometryCacheIDs 11094567106091033110935025337210141158239848980105911093500588041012115823971920510551109354974199102111093478014971006110935029907310161158239775308105711093503464431600cREVGeometrycachetotal10order1109350253372 1109350299073  cREVGeneralscriptChecksumُ B~ bookmarks handlerListscriptSelection char 1 to 0 prevHandler preOpenCard tempScriptscript

@ !#BlackCheckmark.png PNG  IHDR  pHYs  gAMA|Q cHRMz%u0`:o_FxIDATxb` 17 R@L:̤/@,0@1I +x%@LħHW ť$@PIV dĊK806IENDB` cREVGeneral revUniqueID 1109347801497SB i -m  cREVGeneral revUniqueID 1109350058804 Info ` cREVGeometry Master,movevDistancefalseMaster,scalebottomDistance-53Master,expectedRect20,205,473,352Master,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scaleBottomObjectRefcardMaster,scalerightDistanceMaster,cardRanking1Master,scaleBottomAbsolutetrueMaster,scaleBottomtrueMaster,scaletopDistanceMaster,scaleleftDistance cREVGeneral revUniqueID 1109350253372  #How-To stack #020 by Eric Chatonet " 9/14/06 Initial release   == <8Xȉ9yP:8p΍Lg kk Ѐ$t!0V87`ɀ2A. @JPA#h'@8 .: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||RZ*)b< D.N`Q+,'ۤ ԳQxɗ<~}i]`b'lg54`g|}ƉOOE.FB XKl ɻuVGDTT`}yBXvRbgW1P燔vx4v  _vM{Dun` `C73\&vU+_R^;LJן_]>[DLk~5+RigvYJQˏ[̎ZN32;?߿???ٝ;?>|sbҒڞR?>~x!*h/|&xwoJDX̎[cƒ+_ X'*fZ+k”WCּs Ý _=l>$ٹ#WTOGOGp[`0W'=?Ǡw\"zi+'Z{7Μ r7/_ZAˋfeTxoW@Ps&on?MM(WT ֥y E 6!ßon7?ҿ?>zr[ Ƿ7?y򆘦<^\۽bꅅ Wuov>ZBݩ>SV'_]:2@W_?6Zd~|t󯰲S_:w5w~O_7;GL7H^츹kfamo>xtv!޳+O=`F`]7^\9xɉ-o8ee~¯oo iWԿ=4!MU3A~1?@KOa}`~H/7737?>o(2A_?{u'>7 `==Wpi}dϧ'v.Ⱦ2Y^<Ӈ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` cREVGeometry Master,movevDistance-25Master,scalebottomDistanceMaster,expectedRect182,363,310,397Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,moveVObjectRefcardMaster,scalerightDistanceMaster,cardRanking1Master,moveVAbsolutetrue Master,moveVtrueMaster,scaletopDistanceMaster,scaleleftDistance cREVGeneralscriptChecksum`}^.e bookmarks revUniqueID 1109350299073 handlerList mouseDownscriptSelection char 13 to 12 prevHandler tempScriptscript

on mouseDown

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

end mouseDown

@ Flche2.png z 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 1109350346443  Label Field  cREVTable currentview>Play with the option menu, the entry box and see the script... cREVGeneral revUniqueID 1109354974199 ?Play with the option menu, the entry box and see the script... Show ScriptEp=on mouseUp edit the script of fld "Entry Box" end mouseUp z] cREVGeneralscriptChecksumrA46K revUniqueID 1109456710609 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 48 to 47script

on mouseUp

edit the script of fld "Entry Box"

end mouseUp

 Entry box)p on keydown pKey -- keys pressed tracking switch the menuHistory of btn "Entry Type" case 1 -- Digits only if pKey is an integer then pass keydown break ----- case 2 -- Alphanumeric only if pKey is in "abcdefghijklmnopqrstuvwxyz 1234567890" then pass keydown break ----- case 3 -- ZIP code (5 digits) if pKey is an integer and the number of chars of target < 5 then pass keydown break ----- case 4 -- Re-format ReFormat pKey,the short name of the target -- see below break default -- Any specific format RightFormat line (the menuHistory of btn "Entry Type") of btn "Entry Type",pKey,the short name of the target -- see below end switch end keydown --------------------------------- on rawKeyUp -- keys released tracking switch the menuHistory of btn "Entry Type" case 1 -- Digits only case 2 -- Alphanumeric only case 4 -- Re-format set the enabled of btn "Validate" to target <> empty break ----- case 3 -- ZIP code (5 digits) set the enabled of btn "Validate" to the number of chars of target = 5 break ----- default -- Any specific format set the enabled of btn "Validate" to the number of chars of target = the number of chars of line (the menuHistory of btn "Entry Type") of btn "Entry Type" end switch end rawKeyUp --------------------------------- on enterInField returnInField end enterInField --------------------------------- on returnInField click at the loc of btn "Validate" end returnInField --------------------------------- on ReFormat pKey,pFld local tCharNum ----- put the number of chars of the text of fld pFld into tCharNum select after text of fld pFld if IsLetter(pKey) then -- if tCharNum = 0 or charToNum(char (tCharNum) of fld pFld) = 32 then -- uppercase wanted put toUpper(pKey) after fld pFld else put toLower(pKey) after fld pFld end if else put pKey after fld pFld end if select after text of fld pFld end ReFormat --------------------------------- on RightFormat pFormat,pKey,pFld local tCharNum ----- put the number of chars of the text of fld pFld into tCharNum select after text of fld pFld if tCharNum < the number of chars of pFormat then if IsUpper(char (tCharNum + 1) of pFormat) then -- uppercase expected if IsLetter(pKey) then put toUpper(pKey) after fld pFld end if else if IsLower(char (tCharNum + 1) of pFormat) then -- lower case expected if IsLetter(pKey) then put toLower(pKey) after fld pFld end if else if char (tCharNum + 1) of pFormat is an integer then -- integer expected if pKey is an integer then put pKey after fld pFld end if else put char (tCharNum + 1) of pFormat after fld pFld -- if the user deletes a special char, it will be resrored automatically when typing any key end if select after text of fld pFld ----- adding automatically a possible special char: if not IsUpper(char (tCharNum + 2) of pFormat) and not IsLower(char (tCharNum + 2) of pFormat) and char (tCharNum + 2) of pFormat is not an integer then put char (tCharNum + 2) of pFormat after fld pFld select after text of fld pFld end if end if end RightFormat --------------------------------- function IsUpper pKey local tCharToNum ----- put charToNum(pKey) into tCharToNum return tCharToNum >= 65 and tCharToNum <= 90 end IsUpper --------------------------------- function IsLower pKey local tCharToNum ----- put charToNum(pKey) into tCharToNum return tCharToNum >= 97 and tCharToNum <= 122 end IsLower --------------------------------- function IsLetter pKey local tCharToNum ----- put charToNum(pKey) into tCharToNum return (tCharToNum >= 65 and tCharToNum <= 90) or (tCharToNum >= 97 and tCharToNum <= 122) end IsLetter Z cREVGeneral scriptChecksum쩲x)T bookmarks revUniqueID 1158239719205 breakPoints handlerListYkeydown rawKeyUp enterInField returnInField ReFormat RightFormat IsUpper IsLower IsLetterscriptSelection char 41 to 40 prevHandler enterInField tempScriptscript3

on keydown pKey -- keys pressed tracking

switch the menuHistory of btn "Entry Type"

case 1 -- Digits only

if pKey is an integer then pass keydown

break

-----

case 2 -- Alphanumeric only

if pKey is in "abcdefghijklmnopqrstuvwxyz 1234567890" then pass keydown

break

-----

case 3 -- ZIP code (5 digits)

if pKey is an integer and the number of chars of target < 5 then pass keydown

break

-----

case 4 -- Re-format

ReFormat pKey,the short name of the target -- see below

break

default -- Any specific format

RightFormat line (the menuHistory of btn "Entry Type") of btn "Entry Type",pKey,the short name of the target -- see below

end switch

end keydown

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

on rawKeyUp -- keys released tracking

switch the menuHistory of btn "Entry Type"

case 1 -- Digits only

case 2 -- Alphanumeric only

case 4 -- Re-format

set the enabled of btn "Validate" to target <> empty

break

-----

case 3 -- ZIP code (5 digits)

set the enabled of btn "Validate" to the number of chars of target = 5

break

-----

default -- Any specific format

set the enabled of btn "Validate" to the number of chars of target = the number of chars of line (the menuHistory of btn "Entry Type") of btn "Entry Type"

end switch

end rawKeyUp

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

on enterInField

returnInField

end enterInField

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

on returnInField

click at the loc of btn "Validate"

end returnInField

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

on ReFormat pKey,pFld

local tCharNum

-----

put the number of chars of the text of fld pFld into tCharNum

select after text of fld pFld

if IsLetter(pKey) then --

if tCharNum = 0 or charToNum(char (tCharNum) of fld pFld) = 32 then -- uppercase wanted

put toUpper(pKey) after fld pFld

else

put toLower(pKey) after fld pFld

end if

else

put pKey after fld pFld

end if

select after text of fld pFld

end ReFormat

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

on RightFormat pFormat,pKey,pFld

local tCharNum

-----

put the number of chars of the text of fld pFld into tCharNum

select after text of fld pFld

if tCharNum < the number of chars of pFormat then

if IsUpper(char (tCharNum + 1) of pFormat) then -- uppercase expected

if IsLetter(pKey) then

put toUpper(pKey) after fld pFld

end if

else if IsLower(char (tCharNum + 1) of pFormat) then -- lower case expected

if IsLetter(pKey) then

put toLower(pKey) after fld pFld

end if

else if char (tCharNum + 1) of pFormat is an integer then -- integer expected

if pKey is an integer then

put pKey after fld pFld

end if

else

put char (tCharNum + 1) of pFormat after fld pFld -- if the user deletes a special char, it will be resrored automatically when typing any key

end if

select after text of fld pFld

----- adding automatically a possible special char:

if not IsUpper(char (tCharNum + 2) of pFormat) and not IsLower(char (tCharNum + 2) of pFormat) and char (tCharNum + 2) of pFormat is not an integer then

put char (tCharNum + 2) of pFormat after fld pFld

select after text of fld pFld

end if

end if

end RightFormat

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

function IsUpper pKey

local tCharToNum

-----

put charToNum(pKey) into tCharToNum

return tCharToNum >= 65 and tCharToNum <= 90

end IsUpper

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

function IsLower pKey

local tCharToNum

-----

put charToNum(pKey) into tCharToNum

return tCharToNum >= 97 and tCharToNum <= 122

end IsLower

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

function IsLetter pKey

local tCharToNum

-----

put charToNum(pKey) into tCharToNum

return (tCharToNum >= 65 and tCharToNum <= 90) or (tCharToNum >= 97 and tCharToNum <= 122)

end IsLetter

 ! Validate pon mouseUp lock screen put empty into fld "Entry Box" disable me select after text of fld "Entry Box" unlock screen end mouseUp yR cREVGeneralscriptChecksumjGmNH9 bookmarks revUniqueID 1158239775308 handlerListmouseUpscriptSelectionchar 110 to 109 prevHandlermouseUp tempScriptscript

on mouseUp

lock screen

put empty into fld "Entry Box"

disable me

select after text of fld "Entry Box"

unlock screen

end mouseUp

# Entry Type u>on menuPick send "mouseUp" to btn "Validate" end menuPick !7 Digits onlyADigits only Alphanumeric only ZIP code Re-format XX-111 yy~AA/12 cREVGeneralscriptChecksum2C45_|T$ bookmarks revUniqueID 1158239848980 handlerListmenuPickscriptSelection char 38 to 37 prevHandlermenuPick tempScriptscript

on menuPick

send "mouseUp" to btn "Validate"

end menuPick