Community
Participate
Working Groups
Hi all I am experiencing a (minor) refresh problem under WinXP SP1 when I use a ProgressBar associated to a TreeEditor. Here they are the steps to reproduce the problem 1) Run the SWT example (source code underneath) 2) Expand the tree 3) Enlarge the before last column leaving the progress bars partially visible 4) Use the scrollbar (scroll right) 5) All the progress bars are partially visible The problems disappears if I force a refresh, for example resizing the window manually I tried under Linux-gtk, but there it works fine. Please, could someone help me? Am I doing something wrong? Could it be related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=95563? Thanks Salvatore import org.eclipse.swt.SWT; import org.eclipse.swt.custom.TableEditor; import org.eclipse.swt.custom.TreeEditor; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; import org.eclipse.swt.widgets.TreeItem; public class TreeTableTest { public static void main(String[] args) { new TreeTableTest().run(); } private void run() { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); Tree tree = new Tree(shell, SWT.MULTI | SWT.FULL_SELECTION); tree.setHeaderVisible(true); tree.setLinesVisible(true); for (int i = 0; i < 6; i++) { TreeColumn column = new TreeColumn(tree, SWT.NONE); column.setResizable(true); column.setWidth(100); } TreeItem root = new TreeItem(tree,SWT.NONE); for (int j = 0; j < 5; j++) { root.setText(j, "Row " + 0 + ", Column " + j); } ProgressBar pbar = new ProgressBar(tree, SWT.SMOOTH|SWT.RESIZE); pbar.setMinimum(0); pbar.setSelection(60); TreeEditor editor = new TreeEditor(tree); editor.grabHorizontal = editor.grabVertical = true; editor.setEditor(pbar,root,5); for (int i = 1; i <= 10; i++) { TreeItem item = new TreeItem(root, SWT.NONE); for (int j = 0; j < 5; j++) { item.setText(j, "Row " + i + ", Column " + j); } pbar = new ProgressBar(tree, SWT.SMOOTH|SWT.RESIZE); pbar.setMinimum(0); pbar.setSelection(60); editor = new TreeEditor(tree); editor.grabHorizontal = editor.grabVertical = true; editor.setEditor(pbar,item,5); } shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }
Created attachment 33267 [details] Snapshot of the tree
Fixed > 20060201.