Moving stacks . . .

MisterX b.xavier at internet.lu
Wed Jun 8 13:48:53 EDT 2005


Hi Roger

Welcome to runrev ;)

First you need to find more about mouse verbs like move and set
then hte "mouse" properties like the mouseloc

so you get to script this for xample:

  set the mouseloc to (x,y) 

you can also do:

  put x & comma & y into apoint
  set the mouseloc to apoint

Simulating a mouse drag though is via the handler

  put apoint into xy[1]
  put apoint into xy2[1]
  multiply item 1 of xy2[1] by 2
  multiply item 2 of xy2[1] by 2
  drag mouse from xy[1] to xy2[1]

This drags controls or the pencil to draw or paint

To move a stack, you need to do it via

  set the topleft of stack x to apoint

or any variation like set the :
  loc[ation] of
  rect of
  left of 
  top of 
  right of 
  bot[tom] of 
and all the corners like 
  topleft
  botleft
  topright
  bot[tom]right

Hope that makes the mouse object clearer in terms properties and "methods".

To resize a stack, it's easier to set it's rect than 
  lock screen
  set height of this stack to y
  set the top of this stack to oldtop -- annoying side effect

the right way being 

  get the rect of thiscontrol
  add item 2 of it + h to item 4 of thiscontrol
  set the rect of thiscontrol to it

The rest is easy to find... experimenting of free new stacks is easy ;)

cheers
Xavier
http://monsieurx.com/taoo

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Roger Guay
> Sent: Wednesday, June 08, 2005 18:43
> To: use-revolution at lists.runrev.com
> Subject: Moving stacks . . .
> 
> Sorry to bother you with what probably is simple.  I am 
> trying to move a tiny stack "Hand" from the location of a 
> button in stack "Main" to the location of a button in stack 
> "Sub".  You can see that  
> I am trying to simulate the movement of the mouse over other 
> stacks.   
> First question is: is there a way to move the mouse?  If not, 
> how can I easily move the tiny stack "hand" between the 
> locations within other stacks?  I'm getting wrapped around 
> the axle with globalLoc and  
> LocalLoc, etc.   I know that I could work out the geometry of 
> getting  
> positions relative to the topleft of the stacks.  but If 
> there is an easier way . . . . .
> 
> Thanks very much for your help.
> 
> Cheers, Roger
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list