Hi all!

I have a weird problem about sizing of tilelists/items and before I pull out
the last remaining straws on my head I decided to see if any experts had
knowledge to share.....

I have number of TileLists on screen, the actual number of lists and their
size is something the user can customize, but typically it will be 1-4 lists
sized as % on both width/height.

In the tilelist I want to show data with a specific item renderer....
but which item renderer is also something that the user can customize.

So typically I will have a TileList of unknown size in pixels. Lets say that
I want to show a list with 3 rows vertically and the amount of columns is
based on the amount of items in the data provider.

Is it possible to have the item renderer resize to the available
size.....ie. around 1/3 of the tilelist height if we take gaps into
consideration.

Below is what i'm trying to do:

*var* paneTemp:TileList = *new* TileList();
paneTemp.styleName = *"basePane"*;
*var* paneStyle:CSSStyleDeclaration = *new* CSSStyleDeclaration;
paneStyle = xmlToStyleDeclaration(XMLList(panesXML.constraints),paneTemp);
// This is where I find the properties for size/position....
paneTemp.styleDeclaration = paneStyle;

*var* item1:ContentItem = *new* ContentItem();
item1.contentImage = *"img/folder1.jpg"*;
item1.contentTitle = *"Item 1"*;
contentList0.addItem(item1);

*var* item2:ContentItem = *new* ContentItem();
item2.contentImage = *"img/folder2.jpg"*;
item2.contentTitle = *"Item 2"*;
contentList0.addItem(item2);

paneTemp.itemRenderer=*new* ClassFactory(ContentRenderer1);
paneTemp.dataProvider = contentList0;
paneContainer.addChild(paneTemp);

The item renderer only have a max width/height defined and then I override
the measure function to have the default size set to something different
than whatever component the item renderer is based on. So in the example
above the measure function of the item renderer set default size to 195w x
225h and that size is also the maxW/H for the item renderer.

I would like it so that they have the default size if there's room,
otherwise scale down to whatever size can fit in the list. I do not want the
items to get bigger than the default/max size.

The above example shows the items at the correct size if rowCount is not set
for the TileList, but the TileList itself is larger than the size it was
originally set to. If the TileList is empty the size is correct.

The problem is best illustrated visually, so I have made an image of 3
scenarios. The image can be found at http://www.bimlab.net/allan/scaling.jpg

Thanks in advance!

Allan

Reply via email to