Community
Participate
Working Groups
20070319 When I use owner draw on a TreeItem or TableItem and want to draw text at the same location as where the native painter would draw the text, I need to know a x and y offset relative to the items bound. I believe the offsets depend on the OS and on the font used.
I would like to fix this but it requires new API. Please apply pressure to make it happen.
ok, I will
*** Bug 134504 has been marked as a duplicate of this bug. ***
Created attachment 63610 [details] SWT snippet SWT snippet that shows how we use owner draw. It also shows the usage of hard coded constants: int x= bounds.x + 2; int y= bounds.y + 2; I'm not sure if the 'y' can be computed by using the bound height and font height. Comments from the SWT team about the snippet are highly welcome.
Steve, can you maybe add a patch to show a preview of the required new API? We can then post this bug to the PMC mailing list for approval.
Fooling around with offsets won't work. Some platforms leave space for images even though there is no image there. The API I have in mind is TableItem.getTextBounds(int) and TreeItem.getTextBounds(int). I am just hacking up test code and implementations on all platforms to make sure it works.
Martin, please post this bug on the PMC list.
PMC request sent
+1
Fixed > 20070423. See TableItem.getTextBounds(int) and TreeItem.getTextBounds(int).
All versions except win32 are currently missing Javadocs.
All SWT javadocs will be copied from windows to the other platforms close to the end of 3.3.