Going between stacks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Going between stacks
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
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
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
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
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
I think you can make the image smaller by adjusting the width and height.
Re: Going between stacks
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!
Thanks!
Re: Going between stacks
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:
Kind regards,
Mark
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
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Going between stacks
Wow! That is exactly what I needed. Thank you so much, Mark!