marcelloe wrote:I can't picture how the second stack with the buttons will work with the main stack. I would really like to have the buttons on the main stack for easy use.
I think the key here is Craig's suggestion, "You must learn to walk before you can run."
Right now LC makes it relatively easy to use tool modes if you have all stacks that won't be affected by the tools in a mode other than toplevel (such as palette or modeless). LC's IDE provides a good example of this, as do many drawing/painting programs that use tool palettes.
As I noted above, the challenge with the design you're looking for is that tool mode in LC are currently global in scope - they will affect the entire content region of all toplevel stacks.
It's possible to work around this, but it will require a bit of work and some experimentation. So to first get you familiar with the basics of working with tool modes, try Craig's suggestion of implementing that as a palette just to get you started.
Once that's working well and you feel confident with what you've learned, the next steps would be:
1. Make an empty image object as the recipient for the paint. This will prevent LC from creating a new image, as it would normally do when using the paint tools, but automatically-crreated images will be the full size of the card, overlapping your other controls, which is not what you want.
2. You may want to put that image object within a group so it can scroll if the stack is resized smaller than the full size of the image. This would require adding a resizeStack handler to the card or stack script to handle the resizing of the group.
3. Track the mouse and change the tool to the browse tool whenever it leaves the image.
4. The controls which set the tool mode ("brush", "line" etc) will need to store their mode somewhere so it can be restored when the mouse returns to the image - a custom property of the image, card, or stack would do.
5. When the mouse returns to the image area you'll want to set the tool back to the choden painting tool.
6. It may also be a good idea to set the cantSelect property of all controls outside of the image to true, to minimze inappropriate interactions with them. Note that this will prevent you from selecting them with the pointer tool in the IDE, however, so you'll want to do that late in the process if at all.
As you can see, there's a bit to it, but it's doable. I would strongly support Craig's suggestion of first putting the controls in a palette to make sure you're confident with the basics, and only then dive into these further enhancements to pursue the design you're looking for.