Click the links below to explore the different sections of our site. If you have any questions about our products or services, don't hesitate to contact us.
Following are a number of links to pages that might interest you as a visitor of this web site.
copyright © 2005-07 by Mark Schonewille & Economy-x-Talk

Economy-x-Talk - Sample Scripts

Drag Text

This script deals with card fields, but you can change it yourself to handle background fields. Create an additional transparent card field named "Drag Me" and give it the same style settings as the field that contains the draggable text.

If you want to drag text from editable fields, just press the command key while dragging with the mouse.

Put the dragText script into the stack or background or card script.

Put the tiny mouseDown script into the script of every field that you want to have draggable text.

MS





on dragText
  put value(the target) into theTarget
  set the cursor to "Hand" -- or any other cursor you like
  set the rect of cd fld "Drag Me" to the rect of the target
  put theTarget into cd fld "Drag Me"
  show cd fld "Drag Me"
  put the mouseLoc into oldLoc
  put the loc of cd fld "Drag Me" into oldFldLoc
  repeat until the mouse is up
    put (item 1 of oldFldLoc + (item 1 of the mouseLoc - item 1 of oldLoc)) & ¬
    comma & (item 2 of oldFldLoc + (item 2 of the mouseLoc - item 2 of oldLoc)) ¬
    into newLoc
    set the loc of cd fld "Drag Me" to newLoc
  end repeat
  hide cd fld "Drag Me"
  repeat with x = 1 to number of cd fields
    if the mouseLoc is within the rect of cd fld x and ¬
    x is not the number of cd fld "Drag Me" then
      put x into targetFld
    end if
  end repeat
  if there is a cd fld targetFld then put theTarget into cd fld targetFld
  click at 0,0
end dragText

on openCard
  put empty into cd fld 2
end openCard





Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars.This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you.
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.