-- Behavior per trascinare le MIAW con una custom bar.
-- Applicalo alla barra. Cambia il cursore in "pugno" e
-- lo rimette a "mano" al mouseUp.
property theWindow
on mouseDown
set the cursor of sprite (the currentSpriteNum) to [member "pugno", member "pugno_m"]
put the rect of window theWindow into theRect
put (the stageLeft + the mouseH) - getAt(theRect,1) into hOff
put (the stageTop + the mouseV) - getAt(theRect,2) into vOff
put getAt(theRect,3) - getAt(theRect,1) into width
put getAt(theRect,4) - getAt(theRect,2) into height
repeat while the stillDown
-- Store the values in case the mouse is moved quickly
put (the stageLeft + the mouseH) into mH
put (the stageTop + the mouseV) into mV
setAt(theRect,1,(mH - hOff))
setAt(theRect,2,(mV - vOff))
setAt(theRect,3,(getAt(theRect,1) + width))
setAt(theRect,4,(getAt(theRect,2) + height))
set the rect of window theWindow = theRect
-- Necessary to get the stage to continue displaying
-- while the window is moved on top of it
-- This could cause problems if trails are used on the stage
tell the stage to updateStage
--tell window "urbaflot" to updateStage
repeat with f in the windowList
if f <> window theWindow then tell f to updateStage
end repeat
updateStage
end repeat
set the cursor of sprite (the currentSpriteNum) to [member "palmo", member "palmo_m"]
end
on beginSprite
set the cursor of sprite (the currentSpriteNum) to [member "palmo", member "palmo_m"]
end
on getBehaviorDescription
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."
end
on getPropertyDescriptionList
set p_list = [#theWindow: [#comment:"Nome della MIAW:", #format: #string, #default: (char 1 to (length(the movieName)-4) of the movieName)]]