home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
mac
/
FILES
/
SHARED.CST
/
00043_Script_zoomBtnObject
< prev
next >
Wrap
Text File
|
1997-07-24
|
3KB
|
112 lines
--P3:Tool3: zoom 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
set pQTVRsteps = [[0,0,-1],[0,0,1]]
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 mGetCurrentMode( gModeManager) = #QTVR then ZoomQTVR( me, whatrect, ClickLocPnt )
else if objectP(gActiveFunctionObj) then mZoom( 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
----------------------------------------------------------------------------ò
on ZoomQTVR me, whatrect, argClickedPnt
if (whatrect <> 0) then
set OverActiveRect = TRUE
set MouseLocPnt = argClickedPnt
else set OverActiveRect = FALSE
set NewCords = value("[" & mGetQTVRProps( gQTVRobj ) & "]")
repeat while the mousedown and OverActiveRect
set MouseLocPnt = point(the mouseh, the mousev)
if inside(MouseLocPnt, getat(pToolRects,whatrect)) then
set QTVRstep = getat(pQTVRsteps,whatrect)
set NewCords = NewCords + QTVRstep
set NewViewStr = string(getat(NewCords,1)) & "," & string(getat(NewCords,2)) & "," & string(getat(NewCords,3))
mSwingToView( gQTVRobj, NewViewStr,"5" )
--mSetQTVRView( gQTVRobj, NewViewStr )
--mUpdate( gQTVRobj )
else
set the castnum of sprite pHiliteSprite = 0
updatestage
set OverActiveRect = FALSE
end if
end repeat
if not OverActiveRect and the mousedown then
set MouseLocPnt = point(the mouseh, the mousev)
ZoomQTVR( me,mGetWhatToolRect( me, MouseLocPnt), MouseLocPnt)
else set the castnum of sprite pHiliteSprite = 0
end ZoomQTVR
----------------------------------------------------------------------------ò