Bug 42416 - [consistency] GC(Table) has wrong origin
Summary: [consistency] GC(Table) has wrong origin
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords: consistency
: 42431 57377 75284 81102 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-02 16:34 EDT by Veronika Irvine CLA
Modified: 2016-08-28 05:18 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veronika Irvine CLA 2003-09-02 16:34:15 EDT
Eclipse 3.0 M3
In the Paint event or in a GC you created on a table with headers, (0, 0) is 
not at the top left but is under the headers.  This is not consistant with 
other platforms.

Run the following example and note that the red square is not drawn under the 
cursor:

public static void main(String[] args) {
	Display display = new Display();
	final Color red = display.getSystemColor(SWT.COLOR_RED);
	Shell shell = new Shell(display);
	shell.setLayout(new GridLayout());
	final Table table = new Table(shell, SWT.BORDER);
	table.setLayoutData(new GridData(GridData.FILL_BOTH));
	TableColumn column1 = new TableColumn(table, SWT.NONE);
	TableColumn column2 = new TableColumn(table, SWT.NONE);
	TableColumn column3 = new TableColumn(table, SWT.NONE);
	for (int i = 0; i < 10; i++) {
		TableItem item = new TableItem(table, SWT.NONE);
		item.setText(new String[] {"asdadas", "asdadasd", "rrwrwrw"});
	}
	column1.pack();
	column2.pack();
	column3.pack();
	table.addMouseListener(new MouseAdapter() {
		public void mouseDown(MouseEvent e) {
			System.out.println("mouse down at "+e.x+" "+e.y);
			GC gc = new GC(table);
			gc.setForeground(red);
			gc.drawRectangle(e.x, e.y, 2, 2);
			gc.dispose();
		}
	});

	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
Comment 1 Grant Gayed CLA 2003-09-04 14:07:12 EDT
*** Bug 42431 has been marked as a duplicate of this bug. ***
Comment 2 Grant Gayed CLA 2004-09-30 13:05:04 EDT
*** Bug 75284 has been marked as a duplicate of this bug. ***
Comment 3 Felipe Heidrich CLA 2004-11-24 17:28:23 EST
*** Bug 57377 has been marked as a duplicate of this bug. ***
Comment 4 Veronika Irvine CLA 2005-03-15 13:23:06 EST
*** Bug 81102 has been marked as a duplicate of this bug. ***
Comment 5 Iain MacDonnell CLA 2005-12-20 19:48:23 EST
Also affects Solaris-GTK
Comment 6 ArronM CLA 2006-04-05 03:27:04 EDT
This appears to be fixed > 3224 && <= 3226.

I'll leave it open since I'm not a dev and you may want to find out who fixed it (or at least confirm)
Comment 7 Eric Williams CLA 2016-08-05 09:50:20 EDT
No reply in several years, comment 6 indicates the issue has been fixed.