Bug 124481 - TreeEditor: ProgressBar does not fill cell correctly
Summary: TreeEditor: ProgressBar does not fill cell correctly
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-19 08:50 EST by Salvatore Culcasi CLA
Modified: 2006-02-07 07:04 EST (History)
0 users

See Also:


Attachments
Snapshot of the tree (50.39 KB, image/jpeg)
2006-01-19 08:55 EST, Salvatore Culcasi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore Culcasi CLA 2006-01-19 08:50:55 EST
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();
    }
    }
Comment 1 Salvatore Culcasi CLA 2006-01-19 08:55:59 EST
Created attachment 33267 [details]
Snapshot of the tree
Comment 2 Silenio Quarti CLA 2006-02-01 12:44:27 EST
Fixed > 20060201.