It's because the deck part of the tabpanel expands its contents to full
width. Always been annoying, that one.

The decorated panel then stretches and the cells work out their own widths.
This means that the edge cells (decorated bits) stretch to greater than they
should be and you see all the image that you should only see a small part
of.

Two fixes spring to mind:

1) set the width of the decorated panel's content to 1000px minus the two
edge widths - difficult if you use percentages or

2) put the decorated panel in another panel (simplepanel, flowpanel) and put
that in the tabpanel deck

Ian

http://examples.roughian.com


On 29 March 2010 14:10, Fendy Tjin <fendyt...@gmail.com> wrote:

> Decorator panel outlook went a mess when expanded its width.
>
>
> example source:
>
> DecoratedTabPanel tabPanel = new DecoratedTabPanel();
>
> // expand the width of the tab panel
> tabPanel.setWidth("1000px");
> tabPanel.setAnimationEnabled(true);
>
> // a new tab
> String[] tabTitles = { "Home", "Content", "More Info" };
>
> // set a new table
> FlexTable helloWorldTable = new FlexTable();
> helloWorldTable.setCellSpacing(5);
> helloWorldTable.setTitle("Hello World Example");
> FlexCellFormatter cellFormat = helloWorldTable.getFlexCellFormatter();
>
> helloWorldTable.setHTML(0, 0, "Hello World Example");
> cellFormat.setColSpan(0, 0, 3);
> cellFormat.setHorizontalAlignment(0, 0,
> HasHorizontalAlignment.ALIGN_CENTER);
>
> helloWorldTable.setHTML(1, 0, "Say hello, ");
> final TextBox nameField = new TextBox();
> nameField.setFocus(true);
> nameField.selectAll();
> helloWorldTable.setWidget(1, 1, nameField);
> final Button sayButton = new Button("Say");
> helloWorldTable.setWidget(1, 2, sayButton);
>
> // Wrap the content in a DecoratorPanel
> DecoratorPanel decPanel = new DecoratorPanel();
> // decPanel.setWidth("500px");
> decPanel.add(helloWorldTable);
> // decPanel.setWidget(helloWorldTable);
>
> tabPanel.add(decPanel, tabTitles[0]);
>
> // Add a tab
> tabPanel.add(new HTML(), tabTitles[1]);
>
> // Add a tab
> HTML moreInfo = new HTML("etc");
> tabPanel.add(moreInfo, tabTitles[2]);
>
> tabPanel.selectTab(0);
>
> RootPanel.get().add(tabPanel);
>
> --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to