Docking Stacks

J. Landman Gay jacque at hyperactivesw.com
Tue Mar 2 13:05:01 EST 2010


Andrew Kluthe wrote:
> I searched around and haven't really found anything about interactions
> between multiple stacks similar to docking.
> 
> The Problem: I have 4 stacks That I want to dock to the edges of each other
> (open on the edge, snap to the edge, etc).
> 
> 1. Two of the stacks are menu stacks on either side of the larger main
> stack:
> 
> One of these is used a menu to navigate the different aspects of the app.
> The other is used to display a report list depending on the selection in the
> menu stack.
> 
> 2. A stack on the bottom to continually display help information.
> 
> 3. The main stack is in the middle of all of this and the others need to
> snap/dock/open on the edge of this stack.
> 
> [Menu stack][----MAIN STACK----][Reports Stack]
> [----------Help Stack---------------]
> 
> 
> Any ideas on how to start adding this functionality?
> 
> 

Just set the correct side of one of the substacks to the correct side of 
the main stack. It's pretty easy:

set the left of stack "reports stack" to the right of stack "main stack"
set the right of stack "menu stack" to the left of stack "main stack"
set the top of stack "help stack" to the bottom of stack "main stack"

etc.

If you want snapping behavior, handle the moveStack message and check if 
the two stack edges are within a certain distance of each other. If so, 
set the edges as per above to achieve a sudden "snap".

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list