Bug 59244 - Auto-sizing table column does not take font styles into account
Summary: Auto-sizing table column does not take font styles into account
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-20 09:36 EDT by Ondrej Chylik CLA
Modified: 2019-09-06 16:07 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Chylik CLA 2004-04-20 09:36:10 EDT
Auto-sizing a table column by double-clicking on its border in the table header 
does not take font styles into account - bold text, if present in a cell of the 
column, may get clipped.
Comment 1 Grant Gayed CLA 2004-04-22 09:04:26 EDT
snippet follows that shows this:

public class Main {
public static void main (String [] args) {
	String[] itemText = new String[] {"abcdefghijklmnop","a"};
	final Display display = new Display ();
	Shell shell = new Shell (display);
	shell.setBounds(10,10,300,300);
	final Table table = new Table(shell, SWT.NONE);
	table.setBounds(10,10,200,200);
	table.setHeaderVisible(true);
	new TableColumn(table, SWT.NONE).setWidth(50);
	new TableColumn(table, SWT.NONE).setWidth(150);
	TableItem item = new TableItem(table, SWT.NONE);
	item.setText(itemText);
	FontData data = table.getFont().getFontData()[0];
	data.setStyle(data.getStyle() | SWT.BOLD);
	Font font = new Font(display, data);
	item.setFont(font);
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	font.dispose();
	display.dispose ();
}
}
Comment 2 Steve Northover CLA 2004-04-22 10:13:51 EDT
This is a bug in Windows that we cannot work around.  The support for fonts in 
table and tree items in Windows simply allows you to draw them.  The stupid %
$^&$^%& control doesn't really know you are using them so it's measurements 
are all wrong.  Thanks Microsoft.

Assigning to VI.  We could consider closing this as WONTFIX or marking it as a 
dup of another "item font is bad on Windows" bug report.
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:07:06 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.