home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / SHARED.CST / 00044_Script_revealBtnObject < prev    next >
Text File  |  1997-07-24  |  2KB  |  68 lines

  1. --P1:Tool2: operate btn object
  2.  
  3. property pToolRects, pNumOfRects
  4. property pMenuCast
  5. property argClickLocPnt
  6. property pHiliteStartCast
  7. property pHiliteSprite
  8. property pQTVRsteps
  9.  
  10. global gModeManager, gQTVRobj, gActiveQTVRhandler, gActiveFunctionObj
  11. --==============================================================
  12. on mInit me
  13.   
  14.   return (me)
  15.   
  16. end
  17. ----------------------------------------------------------------------------ò
  18. on mSetup me, whichMenuCast,toolrects, hiliteSprite
  19.   
  20.   
  21. end mSetup
  22. ----------------------------------------------------------------------------ò
  23. on mSetMenuProp me, WhatMenuCast, toolrects, hiliteSprite, ActiveFunctionalty
  24.   
  25.   set pWhatFunctActive = ActiveFunctionalty
  26.   set pMenuCast = WhatMenuCast
  27.   set pToolRects = toolrects
  28.   set pHiliteSprite = hiliteSprite
  29.   set pHiliteStartCast = pMenuCast + 1
  30.   set pNumOfRects = count(pToolRects)
  31.   
  32. end mSetMenuProp
  33. ----------------------------------------------------------------------------ò
  34. on mGetToolMenuCast me
  35.   
  36.   return ( pMenuCast )
  37.   
  38. end mGetToolMenuCast
  39. ----------------------------------------------------------------------------ò
  40. on mButtonClicked me
  41.   
  42.   set ClickLocPnt = the clickloc
  43.   set whatrect = mGetWhatToolRect( me, ClickLocPnt)
  44.   if  (whatrect <> 0 ) then
  45.     if objectP(gActiveFunctionObj) then mReveal( gActiveFunctionObj, whatrect)
  46.   end if
  47.   
  48.   
  49. end mButtonClicked
  50. ----------------------------------------------------------------------------ò
  51. on mGetWhatToolRect me, argClickedPnt
  52.   
  53.   set whatrect = 1
  54.   set found = #FALSE
  55.   repeat while (found = #FALSE)
  56.     if inside(argClickedPnt, getat(pToolRects,whatrect)) then 
  57.       set found = #TRUE
  58.       set the castnum of sprite pHiliteSprite = pHiliteStartCast + whatrect - 1
  59.       updatestage
  60.     else set whatrect = whatrect + 1
  61.     if (whatrect > pNumOfRects) then set found = #NEVER
  62.   end repeat
  63.   
  64.   if (found = #TRUE) then return( whatrect ) 
  65.   else  return( 0 ) 
  66.   
  67. end mGetWhatToolRect
  68. ----------------------------------------------------------------------------ò