[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: problem with different size images in table widget item

Hi Neelesh,

The behaviour of Tables and Trees is to make all images in the control have
the same dimensions as the first image that was set in.  Since you are
calculating the maximum image with that you have, you should be able to make
this work by setting this image first.

For an example of increasing the heights of items in Tables and Trees see
http://www.eclipse.org/articles/Article-CustomDrawingTableAndTreeItems/customDraw.htm#_Example1
(note that all items in a Table or Tree will have a shared height).  There's
also an API request for this, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=148039 .

Grant


"Neelesh Thakur" <neelesh.thakur@xxxxxxxxx> wrote in message
news:2cd4e7074a13728f76adbc831db5277f$1@xxxxxxxxxxxxxxxxxx
> Hi
>
> I am working on Table widget which have some columns of different width.
> Of these columns I want to display images in two columns [suppose A and
> B], and repeat the things for multiple rows. Size of the images are
> different. I am calculating the maximum width of image and setting up the
> width of column according to the maximum width of image from image array
> for that column, so A and B can have different width according to images.
> These image also different heights.
>
> Now when I display table; images do not come with orignal sizes only the
> first row and first image are in orignal size [cosidering in first row
> second image size is greater than first image] and others are shrinked
> according to size of this image width and height. So even though I have
> set up the width of the two columns different still the image will appear
> in  the same size so as to first image in first row. These things are
> replicated in each row making it very odd to look like. Since TableColumn
> and TableItem do not have height property I cannot manually adjust the
> size of any of the table's cell.
>
> Question: How can have control over the individual cell  in Table widget
> so that I set up height and width with respect to each image.
>
> Any pointers to any help file will be very useful.
>
> Please let me know how to proceed for this problem.
>
> Thanks
> Neelesh
>