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

  1. --o:  AreaMgr
  2.  
  3.  
  4. --pState can be: #Active, #Inactive
  5. --pCurrentArea can be: #DESK, #KINETOSCOPE, #BENCH, #TICKER, #LAB, #NONE
  6. --INSTANTIATED AS gAreaManagerObj
  7.  
  8.  
  9.  
  10. property pAreaList, pState, pActiveArea, pAreaMaster
  11. property pCurrArea
  12.  
  13. global gPictObj, gInterfaceMgrObj, gModeManager
  14. global gWHSobjIndexedLst, gBHSobjIndexedLst, gEHSobjIndexedLst, gGHSobjIndexedLst
  15. global gInventorIndexNum, gGeneralCastIndex, gMstrObjIndexedLst, gInventorOrder, gUtilityObj
  16. ----------------------------------------------------------------------------ò
  17. on mInit me, HSdatapaksIndex, invNum
  18.   
  19.   set AreaScript = script (getprop(gGeneralCastIndex,#AreaObjectScript)) -- AreaObjectParentScript
  20.   set AreaDBcastLst = getprop(gGeneralCastIndex,#AreaDbs)
  21.   
  22.   set pAreaList = []
  23.   set pAreaMaster = [[],[],[]]
  24.   
  25.   repeat with invNum = 1 to 4
  26.     
  27.     set whatinventor = getat(gInventorOrder, invNum)   -- Returns #Edison,#Bell,#Watt,#Gallery...ect
  28.     set whatinvIndex  = getprop(gMstrObjIndexedLst,whatinventor) -- gEHSobjIndexedLst ...
  29.     set AreaDB = the text of cast (getprop( AreaDBcastLst, whatinventor)) -- "EDISON Area DB", .....
  30.     
  31.     set pAreaList = [:]
  32.     set done = false
  33.     repeat while not done
  34.       if (line 1 of AreaDB contains "~") then set done = true
  35.       delete line 1 of AreaDB
  36.     end repeat
  37.     
  38.     set NumOfDBlines = the number of lines in AreaDB
  39.     repeat with DBline = 1 to NumOfDBlines
  40.       set CurrAreaDBline = value(line DBline of AreaDB )
  41.       set AreaCreating = getat( CurrAreaDBline, 2)
  42.       addProp(pAreaList, AreaCreating, birth(AreaScript ,whatinvIndex, CurrAreaDBline))
  43.     end repeat
  44.     setat(pAreaMaster,invNum,pAreaList)
  45.     MoveBar( 5 )
  46.     
  47.   end repeat
  48.   set pState = #Inactive
  49.   
  50.   set pActiveArea = 0
  51.   
  52.   return ( me )
  53.   
  54. end mInit
  55. ----------------------------------------------------------------------------ò
  56. on mChangeInventor me, whatInventor
  57.   
  58.   set pAreaList = getat(pAreaMaster,gInventorIndexNum)
  59.   set pActiveArea = 0
  60.   
  61. end mChangeInventor
  62. ----------------------------------------------------------------------------ò
  63. on mPerform me
  64.   
  65.   mPassPerform (pActiveArea)
  66.   
  67. end mPerform
  68. ----------------------------------------------------------------------------ò
  69. on mAreaHSevent me, argHS
  70.   
  71.   if mGetCurrentMode(gModeManager) = #AREA then mDistributeHS(me, argHS)
  72.   
  73. end mAreaHSevent
  74. ----------------------------------------------------------------------------ò
  75. on mDistributeHS me, argHotSpotNumber
  76.   
  77.   -- Locate Hotspot in areas... should use indexed list and eliminate the repeat
  78.   
  79.   set newFunctType = false
  80.   
  81.   if objectp(pActiveArea) then
  82.     set newFunctType = mContainsHS(pActiveArea, argHotSpotNumber)
  83.   end if
  84.   
  85.   set AreaToCheck = 1
  86.   
  87.   if (newFunctType = false) then
  88.     repeat while newFunctType = false
  89.       set pActiveArea = getAt(pAreaList, AreaToCheck)
  90.       set newFunctType = mContainsHS(pActiveArea, argHotSpotNumber)
  91.       set AreaToCheck = AreaToCheck + 1
  92.     end repeat
  93.   end if
  94.   
  95.   
  96.   --/ Gallery Swing "Addition".....
  97.   if (gInventorIndexNum = 4) and (newFunctType = #FRAME) then 
  98.     if argHotSpotNumber = 3 then set NewViewStr = "5,-8,70"  -- Edison
  99.     else if argHotSpotNumber = 5 then set NewViewStr = "275,-8,70.0"  -- Watt
  100.     else if argHotSpotNumber = 1 then set NewViewStr = "95,-8,70.0"  -- Bell
  101.     else  if argHotSpotNumber = 7 then set NewViewStr = "180,0,60"  -- quit
  102.     mSwingToView( gQTVRobj, NewViewStr,"5" )
  103.   end if
  104.   --/
  105.   
  106.   if (newFunctType <> #TEXT) then mChangeMode(gModeManager, newFunctType) 
  107.   
  108. end mDistributeHS
  109. ----------------------------------------------------------------------------ò
  110. on mPassActivateEvent me, argFunctType
  111.   
  112.   mTriggerFunctionality(pActiveArea, argFunctType)
  113.   
  114. end mPassActivateEvent
  115. ----------------------------------------------------------------------------ò
  116. on mClickEvent me
  117.   
  118.   mDenyClicks( gUtilityObj )
  119.   mClickEvent( pActiveArea )
  120.   
  121. end mClickEvent
  122. ----------------------------------------------------------------------------ò
  123. on mActivate me
  124.   
  125.   --this manager should NEVER be inactive
  126.   
  127. end mActivate
  128. ----------------------------------------------------------------------------ò
  129. on mClose me
  130.   
  131.   --this manager should NEVER be inactive
  132.   
  133. end mClose
  134. ----------------------------------------------------------------------------ò
  135.