TreeEditor: ProgressBar does not fill cell correctly [message #466853] |
Wed, 18 January 2006 11:17 |
Salvatore Culcasi Messages: 6 Registered: July 2009 |
Junior Member |
|
|
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();
}
}
|
|
|
Re: TreeEditor: ProgressBar does not fill cell correctly [message #466881 is a reply to message #466853] |
Wed, 18 January 2006 21:13 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
Please enter a bug report with the steps and a screen shot of the partially
visible scroll bars. I'm running the code and following the steps but I
don't see the problem. Thanks!
"Salvatore" <salvatore.culcasi@st.com> wrote in message
news:988f842461bf21227118a9c6fe4c38d5$1@www.eclipse.org...
> 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();
> }
> }
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03968 seconds