REVO2700+Faking Vista Ranking3Q/* Vista Stars stack By Eric Chatonet 9/22/07 http://www.sosmartsoftware.com/ */ on preOpenStack set the style of this stack to "modeless" set the loc of this stack to the screenLoc end preOpenStack rTFaking Vista Ranking SystemT ULucida Grande ULucida Grande WLucida Grande WLucida Grande WCourier UCourier UCourier UGeorgiaUGeorgia UTahoma U Courier New U Courier New WTahoma UTahoma WVerdana UVerdana UVerdanaPulldown Menu cGlx2Generalid 1190236297200cREVGeometryCachestackID1067 cREVOnline cREVGeneral scriptChecksum,E5DCvYgj debugObjects handlerList preOpenStackscriptSelection char 43 to 42 bookmarks prevHandler preOpenStack tempScriptstackfileversion2.4script

/*

Vista Stars stack

By Eric Chatonet

9/22/07

http://www.sosmartsoftware.com/

*/

on preOpenStack

set the style of this stack to "modeless"

set the loc of this stack to the screenLoc

end preOpenStack

 @ TcREVGeometryCacheIDs1190204535495500002110945671060910331109350253372101411902045354275000031190204580913106611902815211131067110935005880410121190280954482106111902809544831062110935497419910211109347801497100611093502990731016110935034644316001190277776701500001cREVGeometrycacheorder1109350253372 1109350299073 total14 cREVGeneralscriptChecksumُ B~ bookmarks handlerList tempScript prevHandler preOpenCardscriptSelection char 1 to 0script

