Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT PPC Table Bug
SWT PPC Table Bug [message #438001] Mon, 14 June 2004 16:53 Go to next message
Patrik Mihailescu is currently offline Patrik MihailescuFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

When l add an image to a column that has the style SWT.CHECK set, the
checkbox appearance is distored in that it no longer looks like a check
box, only a single line is visible. I'm using SWT 3.0 RC2, under the J9 VM
for Pocket PC. The following code demonstrates this:

Display display = new Display();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());

Table table = new Table(shell, SWT.BORDER | SWT.CHECK);
table.setHeaderVisible(true);

TableColumn columnOne = new TableColumn(table, SWT.NONE);
columnOne.setText("One");

TableColumn columnTwo = new TableColumn(table, SWT.NONE);
columnTwo.setText("Two");

TableColumn columnThree = new TableColumn(table, SWT.NONE);
columnThree.setText("Three");

TableItem item = new TableItem(table, SWT.NONE);
item.setText(new String[] {"", "a", "3"});
item = new TableItem(table, SWT.NONE);
item.setText(new String[] {"", "b", "2"});
item = new TableItem(table, SWT.NONE);
item.setText(new String[] {"", "c", "1"});

int size = table.getFont().getFontData()[0].getHeight();
int quarter = size/4;
int half = size/2;

Image imageTick = new Image(display, size, size);
GC gc = new GC(imageTick);
gc.setBackground(display.getSystemColor(SWT.COLOR_GRAY));
gc.setForeground(display.getSystemColor (SWT.COLOR_BLACK));
gc.fillRectangle(0, 0, size, size);
gc.drawPolyline(new int[]{1, half, half - 1, size - 2, size - 2, 0});
gc.setForeground(display.getSystemColor(SWT.COLOR_DARK_GRAY) );
gc.drawRectangle(0, 0, size - 1, size - 1);
gc.dispose();

columnTwo.setImage(imageTick);

columnOne.pack();
columnTwo.pack();
columnThree.pack();

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

cheers,

Patrik
Re: SWT PPC Table Bug [message #438023 is a reply to message #438001] Mon, 14 June 2004 20:07 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Enter a bug report. Thanks.

"Patrik Mihailescu" <patrik.2.mihailescu@bt.com> wrote in message
news:cakl5e$o6f$1@eclipse.org...
> Hi,
>
> When l add an image to a column that has the style SWT.CHECK set, the
> checkbox appearance is distored in that it no longer looks like a check
> box, only a single line is visible. I'm using SWT 3.0 RC2, under the J9 VM
> for Pocket PC. The following code demonstrates this:
>
> Display display = new Display();
> Shell shell = new Shell (display);
> shell.setLayout(new FillLayout());
>
> Table table = new Table(shell, SWT.BORDER | SWT.CHECK);
> table.setHeaderVisible(true);
>
> TableColumn columnOne = new TableColumn(table, SWT.NONE);
> columnOne.setText("One");
>
> TableColumn columnTwo = new TableColumn(table, SWT.NONE);
> columnTwo.setText("Two");
>
> TableColumn columnThree = new TableColumn(table, SWT.NONE);
> columnThree.setText("Three");
>
> TableItem item = new TableItem(table, SWT.NONE);
> item.setText(new String[] {"", "a", "3"});
> item = new TableItem(table, SWT.NONE);
> item.setText(new String[] {"", "b", "2"});
> item = new TableItem(table, SWT.NONE);
> item.setText(new String[] {"", "c", "1"});
>
> int size = table.getFont().getFontData()[0].getHeight();
> int quarter = size/4;
> int half = size/2;
>
> Image imageTick = new Image(display, size, size);
> GC gc = new GC(imageTick);
> gc.setBackground(display.getSystemColor(SWT.COLOR_GRAY));
> gc.setForeground(display.getSystemColor (SWT.COLOR_BLACK));
> gc.fillRectangle(0, 0, size, size);
> gc.drawPolyline(new int[]{1, half, half - 1, size - 2, size - 2, 0});
> gc.setForeground(display.getSystemColor(SWT.COLOR_DARK_GRAY) );
> gc.drawRectangle(0, 0, size - 1, size - 1);
> gc.dispose();
>
> columnTwo.setImage(imageTick);
>
> columnOne.pack();
> columnTwo.pack();
> columnThree.pack();
>
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
>
> cheers,
>
> Patrik
>
Previous Topic:Dialog for path (not file)
Next Topic:Plug in toolbar tool tip display confusion
Goto Forum:
  


Current Time: Thu Apr 25 03:33:25 GMT 2024

Powered by FUDForum. Page generated in 0.02573 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top