grabber in Rev (was PDF)

Ken Norris pixelbird at interisland.net
Fri Mar 5 14:29:44 EST 2004


Hi Chris,

> Date: Fri, 5 Mar 2004 09:27:13 -0500
> From: Chris Condit <ccondit at geo.umass.edu>
> Subject: grabber in Rev (was PDF)
> 
> Hi List (especially Ken N. and Brian Yennie)-
> 
> I noticed in Rev list V. 6 Issue 38 Ken N. & Brian Yennie traded info about:
> 
> "and plugged the
> *genuine* Rev-style mouseMove grab/scroll handlers into the image script.
> 
> It works beautifully. Grab/scrolls like its on bed of ball bearings. No
> problems, no joke."
> -----------
> 
> Is this an new thing, like the old SuperCard "grabber"? -
-----------
No. Rev has a 'grab' command, but it's basically useless because you can't
run anything of value with it, IOW, there is no way to program it to
constrain movement or define limits or anything else you would need to do
with a grab command.
-----------
> I didn't think Rev 2.1.2 had any grabber capability.
> 
> I don't see any info in it with the rev doc included with the application.
-----------
Look up "grab" in the dictionary. Not that it will do any good for you (see
above).
-----------
> I have a "fake" grabber, buy would sure like areal one., so I could
> simplfy that code
-----------
Right. What I meant was in comparison to old HC-style code that works like:

on mouseDown
  repeat until the mouse is up
  --etc.

...which hogs the processor.

Since you can't constrain movement with Rev's 'grab' command, the real Rev
way to do these things is in a mouseMove handler. Here is the tested and
working example script of the image of my map-scrolling test group:

on mouseDown
  global gTX,gTY
  put item 1 of mouseLoc() into gTX
  put item 2 of mouseLoc() into gTY
  set the allowMove of me to true ## automatically creates a custom prop
end mouseDown

on mouseMove x,y
  global gTX,gTY
  if the allowMove of me then
     set hScroll(group id 1007) to hScroll(group id 1007)+(gTX-x)
     set vScroll(group id 1007) to vScroll(group id 1007)+(gTY-y)
     put x into gTX
     put y into gTY
   end if
end mouseMove

on mouseUp
  global gAllowMove
  set the allowMove of me to false
end mouseUp
 
> -----------
> 
> Also is there a 4000 pixel limit and does that apply to both length
> and width, does anyone know?
-----------
I dunno. I didn't know _what_ it applied to until Tom sent the latest PDF
conversion of the map in question to me. He reports that one of the hi-res
conversions came out to a height of 5100 pixels and displayed garbage, if
that helps.

Ken N.



More information about the use-livecode mailing list