home *** CD-ROM | disk | FTP | other *** search
/ Encyklopedia Omnia / Planeta.iso / data / m_navhab.dir / 00007_Script_dragMIAW < prev    next >
Text File  |  2000-09-30  |  2KB  |  53 lines

  1. -- Behavior per trascinare le MIAW con una custom bar.
  2. -- Applicalo alla barra. Cambia il cursore in "pugno" e
  3. -- lo rimette a "mano" al mouseUp.
  4.  
  5. property theWindow
  6.  
  7. on mouseDown
  8.   set the cursor of sprite (the currentSpriteNum) to [member "pugno", member "pugno_m"]
  9.   
  10.   put the rect of window theWindow into theRect
  11.   put (the stageLeft + the mouseH) - getAt(theRect,1) into hOff
  12.   put (the stageTop + the mouseV) - getAt(theRect,2) into vOff
  13.   put getAt(theRect,3) - getAt(theRect,1) into width
  14.   put getAt(theRect,4) - getAt(theRect,2) into height
  15.   repeat while the stillDown
  16.     --    Store the values in case the mouse is moved quickly
  17.     put (the stageLeft + the mouseH) into mH
  18.     put (the stageTop + the mouseV) into mV
  19.     setAt(theRect,1,(mH - hOff))
  20.     setAt(theRect,2,(mV - vOff))
  21.     setAt(theRect,3,(getAt(theRect,1) + width))
  22.     setAt(theRect,4,(getAt(theRect,2) + height))
  23.     set the rect of window theWindow = theRect
  24.     --    Necessary to get the stage to continue displaying
  25.     --    while the window is moved on top of it
  26.     --    This could cause problems if trails are used on the stage
  27.     tell the stage to updateStage
  28.     --tell window "urbaflot" to updateStage
  29.     repeat with f in the windowList
  30.       if f <> window theWindow then tell f to updateStage
  31.     end repeat
  32.     updateStage
  33.   end repeat
  34.   
  35.   set the cursor of sprite (the currentSpriteNum) to [member "palmo", member "palmo_m"]
  36. end
  37.  
  38.  
  39. on beginSprite
  40.   set the cursor of sprite (the currentSpriteNum) to [member "palmo", member "palmo_m"]
  41. end
  42.  
  43.  
  44. on getBehaviorDescription
  45.   return "Per trascinare le MIAW di tipo 2 con drag bar personalizzata." & RETURN & "Applicala alla drag bar. Cambia il cursore in pugno al mouseDown e lo rimette a mano al mouseUp."
  46. end
  47.  
  48.  
  49. on getPropertyDescriptionList
  50.   
  51.   set p_list = [#theWindow: [#comment:"Nome della MIAW:", #format: #string, #default: (char 1 to (length(the movieName)-4) of the movieName)]]
  52.   return p_list  
  53. end