Here is the behaviour to allow drag and drop editing line by line only
I wanted to allow individual character copying using sel start and sel end
but I have a tight deadline at the moment so here it is warts and all. Sorry
for the sparse comments.

regards
Brad
-------

property spriteNum
property PmySprite
property PmyLine
property Pdragging
property PmyOLDLine
property PstoredText

on beginsprite me
  -- check only attched to a field
  PmySprite=sprite(me.spriteNum)
  PmyType=PmySprite.member.type
  if Pmytype<>#field then
    alert " Not a field sprite"
    exit
  end if
  Pdragging=false
end

on mouseEnter me
  cursor 280
end

on mousewithin
  -- store the line under the cursor and hilite
  if Pdragging=FALSE then
    PmyLine =PmySprite.pointToLine( the mouseLoc)
    PmySprite.member.line[PmyLine].hilite()
  end if
end

on mouseDown me
  cursor 290
  -- store the original text to delete after pasting
  Pdragging=TRUE
  PmyOLDline=PmyLine
  PstoredText=PmySprite.member.line[PmyLine]
  if PstoredText="" then
    alert" Nothing selected"
    Pdragging=FALSE
    exit
  end if
end

on mouseUp
  cursor 280
  -- reset the line paste in the stored text and concatenate the text again
and delete the old line
  PmyLine = pointToLine(PmySprite, the mouseLoc)
  PmySprite.member.line[PmyOLDLine].delete()
  PmySprite.member.line[PmyLine] =  PstoredText &  return  &
PmySprite.member.line[PmyLine]
  pDragging=FALSE
end

on mouseUpOutside
  cursor 0
end

on mouseLeave
  cursor 0
  -- remove hilite
  mycount= PmySprite.member.line.count
  PmySprite.member.line[mycount+1].hilite()
end



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to