#!/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 waitings2 \/* Managing user waiting Stack By Eric Chatonet 3/16/05 http://www.sosmartsoftware.com/ */ T3XuBusy %3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3Ecursor+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eto+busy%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BUse+this+line+of+code+inside+a+%3Cb%3Erepeat+loop%3C%2Fb%3E+for+a+longer+waiting+time+%3Cb%3Eon+Mac+OS%3C%2Fb%3E%3A+on+Win+XP%2C+prefer+using+the+watch+cursor+outside+a+loop+since+it+is+already+an+animated+cursor.+This+means+that+purists+will+not+use+the+same+cursors+according+to+the+current+platform...%3C%2Fp%3E%0D%0A%3Cp%3E%3Ci%3EThe+beach+ball+rotates+automatically+by+an+eighth+at+each+call.%3C%2Fi%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%26%239%3B%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Erepeat+for+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eeach+line+l+in+tList%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%26%239%3B%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E++%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3Ecursor+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eto+busy%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%26%239%3B%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E++DoMyStuff%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%26%239%3B%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Eend%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Erepeat%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BWhen+the+cursor+is+busy%2C+the+user+knows+that+your+app+did+not+crash+%3A-%29%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BRevolution+resets+automatically+the+cursor+to+the+default+cursor+when+the+handler+finishes.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BCheck+%3Ca%3Ecursor%3C%2Fa%3E+global+property%2C+%3Ca%3Ebusy%3C%2Fa%3E+constant+and+%3Ca%3Erepeat%3C%2Fa%3E+control+structure+in+the+Revolution+documentation.%3C%2Fp%3EuGeneralities$%3Cp%3E%3Cb%3EHow-To+stack+%23011+by+Eric+Chatonet%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E3%2F16%2F05%26%239%3B%26%239%3BInitial+release%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+color%3D%22%23000000%22%3E5%2F27%2F05%26%239%3B%26%239%3BModified+for+Tutorial+Picker+compatibility%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Ci%3EGood+ergonomics+takes+care+of+managing+user+waitings.%3C%2Fi%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Ci%3EThis+stack+shows+the+different+ways+of+indicating+to+the+user+that+he+has+to+wait+a+moment+.%3C%2Fi%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Ci%3EEnjoy%21%3C%2Fi%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BUsing+the+watch+cursor+during+very+short+tasks+is+not+a+good+idea+since+user%27s+perception+will+be+%3Cb%3Ethis+app+is+slow%21%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BDon%27t+using+any+means+of+indicating+to+the+user+that+your+app+is+running+a+long+task+is+a+bad+idea+too%3A%3Cb%3E+this+app+crashed%21%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BIn+addition%2C+task+length+often+depends+on+the+situation%3A+%3Cb%3Ecomputer+speed+and+current+process%3C%2Fb%3E++%28you+don%27t+know+if+a+folder+dropped+by+the+user+contains+1%2C+10+or+500+files%29.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Ci%3ESometimes+you+will+have+to+check+first+the+task+length+to+determine+if+an+indication+is+needed%3A+for+instance%2C+see+the+scripts+of+the+Rev+Application+Browser+where+a+specific+cursor+is+only+used+when+the+length+of+a+list+counts+more+than+50+lines.%3C%2Fi%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EThere+are+many+ways+of+indicating+waiting+time+%3A+%3Cb%3Estatic+cursors%3C%2Fb%3E+%28like+watch+on+Mac+OS%29%2C+%3Cb%3Eanimated+cursors%3C%2Fb%3E+%28like+busy+cursor%29%2C+%3Cb%3Eanimated+gifs%3C%2Fb%3E+%28like+chasing+arrows+or+%26quot%3Bbarber+poll%26quot%3B%29+and+%3Cb%3Eprogression+bars%3C%2Fb%3E+%28more+accurate+for+long+tasks%29.%3C%2Fp%3E%0D%0A%3Cp%3ELet+us+see+when+and+how+to+use+them%21%3C%2Fp%3E uProgress%3Cp%3E%3Cb%3EUsing+a+progress+bar+%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EA+progress+bar+is+a+control%2C+as+a+button+or+a+field%2C+which+belongs+to+scrollbars+family.%3C%2Fp%3E%0D%0A%3Cp%3E3+properties+let+you+manage+this+specific+scrollbar%3A%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3B%3Cb%3EstartValue%3C%2Fb%3E+is+an+integer+which+specifies+the+value+corresponding+to+the+start+position+%28often+zero%29.%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3B%3Cb%3EendValue%3C%2Fb%3E+is+an+integer+which+specifies+the+value+corresponding+to+the+end+position.%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3B%3Cb%3EthumbPosition%3C%2Fb%3E+is+an+integer+between+start+and+end+values+which+specifies+the+current+position.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cb%3EHow+to+initialize+the+progress+bar+with+the+right+values%3A%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EImagine+you+have+x+files+to+process+%28here+a+list+of+lines+stored+into+a+variable+named+tList%29%3A%3C%2Fp%3E%0D%0A%3Cp%3EYou+will+specify+the+number+of+files+as+the+%3Ca%3Eendvalue%3C%2Fa%3E.%3C%2Fp%3E%0D%0A%3Cp%3EThe+%3Ca%3EstartValue%3C%2Fa%3E+and+the+%3Ca%3EthumbPos%3C%2Fa%3E+will+be+zero%3A%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3EstartValue+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+sb+%26quot%3BProg%26quot%3B+to+0%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3Eendvalue+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+sb+%26quot%3BProg%26quot%3B+to+%5C%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E++++the+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3Enumber+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+lines+of+tList%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3EthumbPos+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+sb+%26quot%3BProg%26quot%3B+to+0%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cb%3EHow+to+increment+the+progress+bar%3A%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EThen+you+will+fix+the+%3Ca%3EthumbPos%3C%2Fa%3E+property+inside+your+processing+repeat+loop%3A%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eput+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E0+into+tPos%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Erepeat+for%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E+each+line+tLine+in+tList%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E++%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eadd+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E1+to+tPos%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E++%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3EthumbPos+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+sb+%26quot%3BProgress%26quot%3B+to+tPos%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E++DoMyStuff+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%2368228B%22%3E--+the+stuff+you+need+to+do%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Eend%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Erepeat%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3ENote+that+we+use+the+%3Cb%3Erepeat+for+each%3C%2Fb%3E+form+%28very+faster+with+long+lists%29+and+implement+a+variable+to+find+a+value+again+as+in+the+%3Cb%3Erepeat+with+i%3C%2Fb%3E+form.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cb%3EHow+to+do+with+long+tasks+and+short+lists%3A%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EWhen+the+task+is+long+and+the+number+of+loops+short%2C+it+is+not+easy+to+avoid+feeling+sharp+steps.%3C%2Fp%3E%0D%0A%3Cp%3EA+workaround+is+to+set+the+thumbPos+as+well+during+the+process+and+calculate+the+right+%3Ca%3EendValue%3C%2Fa%3E+at+the+beginning.%3C%2Fp%3E%0D%0A%3Cp%3EYou+will+add+a+handler+as+the+following+and+call+it+from+differents+places+inside+your+processing+repeat+loop%3A%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Eon+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3EShowProgress%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3E++put+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3EthumbPos+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+sb+%26quot%3BProgress%26quot%3B+into+tPos%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3E++add+1%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3E+to+tPos%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3E++set+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3EthumbPos+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eof+sb+%26quot%3BProgress%26quot%3B+to+tPos%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23980517%22%3Eend+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3EShowProgress%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EImagine+you+call+the+%3Cb%3EShowProgress%3C%2Fb%3E+handler+5+times+then+the+%3Ca%3EendValue%3C%2Fa%3E+of+the+scrollbar+will+be+the+number+of+lines+in+the+list+*+6+%3A-%29%3C%2Fp%3E%0D%0A%3Cp%3Eif+you+add+extra+calls+outside+the+loop%2C+you+will+add+as+many+to+get+the+count%21%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3EGenerally%2C+you+will+use+such+a+progress+bar+into+a+substack+treated+as+a+%3Ca%3Epalette%3C%2Fa%3E+or+a+%3Ca%3Emodal%3C%2Fa%3E+window+in+association+with+a+label+field+displaying+information.%3C%2Fp%3E%0D%0A%3Cp%3EBut+this+will+be+another+How+To+stack.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E uChasingK%3Cp%3E%3Cb%3EUsing+an+imported+animated+GIF+%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BIn+the+%3Ca%3ERev+images+library%3C%2Fa%3E+%28Development+%26gt%3B+Images+Library+menu+item%29+you+will+find+some+animated+gifs+you+can+use.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BIn+this+example%2C+the+%3Ci%3EChasing+Arrows%3C%2Fi%3E+image+has+been+imported+into+the+stack+and+treated+as+a+button+icon.+So+we+can+set+its+%3Ca%3ErepeatCount%3C%2Fa%3E+and+%3Ca%3EcurrentFrame%3C%2Fa%3E+properties+which+let+animate+or+stop+the+gif+and+fix+the+first+image+displayed.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BPlace+such+a+button+close+by+a+label+field+into+which+you+will+update+information+about+the+current+process.%3C%2Fp%3EuWatch%3Cp%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%230000FF%22%3Eset+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Ethe+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22+color%3D%22%23FF0000%22%3Ecursor+%3C%2Ffont%3E%3Cfont+face%3D%22Courier+New%22+size%3D%2212%22%3Eto+watch%3C%2Ffont%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BUse+this+line+of+code+at+the+beginning+of+any+handler+to+indicate+that+the+computer+is+running+for+a+short+time+%28less+than+2%2F3+seconds+with+Mac+OS+since+it+is+not+an+animated+cursor+on+this+platform%29.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BDon%27t+worry%2C+Revolution+resets+automatically+the+cursor+to+the+default+cursor+when+the+handler+finishes.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BCheck+%3Ca%3Ecursor%3C%2Fa%3E+global+property+and+%3Ca%3Ewatch%3C%2Fa%3E+constant+in+the+Revolution+documentation.%3C%2Fp%3E uBarberBtn%3Cp%3E%3Cb%3EUsing+a+reference+to+an+animated+GIF%3C%2Fb%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BIn+the+%3Ca%3ERev+images+library%3C%2Fa%3E+%28Development+%26gt%3B+Images+Library+menu+item%29+you+will+find+some+animated+gifs+you+can+use.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BIn+this+example%2C+the+%3Ci%3EIndeterminate+Prog+Bar+Default%3C%2Fi%3E+image+is+treated+as+a+button+icon+without+importing+it.+We+only+refer+to+it+by+using+its+ID.%3C%2Fp%3E%0D%0A%3Cp%3E%3C%2Fp%3E%0D%0A%3Cp%3E%3Cimg+src%3D%221600%22%3E%26%239%3BSuch+a+way+to+indicate+waitings+is+not+as+satisfactory+as+using+a+progress+bar.%3C%2Fp%3E%0D%0A%3Cp%3EIn+addition%2C+as+for+any+animated+gif%2C+you+can%27t+modify+the+image+size.%3C%2Fp%3E%0D%0A%3Cp%3ENevertheless%2C+it+can+be+useful+combined+with+a+same+sized+progress+bar+in+order+to+differentiate+determinate+from+undeterminate+moments+%28as+in+SmartSave+plugin+from+%3Ca%3EFrederic+Rinaldi%3C%2Fa%3E%29.%3C%2Fp%3EManaging User Waiting ULucida Grande U Courier New U Courier NewU Courier New W Courier New @ULucida Grande ULucida Grande WLucida Grande UCourier UCourier WCourier cREVGeneralscriptChecksum b.TQG bookmarks handlerList tempScript prevHandlerscriptSelection char 92 to 91scriptt