@ %&+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`-+  cREVGeneral revUniqueID 1109350058804 Info)` cREVGeometry Master,expectedRect20,205,473,352Master,scalebottomDistance-53Master,movevDistancefalseMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,cardRanking1Master,scaleBottomtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneral revUniqueID 1109350253372  $ How-To stack #022 by Eric Chatonet #  10/01/07 Initial release    =This stack shows you how to fake Vista Stars Ranking system. < XUsing stars to rank is a Mac feature in iTunes since a long time: Vista now uses it :-) W Here it's provided as a self-contained widget you can copy paste into your projects. It's planned to work on a white background.   _ Just hovering stars make the right number of stars hilited according to the cursor position. @1600 F G ? Leaving the area without clicking restores previous ranking. @1600  0 Clicking on a star sets ranking to the corresponding value unless it's already the current ranking: in this case, ranking is set to zero. @1600 H IB    How does it work? @1600    SThe widget is a group that includes a locked field and three images (0.5 KB each). R  vMainly, widget architecture is based on a setProp handler that triggers the uCurRanking custom property of the field. * * 1 L W It triggers three mouse messages: mouseMove to set ranking when hovering, mouseLeave to restore previous ranking when no click and mouseUp to set a new ranking. " " + J T/   tMain function RankingWithStars() displays ranking or preview according to the Boolean value of its second argument.    S YContents in the field are html that refer to images: there is not any text in the field.   : tRankingWithStars() builds and returns the right html using tags according to its first argument value.  a An additional StarNum() function allows to know which star is currently hovered because as there is not any text in the field, Rev built-in text functions can't be used here.    2See commented unique script for more information. 1   How to use it? @1600    JThe widget, once you have pasted it into your project will work straight. I 6To set a ranking value by coding just use a oneliner: 5 * set the uCurRanking of to @    @     tWhere is the long ID of the field in the widget you want to set and an integer between zero and five. s yUsing the long ID of the field is not compulsory but avoids names conflicts when using several widgets in the same card. x In such a case, even if images are very light, you might prefer to cut them from the widget group and paste them elsewhere to have not them duplicated.   Enjoy!   ,As usual this tutorial is a modeless stack: + If you want to access it completely, just use Rev contextual menu (control/shift/command click on Mac and control/shift click on Win) anywhere in this window to make the menu appear and set stack's mode to toplevel.   # `SSS.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}k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V }xuc&G%+v6FQIUVPqyV<<>~z';;0v..Vf&fv6VfV`A痏RQJEME&X@w2(9XW.wLrjɲ&(A[հxUe||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,expectedRect182,363,310,397Master,scalebottomDistanceMaster,movevDistance-25Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,moveVObjectRefcardMaster,moveVAbsolutetrueMaster,cardRanking1 Master,moveVtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneralscriptChecksum`}^.e revUniqueID 1109350299073 bookmarks handlerList mouseDown tempScript prevHandlerscriptSelection char 13 to 12script

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 currentview7Play with the option menu, hover and click the stars... cREVGeneral revUniqueID 1109354974199 8Play with the option menu, hover and click the stars... Show ScriptEp;on mouseUp edit the script of fld "Ranking" end mouseUp zi]_ cREVGeneralscriptChecksum†t Ԟq[b~ bookmarks revUniqueID 1109456710609 handlerListmouseUpscriptSelection char 38 to 37 prevHandlermouseUp tempScriptscript

on mouseUp

edit the script of fld "Ranking"

end mouseUp

%SetDemoRanking uon menuPick pChosen local tObj ----- put the long ID of fld "Ranking" into tObj set the uCurRanking of tObj to pChosen end menuPick $8<{0 0 1 2 3 4 5 cGlx2GeneralcScriptChecksumcExplicitVariablesfalsecHscrollScript0cLocalscHscrollHandlers0 cHtmlScriptP0 /;x#A 7œ1Ɔ?A\#t{]@I[C8xe@6AJi[+wfd;my#G)TB-Zz'5|y5:>ˎB@L~*ʮ-r[l63AըMն5~!cSelectedChunk char 19 to 37 cConstantscHandlersListWidth110 cDirtyFlagfalsecHtmlHandlers[)I). EɶJƆƖJv6 qĜļԢb}B;.;5eKkԼҀl(9N cFolders all handlers cHandlersmenuPickcVscrollScript0cVscrollHandlers0 cHilitedLine2 cGlobalscGlx2TimeStamp 1190212880working 1190212286start checksum)[8*q= 1190212713working 1190212769working 1190212835working 1190212143start 1190211867start 1190212310start 1190212462working 1190212742start 1190212806working 1190212464working 1190212679start cREVGeneralscriptChecksumm)Kl bookmarks revUniqueID 1190280954482 handlerListmenuPickscriptSelection char 68 to 67 prevHandlermenuPick tempScriptscript

on menuPick pChosen

local tObj

-----

put the long ID of fld "Ranking" into tObj

set the uCurRanking of tObj to pChosen

end menuPick

& StarRanking i2]  cREVGeneral revUniqueID 1190280954483 bookmarks handlerList tempScript prevHandlerscript! Star.jpg @Z V6JFIFddDuckyFAdobed     v!1AQ!1QaAq"3 ?ŒEo$W9)3z4hڳ 3 ЏRͬ5;Jx&ˈY[lȊ&:>4,k ZFY(&WM5$ Aq8x8uYdI\Ǭ6Î'ɴ¢0WnQל >nq HboWVgũ7{KZ#G8$օ$Q׿4T[ӉB޵aM\Р/ cREVGeneral revUniqueID 1190277776701" StarDis.jpg @Z VJFIFddDuckyFAdobed     ^!A1Q1 ?M7}XDƂ!9YX[ƖRAhGޫ]wc>SF$ Z;A4⥊;sSt d03*,ks(T9=WP/q 5EHܔÚ  cREVGeneral revUniqueID 1190204535495#StarHilited.jpg HZ V\JFIFddDuckyFAdobed     t!1A"!1QaA"R ?ۃ$s`&j&>4W1cKJH;ЎQ+X4,7]@֢L0l%@ʯ 7|㉤|yDc@^kk"ni$,zBTSqƶ3 B{LYswuɯ0G/TBaxR' VWU+^]^v:\iy-9W(ۑj'9 |7G?=㠆 {T5§p&ҤP?E/ 1),, cREVGeneral bookmarks revUniqueID 1190204535427 handlerList prevHandler tempScriptscript *Ranking  /* Stars Ranking widget by Eric Chatonet - http://www.sosmartsoftware.com/ September 2007 All the code is in this script (the script of the field's widget) */ ----------------------------- local lCurStar -- script local variable ----------------------------- on mousemove -- when hovering the widget local tCurStar ----- put StarNum(the long ID of me) into tCurStar -- see below if tCurStar <> lCurStar then -- prevents the handler from running if not necessary set the htmltext of me to RankingWithStars(tCurStar,true) -- put tCurStar into lCurStar end if end mousemove ----------------------------- on mouseLeave set the uCurRanking of me to the uCurRanking of me -- restores current ranking put empty into lCurStar end mouseLeave ----------------------------- on mouseUp local tCurStar ----- put StarNum(the long ID of me) into tCurStar -- see below if the uCurRanking of me = tCurStar then set the uCurRanking of me to 0 else set the uCurRanking of me to tCurStar end if end mouseUp ----------------------------- setProp uCurRanking pRanking set the htmltext of me to RankingWithStars(pRanking) -- C ################################### ## Only for demo: you can suppress this code portion in your project: if there is a btn "SetDemoRanking" then lock messages -- to avoid recursion if pRanking <> 0 then set the menuHistory of btn "SetDemoRanking" to pRanking + 1 else set the menuHistory of btn "SetDemoRanking" to pRanking end if ################################### pass uCurRanking -- sets the custom property end uCurRanking ############################# ## Prefer putting the code below in the card or the stack script ## if you want to manage several 'stars ranking' widgets in your project: function RankingWithStars pRanking,pHovering -- This function is not dependent on the effective ID of any image -- but don't modify image names :-) local tHtml ----- repeat with i = 1 to 5 if i <= pRanking then if pHovering then -- used by mouseMove handler put "" after tHtml -- hovered star icon else -- usual case put "" after tHtml -- hilited star icon end if else put "" after tHtml -- blank star icon end if end repeat return tHtml end RankingWithStars ------------------------------- function StarNum pObj return (the mouseH - the left of pObj) div the width of img "Star.jpg" + 1 -- this function uses relative positions end StarNum 6U uCurRanking0 cREVGeneral scriptChecksum+<,%}/ breakPoints handlerListAmousemove mouseLeave mouseUp uCurRanking RankingWithStars StarNumscriptSelection char 1 to 0 bookmarks revUniqueID 1190204580913 prevHandler mousemove tempScriptscript

/*

Stars Ranking widget by Eric Chatonet - http://www.sosmartsoftware.com/

September 2007

All the code is in this script (the script of the field's widget)

*/

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

local lCurStar -- script local variable

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

on mousemove -- when hovering the widget

local tCurStar

-----

put StarNum(the long ID of me) into tCurStar -- see below

if tCurStar <> lCurStar then -- prevents the handler from running if not necessary

set the htmltext of me to RankingWithStars(tCurStar,true) --

put tCurStar into lCurStar

end if

end mousemove

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

on mouseLeave

set the uCurRanking of me to the uCurRanking of me -- restores current ranking

put empty into lCurStar

end mouseLeave

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

on mouseUp

local tCurStar

-----

put StarNum(the long ID of me) into tCurStar -- see below

if the uCurRanking of me = tCurStar then

set the uCurRanking of me to 0

else

set the uCurRanking of me to tCurStar

end if

end mouseUp

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

setProp uCurRanking pRanking

set the htmltext of me to RankingWithStars(pRanking) -- C

###################################

## Only for demo: you can suppress this code portion in your project:

if there is a btn "SetDemoRanking" then

lock messages -- to avoid recursion

if pRanking <> 0 then set the menuHistory of btn "SetDemoRanking" to pRanking + 1

else set the menuHistory of btn "SetDemoRanking" to pRanking

end if

###################################

pass uCurRanking -- sets the custom property

end uCurRanking

#############################

## Prefer putting the code below in the card or the stack script

## if you want to manage several 'stars ranking' widgets in your project:

function RankingWithStars pRanking,pHovering

-- This function is not dependent on the effective ID of any image

-- but don't modify image names :-)

local tHtml

-----

repeat with i = 1 to 5

if i <= pRanking then

if pHovering then -- used by mouseMove handler

put "<img src=" & quote & the ID of img "StarHilited.jpg" & quote & ">" after tHtml

-- hovered star icon

else -- usual case

put "<img src=" & quote & the ID of img "Star.jpg" & quote & ">" after tHtml

-- hilited star icon

end if

else

put "<img src=" & quote & the ID of img "StarDis.jpg" & quote & ">" after tHtml

-- blank star icon

end if

end repeat

return tHtml

end RankingWithStars

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

function StarNum pObj

return (the mouseH - the left of pObj) div the width of img "Star.jpg" + 1

-- this function uses relative positions

end StarNum

 @500002 @500002 @500002 @500002 @500002+ Copy WidgetEp3on mouseUp copy group "StarRanking" end mouseUp i]=Click here to copy the widget and paste it into your project} cREVGeneralscriptChecksumFO`_rFG1Oc revUniqueID 1190281521113 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 30 to 29script

on mouseUp

copy group "StarRanking"

end mouseUp