home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
shared.cst
/
00042_Script_operateBtnObject
< prev
next >
Wrap
Text File
|
1997-07-24
|
2KB
|
67 lines
--P1:Tool2: operate btn object
property pToolRects, pNumOfRects
property pMenuCast
property argClickLocPnt
property pHiliteStartCast
property pHiliteSprite
property pQTVRsteps
global gModeManager, gQTVRobj, gActiveQTVRhandler, gActiveFunctionObj
--==============================================================
on mInit me
return (me)
end
----------------------------------------------------------------------------ò
on mSetup me, WhatMenuCast, toolrects, hiliteSprite
end mSetup
----------------------------------------------------------------------------ò
on mSetMenuProp me, WhatMenuCast, toolrects, hiliteSprite, ActiveFunctionalty
set pWhatFunctActive = ActiveFunctionalty
set pMenuCast = WhatMenuCast
set pToolRects = toolrects
set pHiliteSprite = hiliteSprite
set pHiliteStartCast = pMenuCast + 1
set pNumOfRects = count(pToolRects)
end mSetMenuProp
----------------------------------------------------------------------------ò
on mGetToolMenuCast me
return ( pMenuCast )
end mGetToolMenuCast
----------------------------------------------------------------------------ò
on mButtonClicked me
set ClickLocPnt = the clickloc
set whatrect = mGetWhatToolRect( me, ClickLocPnt)
if (whatrect <> 0 ) then
if objectP(gActiveFunctionObj) then mOperate( gActiveFunctionObj, whatrect)
end if
end mButtonClicked
----------------------------------------------------------------------------ò
on mGetWhatToolRect me, argClickedPnt
set whatrect = 1
set found = #FALSE
repeat while (found = #FALSE)
if inside(argClickedPnt, getat(pToolRects,whatrect)) then
set found = #TRUE
set the castnum of sprite pHiliteSprite = pHiliteStartCast + whatrect - 1
updatestage
else set whatrect = whatrect + 1
if (whatrect > pNumOfRects) then set found = #NEVER
end repeat
if (found = #TRUE) then return( whatrect )
else return( 0 )
end mGetWhatToolRect
----------------------------------------------------------------------------ò