Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 193302 - TableItem.getBounds calculates wrong width if table style is SWT.CHECK
Summary: TableItem.getBounds calculates wrong width if table style is SWT.CHECK
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Rüdiger Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-19 07:40 EDT by Benedikt Arnold CLA
Modified: 2008-09-24 05:42 EDT (History)
0 users

See Also:


Attachments
Short patch wich solves the descriped bug (886 bytes, patch)
2007-06-19 07:42 EDT, Benedikt Arnold CLA
no flags Details | Diff
Replacement for the patch above (1.07 KB, patch)
2007-06-19 10:24 EDT, Benedikt Arnold CLA
jkrause: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benedikt Arnold CLA 2007-06-19 07:40:48 EDT
After creating a table viewer like this CheckboxTableViewer.newCheckList(parent, SWT.NORMAL); I noticed that the size of the items isn't right. The end of the items was cut away. After debugging a while I noticed that getBounds calculates something like "string width" - left, while left is the width of the checkbox. After changing it to "string widht" + left everything appears right. I will provide a patch.
Comment 1 Benedikt Arnold CLA 2007-06-19 07:42:12 EDT
Created attachment 71722 [details]
Short patch wich solves the descriped bug

I only changed "-" to "+"
Comment 2 Benedikt Arnold CLA 2007-06-19 10:24:08 EDT
I experimented a bit and noticed the same bug if the TableItem has an image. I will provide a new patch.
Comment 3 Benedikt Arnold CLA 2007-06-19 10:24:40 EDT
Created attachment 71743 [details]
Replacement for the patch above
Comment 4 Rüdiger Herrmann CLA 2007-06-21 17:30:12 EDT
Thanks for the hint and the patches.
Concerning the wrong check box width calcuation:
I changed the calculation to width = <text-width> (without +/- left) as the check box is not considered part of the TableItem. At least from what I observed in SWT on Win32.
In case of a column-less table, the LifeCycleAdapter now adds the needed space for the check box.
If the column width is still to small this is probably due to the text size approximation (plans are to replaced this by a real text size *calculation* in M5).
Changes are committed to CVS HEAD
Comment 5 Rüdiger Herrmann CLA 2007-06-21 17:49:58 EDT
Width of an image (if any) is now added to the total with of the TableItem when no columns are specified.
Changes are in CVS HEAD