Hi All,
I am new to IT Mill Toolkit and I am trying to put together a demo of a simple two pane application.
No matter what I do I cannot seem to get the panes to layout correctly.
I want a single ‘toolbar’ pane across top of application.
Beneath that should be a ‘navigation’ pane on the left and a ‘content’ pane on the right.
Naturally, I want the content pane to suck up all available space and the toolbar and navigation panes to use only as much space as required.
At the bottom of this message is a simple test program I have written.
No matter what I do I cannot get the panes to size correctly.
The problem is that the ‘navigation’ pane is always hidden, it is always sized with a pixel width of 0.
However, while the horizontal sizing is wrong the vertical sizing is fine, even though I use exactly the same code for creating the vertical layout.
Can somebody show me some code that correctly formats three panes?
Have I run into a bug?
Thanks,
-ted
import com.itmill.toolkit.Application;
import com.itmill.toolkit.ui.Component;
import com.itmill.toolkit.ui.HorizontalLayout;
import com.itmill.toolkit.ui.Label;
import com.itmill.toolkit.ui.VerticalLayout;
import com.itmill.toolkit.ui.Window;
public class DemoApplication
extends Application
{
@Override public void init()
{
Component lowerRight= new Label("CONTENT");
Component lowerLeft= new Label("NAVIGATION");
Component top= new Label("HEADER");
HorizontalLayout horizontalLayout= new HorizontalLayout();
horizontalLayout.setSizeFull();
horizontalLayout.addComponent(lowerLeft);
horizontalLayout.addComponent(lowerRight);
horizontalLayout.setExpandRatio(lowerRight, 1);
VerticalLayout verticalLayout= new VerticalLayout();
verticalLayout.setSizeFull();
verticalLayout.addComponent(top);
verticalLayout.addComponent(horizontalLayout);
verticalLayout.setExpandRatio(horizontalLayout, 1);
Window window= new Window();
window.setCaption("Three Pane Demo");
window.setSizeFull();
window.setLayout(verticalLayout);
setMainWindow(window);
}
}