staffan
4 Jul 2008, 5:51 AM
Hi!
I'm using the ColumnLayout on a FormPanel and i discovered some unexpected behaviour when using three decimals to specify column width. See exempel below, here suiDetails is the Formpanel (with ColumnLayout) and first-second are LayoutContainers. This code:
suiDetails.add(first,
new ColumnData(0.2));
suiDetails.add(second, new ColumnData(0.2));
suiDetails.add(third, new ColumnData(0.225));
suiDetails.add(fourth, new ColumnData(0.225));
suiDetails.add(fifth, new ColumnData(0.15));
..will result in a FormPanel where 'fifth' turns up at the left side below 'first' and not as a fifth column as expected. There is enough room for the LayoutContainers in the FormPanel. (If the FormPanel is collapsed and the reopened, the 'fifth' turns up where it supposed to be, on the right side!!!)
Changing the code to:
suiDetails.add(first,
new ColumnData(0.2));
suiDetails.add(second, new ColumnData(0.2));
suiDetails.add(third, new ColumnData(0.2));
suiDetails.add(fourth, new ColumnData(0.2));
suiDetails.add(fifth, new ColumnData(0.15));
..will generate the expected result; five columns beside each other.
Is the ColumnLayout unable to handle three decimals? Maybe the 0.225-values are rounded to 0.23 somewhere?
Suggestion:
Make a note in the API not to use more than 2 decimals when specifying width as percent.
I'm using the ColumnLayout on a FormPanel and i discovered some unexpected behaviour when using three decimals to specify column width. See exempel below, here suiDetails is the Formpanel (with ColumnLayout) and first-second are LayoutContainers. This code:
suiDetails.add(first,
new ColumnData(0.2));
suiDetails.add(second, new ColumnData(0.2));
suiDetails.add(third, new ColumnData(0.225));
suiDetails.add(fourth, new ColumnData(0.225));
suiDetails.add(fifth, new ColumnData(0.15));
..will result in a FormPanel where 'fifth' turns up at the left side below 'first' and not as a fifth column as expected. There is enough room for the LayoutContainers in the FormPanel. (If the FormPanel is collapsed and the reopened, the 'fifth' turns up where it supposed to be, on the right side!!!)
Changing the code to:
suiDetails.add(first,
new ColumnData(0.2));
suiDetails.add(second, new ColumnData(0.2));
suiDetails.add(third, new ColumnData(0.2));
suiDetails.add(fourth, new ColumnData(0.2));
suiDetails.add(fifth, new ColumnData(0.15));
..will generate the expected result; five columns beside each other.
Is the ColumnLayout unable to handle three decimals? Maybe the 0.225-values are rounded to 0.23 somewhere?
Suggestion:
Make a note in the API not to use more than 2 decimals when specifying width as percent.