[ANN] GetInLine, Now More In Line

Wilhelm Sanke sanke at hrz.uni-kassel.de
Fri Jan 14 15:52:23 EST 2005

On Thu, 13 Jan 2005, Scott Rossi <scott at tactilemedia.com> wrote:

> An update to the previous GetInLine stack has been posted.  For those who
> missed it, this is an attempt at a more intuitive method for drag-and-drop
> repositioning of lines within list fields.
> This post contains tightened up code and performance, constrained 
> dragging,
> no more messing with hiliteColor, and now should work on *both* Win 
> and Mac
> platforms.   Please try to break it so it can get better.
> In your message box:
>   go url "http://www.tactilemedia.com/download/getinline.rev"
> -----
> One cosmetic issue I can't figure out: when doing a screencapture here on
> WinXP, the desktop icons flash as if the desktop is being redrawn.  
> Any way
> to avoid this phenomenon?
> Best Regards,
> Scott Rossi

The flashing does not occur, as you would assume of course, when you do 
not work with a screencapture, like in the script below.
This script was put together with the help of Scott Raney when I tried 
to transfer a Toolbook-script routine to Metacard.
It is used - for example - in the "Slideshow" sample stack available on 
my website. The purpose there is the possibility to rearrange the image 
names (or even delete some of them with another script) before the 
slideshow is started.

Compared to yours it is a rather primitive script, which needs to be 
improved, e.g. one thing that is missing is the possibility to work with 
scrolling fields. But it works nevertheless when you scroll the field 
between the drags.

Or something in the direction of

"set the scroll of me to the mousev - item 2 of the topleft of this stack"

should be added. I did not yet try such an improvement.

Here is the script:

"on mouseDown
  put word 2 of the clickLine into cl
  set the textstyle of line cl of me to bold
  put item 2 of the mouseLoc into starty
  put the effective textHeight of me into th
  repeat while the mouse is down
    if item 2 of the mouseLoc - starty > (th/2) then
      lock screen
      put cr & line cl of me after line cl + 1 of me
      delete line cl of me
      add 1 to cl
      set the textstyle of line cl of me to bold
      add th to starty
      unlock screen
     else if starty - item 2 of the mouseLoc > (th/2) then
      lock screen
      put line cl of me & cr before line cl - 1 of me
      delete line cl + 1 of me
      subtract 1 from cl
      set the textstyle of line cl of me to bold
      subtract th from starty
      unlock screen
    end if
  end repeat
  set the textColor of line cl of me to empty
  set the textstyle of line cl of me to plain
end mouseDown"

--Wilhelm Sanke

More information about the Use-livecode mailing list