Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 72293 - Very wide Tables
Summary: Very wide Tables
Status: RESOLVED WONTFIX
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:
: 302248 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-19 12:41 EDT by Matt Casters CLA
Modified: 2012-02-13 17:23 EST (History)
1 user (show)

See Also:


Attachments
Simple C app (3.00 KB, text/plain)
2012-02-13 17:23 EST, Silenio Quarti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Casters CLA 2004-08-19 12:41:19 EDT
Displaying data from a database table containing a large number of fields, I 
came across a strange bug in the Table widget. After a few thousand pixels 
width, the header of the table is no longer drawn.  The Table content itself 
*is* drawn like it should.
It doesn't seem to be the number of columns displayed that's causing the 
problem, but rather the width.
Comment 1 Grant Gayed CLA 2004-08-24 09:08:03 EDT
I cannot reproduce this (on win2000) with the following snippet; can you 
provide a snippet, or modify the one below, to show the problem happening?

SN does this sound like a windows bug?

public static void main(String[] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setBounds(10,10,200,200);
	Table table = new Table (shell, SWT.VIRTUAL | SWT.H_SCROLL | 
SWT.V_SCROLL);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	table.setBounds(10,10,150,150);
	String[] contents = new String[100];
	for (int i = 0; i < 100; i++) {
		TableColumn column = new TableColumn(table, SWT.NONE);
		column.setText("col " + i);
		column.setWidth(200);
		contents [i] = "abcdefghijklmnopqrstuvwxyz";
	}
	new TableItem(table, SWT.NONE).setText(contents);
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) display.sleep();
	}
	display.dispose();
}
Comment 2 Matt Casters CLA 2004-08-24 13:14:05 EDT
Here is the code, the bugs shows around column 163:

-------------
public class TableTest {

	public static void main(String[] args) 
	{
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setBounds(10,10,200,200);

		FormLayout formLayout = new FormLayout ();
		formLayout.marginWidth  = 10;
		formLayout.marginHeight = 10;
		
		shell.setLayout(formLayout);
		shell.setText("Table Test");
		
		Table table = new Table (shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		table.setBounds(10,10,150,150);
		
		int size = 200;
		
		String[] contents = new String[size];
		for (int i = 0; i < size; i++) 
		{
			TableColumn column = new TableColumn(table, SWT.RIGHT);
			column.setText("col " + i);
			column.setWidth(200);
			contents [i] = "abcdefghijklmnopqrstuvwxyz";
			column.setResizable(true);
			column.setAlignment(SWT.RIGHT);
		}
		for (int i=0;i<50;i++)
		{
			new TableItem(table, SWT.NONE).setText(contents);
		}

		FormData fdTable=new FormData();
		fdTable.left   = new FormAttachment(0, 0);
		fdTable.right  = new FormAttachment(100, 0);
		fdTable.top    = new FormAttachment(0, 0);
		fdTable.bottom = new FormAttachment(100, 0);
		table.setLayoutData(fdTable);

		
		shell.open();
		
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
		display.dispose();
	}
}

------

Cheers, 

Matt

Comment 3 Steve Northover CLA 2004-09-13 19:34:30 EDT
Wow.  Looks like a bug in Windows.

Since we don't draw the column headers or the contents of the table, there's 
not much we can do about it.  Sorry CANTFIX.
Comment 4 Silenio Quarti CLA 2012-02-13 17:22:11 EST
*** Bug 302248 has been marked as a duplicate of this bug. ***
Comment 5 Silenio Quarti CLA 2012-02-13 17:23:12 EST
Created attachment 210948 [details]
Simple C app

Here is a simple C application that reproduces the problem.