home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / shared.cst / 00046_Script_captureBtnObject < prev    next >
Text File  |  1997-07-24  |  2KB  |  69 lines

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