Project: SWT
Bug 295856 ProgressBar selection and state are not shown correctly
Reported: 2009-11-23 08:02:59 | Status: resolved fixed

User-Agent: Opera/9.80 (Windows NT 6.1; U; de) Presto/2.2.15 Version/10.01 Build Identifier: I20090611-1540 The update of the ProgressBar (including state and selection) is not working properly. If you set the state of the ProgressBar to SWT.ERROR, the selection is not displayed correctly. If the state is SWT.NORMAL, everthing seems to work fine. Reproducible: Always Steps to Reproduce: 1. Run the attached snippet, everthing should work fine 2. Replace the initial state SWT.NORMAL by SWT.ERROR and run the snippet again => The error state is sometimes not displayed immediately and finally the selection is not shown corretly, the last segment is still not shown as selected. public class TestClass { public static void main(String[] args) throws Exception { final int MAX = 10; final Display display = new Display(); Shell shell = new Shell(display); shell.setBounds(10, 10, 500, 200); shell.setLayout(new GridLayout()); final ProgressBar bar = new ProgressBar(shell, SWT.NONE); bar.setMaximum(MAX); bar.setState(SWT.NORMAL); shell.open(); for (int i=1; i<=MAX; i++) { bar.setSelection(i); Thread.sleep(500); } while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java