Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

VStack height in a HStack

$
0
0
SmartClient Version: v9.0p_2013-08-16/Pro Deployment (built 2013-08-16)

I have a HStack with some VStacks as members, and the VStacks have some layout members that can be dragged between these VStacks.

My problem is that when i drag enough layouts into a VStack and it expands in height, the other VStacks don't follow. I want the VStacks to always have the full height if their HStack parent.

This example illustrates my problem. When you drag all the grey layouts to one VStack, they dont have the same height.

Code:

VLayout mainLayout = new VLayout();
mainLayout.setHeight(200);
mainLayout.setWidth(221);

VStack vStack1 = new VStack(10);
vStack1.setWidth(100);
vStack1.setHeight100();
vStack1.setBackgroundColor("red");
vStack1.setCanAcceptDrop(true);
vStack1.setDropTypes("test");

VStack vStack2 = new VStack(10);
vStack2.setWidth(100);
vStack2.setHeight100();
vStack2.setBackgroundColor("green");
vStack2.setCanAcceptDrop(true);
vStack2.setDropTypes("test");

HStack hStack = new HStack();
hStack.setBorder("2px solid black");
               
Layout layout1 = new Layout();
layout1.setBackgroundColor("grey");
layout1.setWidth("90%");
layout1.setHeight(100);
layout1.setLayoutAlign(Alignment.CENTER);
layout1.setBorder("1px solid black");
layout1.setCanDragReposition(true);
layout1.setCanDrop(true);
layout1.setDragType("test");
               
Layout layout2 = new Layout();
layout2.setBackgroundColor("grey");
layout2.setWidth("90%");
layout2.setHeight(100);
layout2.setLayoutAlign(Alignment.CENTER);
layout2.setBorder("1px solid black");
layout2.setCanDragReposition(true);
layout2.setCanDrop(true);
layout2.setDragType("test");
               
Layout layout3 = new Layout();
layout3.setBackgroundColor("grey");
layout3.setWidth("90%");
layout3.setHeight(100);
layout3.setLayoutAlign(Alignment.CENTER);
layout3.setBorder("1px solid black");
layout3.setCanDragReposition(true);
layout3.setCanDrop(true);
layout3.setDragType("test");

Layout layout4 = new Layout();
layout4.setBackgroundColor("grey");
layout4.setWidth("90%");
layout4.setHeight(80);
layout4.setLayoutAlign(Alignment.CENTER);
layout4.setBorder("1px solid black");
layout4.setCanDragReposition(true);
layout4.setCanDrop(true);
layout4.setDragType("test");

vStack1.setMembers(layout1, layout2);
vStack2.setMembers(layout3, layout4);

hStack.setMembers(vStack1, vStack2);
               
mainLayout.addMember(hStack);

How do I make sure the other VStacks expand together with the HStack?

/Niels

Viewing all articles
Browse latest Browse all 4756

Trending Articles