set theRect to rect(charPosToLoc(member myMemb, charTotal1) + offsetLoc - [0, lneHite], charPosToLoc(member myMemb, charTotal2) + offsetLoc)
if the width of theRect < 2 then
setAt(theRect, 3, getAt(theRect, 1) - 1)
end if
set the rect of sprite (i + 20) to theRect + [0, xtraOffset, 0, xtraOffset]
end repeat
updateStage()
set oldLoc to newLoc
end if
end repeat
sort(selectionRange)
if getAt(selectionRange, 1) = getAt(selectionRange, 2) then
set singleSelection to 1
set the theSelection of gObj3 to [getAt(selectionRange, 1) - 1]
set the rect of sprite 20 to theRect + [0, xtraOffset, 0, xtraOffset]
clearSelection(me, 1)
else
set the theSelection of gObj3 to [getAt(selectionRange, 1), getAt(selectionRange, 2) - 1]
end if
set lineRange to [the number of lines in char 1 to getAt(the theSelection of gObj3, 1) of theTxt]
if not singleSelection then
add(lineRange, getAt(lineRange, 1) - 1 + the number of lines in char getAt(the theSelection of gObj3, 1) to getAt(the theSelection of gObj3, 2) of theTxt)
end if
repeat with i in the softReturnsList of gObj3
if i < getAt(lineRange, 1) then
setAt(the theSelection of gObj3, 1, getAt(the theSelection of gObj3, 1) - 1)
end if
if not singleSelection then
if i < getAt(lineRange, 2) then
setAt(the theSelection of gObj3, 2, getAt(the theSelection of gObj3, 2) - 1)
end if
end if
end repeat
end
on clearSelection me, startFrom
repeat with i = startFrom to 7
set the locH of sprite (20 + i) to 9000
end repeat
updateStage()
end
on updateInsertion me
set theTxt to the text of member myMemb
set charTotal1 to getAt(the theSelection of gObj3, 1)
set charTotal1 to charTotal1 + addAll(the softReturnsList of gObj3, charTotal1) + 1
set i to the number of lines in char 1 to charTotal1 - 1 of theTxt
set xtraOffset to 0
set hLoc to the locH of charPosToLoc(member myMemb, charTotal1) + the locH of offsetLoc
set vLoc to ((i - 1) * lneHite) + the locV of offsetLoc
if char charTotal1 - 1 of the cBalloonString of gObj3 = RETURN then
beep()
end if
set theRect to rect(hLoc, vLoc, hLoc - 1, vLoc + lneHite)
set the rect of sprite 20 to theRect + [0, xtraOffset, 0, xtraOffset]