/*

Managing user waiting Stack

By Eric Chatonet

3/16/05

http://www.sosmartsoftware.com/

*/

uObjectcsPickerBookmarks locations 1034,246,205  Pyon preOpenStack set the style of this stack to modeless set the loc of this stack to the screenLoc end preOpenStack X cREVGeneralscriptChecksumJWJP bookmarks handlerList preOpenStack tempScript prevHandler preOpenStackscriptSelectionchar 121 to 120script

on preOpenStack

set the style of this stack to modeless

set the loc of this stack to the screenLoc

end preOpenStack

@ chasing arrows.gif @210073GIF89a! NETSCAPE2.0!,<DPB *(C fx"G )zX#F%+8QC?D!,:HA!6̘ć8Ǐ!rD!˖K; cREVGeneral revUniqueID 1110897009883Demoi0on mouseEnter if the style of the target <> "rectangle" then exit mouseEnter if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter ShowButton -- do "set the htmlText of fld" && quote & "Info" & quote && "to urlDecode(the u" & the short name of the target && "of this stack)" end mouseEnter on mouseUp if the style of the target = "rectangle" then edit the script of the target end mouseUp on ShowButton lock screen repeat with i = 1 to the number of btns of grp "Demo" set the textStyle of btn i of grp "Demo" to plain set the textColor of btn i of grp "Demo" to empty end repeat set the textStyle of the target to bold set the textColor of the target to "175,0,0" unlock screen end ShowButton -\  cREVGeneralscriptChecksumҟdhڀ}'R revUniqueID 1110902544221 bookmarks handlerListmouseEnter mouseUp ShowButton tempScript prevHandler mouseEnterscriptSelectionchar 747 to 746script A

on mouseEnter

if the style of the target <> "rectangle" then exit mouseEnter

if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter

ShowButton -- 

do "set the htmlText of fld" && quote & "Info" & quote && "to urlDecode(the u" & the short name of the target && "of this stack)"

end mouseEnter

on mouseUp

if the style of the target = "rectangle" then edit the script of the target

end mouseUp

on ShowButton

lock screen

repeat with i = 1 to the number of btns of grp "Demo"

set the textStyle of btn i of grp "Demo" to plain

set the textColor of btn i of grp "Demo" to empty

end repeat

set the textStyle of the target to bold

set the textColor of the target to "175,0,0"

unlock screen

end ShowButton

Chasinge on mouseEnter if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter -- the animated GIF has been imported into this stack -- so we can set its repeatcount set the currentFrame of img ID 1008 to 1 -- set the first image set the icon of me to 1008 wait 500 milliseconds set the repeatcount of img ID 1008 to -1 -- convention for running animated gifs pass mouseEnter end mouseEnter -------------------------------- on mouseLeave set the repeatcount of img ID 1008 to 0 lock screen wait 500 milliseconds set the icon of me to 0 -- hide the icon unlock screen with visual dissolve very fast end mouseLeave -------------------------------- on mouseUp mouseLeave -- pass mouseUp end mouseUp @"x2ChasingArrows cREVGeneralscriptChecksum [rϑU Ц0C revUniqueID 1110897049654 bookmarks handlerListmouseEnter mouseLeave mouseUp tempScript prevHandler mouseEnterscriptSelectionchar 133 to 132script

on mouseEnter

if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter

-- the animated GIF has been imported into this stack

-- so we can set its repeatcount

set the currentFrame of img ID 1008 to 1 -- set the first image

set the icon of me to 1008

wait 500 milliseconds

set the repeatcount of img ID 1008 to -1 -- convention for running animated gifs

pass mouseEnter

end mouseEnter

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

on mouseLeave

set the repeatcount of img ID 1008 to 0

lock screen

wait 500 milliseconds

set the icon of me to 0 -- hide the icon

unlock screen with visual dissolve very fast

end mouseLeave

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

on mouseUp

mouseLeave -- 

pass mouseUp

end mouseUp

WatchEon mouseEnter if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter set the cursor to watch lock cursor -- for demo purpose since the cursor would be reset at the end of the handler pass mouseEnter end mouseEnter -------------------------------- on mouseLeave unlock cursor -- reset cursor end mouseLeave -------------------------------- on mouseUp unlock cursor pass mouseUp end mouseUp @"qx2 cREVGeneralscriptChecksum [<\:O bookmarks revUniqueID 1110899261090 handlerListmouseEnter mouseLeave mouseUpscriptSelectionchar 129 to 128 prevHandler mouseEnter tempScriptscript

on mouseEnter

if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter

set the cursor to watch

lock cursor -- for demo purpose since the cursor would be reset at the end of the handler

pass mouseEnter

end mouseEnter

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

on mouseLeave

unlock cursor -- reset cursor

end mouseLeave

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

on mouseUp

unlock cursor

pass mouseUp

end mouseUp

BusyEvon mouseEnter if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter set the htmlText of fld "Info" to urlDecode(the uBusy of this stack) -- for demo purpose ShowButton -- G repeat set the cursor to busy if the mouseloc is not within the rect of me then exit to top if the mouse is down then ShowInfo -- wait 50 milliseconds -- since we have no stuff to do end repeat end mouseEnter -------------------------- on ShowInfo set the hilite of me to true wait until the mouse is up set the hilite of me to false exit to top end ShowInfo @"x2 cREVGeneralscriptChecksum[:Z&eZ; revUniqueID 1110900864401 bookmarks handlerListmouseEnter ShowInfo tempScript prevHandler mouseEnterscriptSelectionchar 145 to 144scriptD

on mouseEnter

if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter

set the htmlText of fld "Info" to urlDecode(the uBusy of this stack) -- for demo purpose

ShowButton -- G

repeat

set the cursor to busy

if the mouseloc is not within the rect of me then exit to top

if the mouse is down then ShowInfo -- 

wait 50 milliseconds -- since we have no stuff to do

end repeat

end mouseEnter

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

on ShowInfo

set the hilite of me to true

wait until the mouse is up

set the hilite of me to false

exit to top

end ShowInfo

 BarberBtne&on mouseEnter if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter -- in this case, the animated GIF is in Rev images library -- we refer to it by its ID number set the icon of me to 210065 pass mouseEnter end mouseEnter -------------------------------- on mouseLeave lock screen set the icon of me to 0 -- hide the icon unlock screen with visual dissolve very fast end mouseLeave -------------------------------- on mouseUp mouseLeave -- pass mouseUp end mouseUp @"x2 Barber Pole cREVGeneralscriptChecksum9K>9T4Sz bookmarks revUniqueID 1110901231315 handlerListmouseEnter mouseLeave mouseUpscriptSelectionchar 133 to 132 prevHandler mouseEnter tempScriptscript

on mouseEnter

if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter

-- in this case, the animated GIF is in Rev images library

-- we refer to it by its ID number

set the icon of me to 210065

pass mouseEnter

end mouseEnter

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

on mouseLeave

lock screen

set the icon of me to 0 -- hide the icon

unlock screen with visual dissolve very fast

end mouseLeave

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

on mouseUp

mouseLeave -- 

pass mouseUp

end mouseUp

BarberC,#d4 cREVGeneral revUniqueID 1110896312089  Progresseon mouseEnter local tRange ----- if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter set the htmlText of fld "Info" to urlDecode(the uProgress of this stack) -- for demo purpose ShowButton -- G ----- if "browse" is in the tool then -- otherwise you can't edit it easily set the icon of me to 1034 -- a blank icon show sb "Progress" -- sb = scrollbar put the endValue of sb "Progress" into tRange repeat with i = 1 to tRange mouseLeave -- if the mouse is down then ShowInfo -- set the thumbPos of sb "Progress" to i -- get ahead with the scrollbar end repeat end if set the thumbPos of sb "Progress" to 0 -- clean up end mouseEnter -------------------------------- on mouseLeave if the mouseloc is within the rect of me then exit mouseLeave lock screen hide sb "Progress" set the icon of me to 0 -- hide the icon unlock screen with visual dissolve very fast exit to top end mouseLeave -------------------------- on ShowInfo set the hilite of me to true wait until the mouse is up set the icon of me to 0 hide sb "Progress" set the hilite of me to false exit to top end ShowInfo @"Ix2 Progress Bar cREVGeneralscriptChecksum:bon mouseEnter

local tRange

-----

if the platform = "MacOS" and the short name of this stack is not in line 1 of the windows then exit mouseEnter

set the htmlText of fld "Info" to urlDecode(the uProgress of this stack) -- for demo purpose

ShowButton -- G

-----

if "browse" is in the tool then -- otherwise you can't edit it easily

set the icon of me to 1034 -- a blank icon

show sb "Progress" -- sb = scrollbar

put the endValue of sb "Progress" into tRange

repeat with i = 1 to tRange

mouseLeave -- 

if the mouse is down then ShowInfo -- 

set the thumbPos of sb "Progress" to i -- get ahead with the scrollbar

end repeat

end if

set the thumbPos of sb "Progress" to 0 -- clean up

end mouseEnter

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

on mouseLeave

if the mouseloc is within the rect of me then exit mouseLeave

lock screen

hide sb "Progress"

set the icon of me to 0 -- hide the icon

unlock screen with visual dissolve very fast

exit to top

end mouseLeave

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

on ShowInfo

set the hilite of me to true

wait until the mouse is up

set the icon of me to 0

hide sb "Progress"

set the hilite of me to false

exit to top

end ShowInfo

 Progressaa,UdTD@D120 cREVGeneral revUniqueID 1110901859894 GeneralitiesD on mouseUp beep end mouseUp @";x2 cREVGeneralscriptChecksumlŲLܸ43P revUniqueID 1110968199726 bookmarks handlerListmouseUp tempScript prevHandler mouseEnterscriptSelection char 18 to 17script

on mouseUp

beep

end mouseUp

 SSS.png  Hon mouseDown revGoUrl "http://www.sosmartsoftware.com" end mouseDown >k"-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.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seDown

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

end mouseDown

 Label Field   cREVGeneralscriptChecksumُ B~ revUniqueID 1110902606610 bookmarks handlerList tempScript prevHandlerscriptSelection char 1 to 83script

VMove your mouse over the buttons (not too fast :-) and click to open their scripts... Info p'on linkClicked pLink switch pLink case "Frederic Rinaldi" revGoUrl "http://www.xcmdfactory.com/" break case "Rev Images Library" go cd 2 of stack "revImageLibrary" as modeless lock messages set the menuHistory of btn "tabs" of stack "RevImageLibrary" to 2 break default lock screen go to cd ID 1002 of stack "revDocs" if revAppVersion() >= 2.5 then put pLink into fld "Find" set the menuhistory of btn "Filter type" to 1 send "mouseUp" to btn "Go" end if end switch end linkClicked @-3  cREVGeneralscriptChecksumI(p MF. bookmarks revUniqueID 1110902805941 handlerList linkClicked prevHandler linkClicked tempScriptscriptSelectionchar 283 to 282script

on linkClicked pLink

switch pLink

case "Frederic Rinaldi"

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

break

case "Rev Images Library"

go cd 2 of stack "revImageLibrary" as modeless

lock messages

set the menuHistory of btn "tabs" of stack "RevImageLibrary" to 2

break

default

lock screen

go to cd ID 1002 of stack "revDocs"

if revAppVersion() >= 2.5 then

put pLink into fld "Find"

set the menuhistory of btn "Filter type" to 1

send "mouseUp" to btn "Go"

end if

end switch

end linkClicked

 #How-To stack #011 by Eric Chatonet " 3/16/05 Initial release 45/27/05 Modified for Tutorial Picker compatibility @3 6Good ergonomics takes care of managing user waitings. 5 ]This stack shows the different ways of indicating to the user that he has to wait a moment . \ Enjoy!  v Using the watch cursor during very short tasks is not a good idea since user's perception will be this app is slow! @1600 > ?% d | Don't using any means of indicating to the user that your app is running a long task is a bad idea too: this app crashed! @1600 ? @) i In addition, task length often depends on the situation: computer speed and current process (you don't know if a folder dropped by the user contains 1, 10 or 500 files). @1600 : ;" ]O Sometimes you will have to check first the task length to determine if an indication is needed: for instance, see the scripts of the Rev Application Browser where a specific cursor is only used when the length of a list counts more than 50 lines.  There are many ways of indicating waiting time : static cursors (like watch on Mac OS), animated cursors (like busy cursor), animated gifs (like chasing arrows or "barber poll") and progression bars (more accurate for long tasks). 1 1 ? X h } ,   %Let us see when and how to use them! `3.1@ 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 1110903475787 Fausse icne 10*10.png @ ȉPNG  IHDR 2Ͻ pHYs  gAMA|Q cHRMz%u0`:o_F>IDATxb?1 U@D+  hDB"Z!@ V`"~IENDB` cREVGeneral revUniqueID 1110969496814