Tuesday, June 1, 2010

nested layout issues

Hi,

my WebApp has an outer DockLayoutPanel, where the borders build the
edges of the screen. Within its center, I have a VerticalPanel. The
vertical one contains a MenuBar at the top, a statusbar at the bottom,
and a HorizontalPanel in the middle. The HorizontalPanel is the "main"
or "client" panel, i. e. the panel that contains the actual things the
user should work with, e. g. different forms.

With this nested layout the "client" portion is always centered within
the browsers window. I use SimplePanel for the different "client" gui
objects, and it works fine. For example, if I want to show a login
form, I put it in a SimplePanel and add it to my client (the
horizontal panel mentioned above).

However, there are reasons for me to use DockLayoutPanel as the
container for my client gui things. When I do this, the panel is
always so small that you can just see its borders. Even if I put
TextBoxes and Labels in it, it does not get bigger. While the
SimplePanel seems always to be "as big as needed", the DockLayoutPanel
ist always at the smallest dimensions.

Can I tell the DockLayoutPanel to get pumped up until its big enough
for its contents?
Could it be that the outer panels force it to be that small?

Help would be great!

I post my layout method below...

Thanks
Magnus

-----

private boolean createPanel ()
{
//////////////////
// pnl

pnl.setSize ("100%","100%");
pnl.addNorth (new SimplePanel (),mtr_Border);
pnl.addSouth (new SimplePanel (),mtr_Border);
pnl.addWest (new SimplePanel (),mtr_Border);
pnl.addEast (new SimplePanel (),mtr_Border);

//////////////////
// vp

VerticalPanel vp = new VerticalPanel ();
vp.setSize ("100%","100%");
vp.setVerticalAlignment(ALIGN_MIDDLE);

SimplePanel stb = new SimplePanel (); // status bar

HorizontalPanel hp = new HorizontalPanel ();
hp.setHorizontalAlignment(ALIGN_CENTER);

vp.add(mnb); // menu bar
vp.add(hp);
vp.add(stb); // status bar

vp.setCellHorizontalAlignment(hp,ALIGN_CENTER);
vp.setCellHeight(stb,"10px");
vp.setCellHeight(hp,"100%");

pnl.add(vp);

pnl_Center = hp;

//////////////////
// root

RootLayoutPanel root = RootLayoutPanel.get();
root.add (pnl);

return (true);
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate