Page 1 of 1

Going between stacks

Posted: Mon Jun 25, 2012 4:07 pm
by laurpapo
Hi,

So I have a substack that is being used as a kind of tool palette, with various buttons on it. One of these buttons functions to create a new field on the main card when pressed. I want to enable a sort of click and drag feature, so that when the button is clicked, the user can hold the mouse down, an image of the field appears (I have this part down) and then they can move the mouse onto the main stack and 'drop' the field (in reality, the field that appears on the tool palette is just an image, and I want the actual field to be created on mouseup on the main card).

Is this possible? I'm having trouble navigating between the stacks while keeping the mouse down.

Thanks!

-Laurel

Re: Going between stacks

Posted: Mon Jun 25, 2012 4:11 pm
by laurpapo
Or if there is a way to change the cursor to an image, that would help. I couldn't figure that one out either...

Re: Going between stacks

Posted: Mon Jun 25, 2012 4:38 pm
by townsend
Changing the cursor to an image:

Code: Select all

on mouseUp --turn image on
     set lockcursor to true
     set cursor to 1210
end mouseUp

on mouseUp -- turn image off
  set lockcursor to false
end mouseUp

Re: Going between stacks

Posted: Mon Jun 25, 2012 4:45 pm
by laurpapo
It works for changing my cursor to something, but I think my image is too big. Is there anyway I can change the cursor to the size of my image?

Re: Going between stacks

Posted: Mon Jun 25, 2012 5:24 pm
by townsend
I think you can make the image smaller by adjusting the width and height.

Re: Going between stacks

Posted: Mon Jun 25, 2012 5:30 pm
by laurpapo
Hmmm thanks for the help but won't quite achieve what I'm going for. I think I just have to figure out how (if possible) to move between stacks even when the mouse is down, which I am having an impossible time doing.

Thanks!

Re: Going between stacks

Posted: Mon Jun 25, 2012 6:10 pm
by Mark
Hi,

Make a new stack, add an image of a field to it, set its windowShape to the id of the image and set the style of the stack to palette. Name the stack "Field Shape". Create a button with the following script:

Code: Select all

on mouseDown
  set the loc of stack "Field Shape" to the screenMouseLoc
  show stack "Field Shape"
  repeat until the mouse is up
    set the loc of stack "Field Shape" to the screenMouseLoc
  end repeat
  hide stack "Field Shape"
  // check if the mouse cursor is within an "editable" window and
  // create your field etc.
end mouseDown
Kind regards,

Mark

Re: Going between stacks

Posted: Mon Jun 25, 2012 6:42 pm
by laurpapo
Wow! That is exactly what I needed. Thank you so much, Mark!