diff options
author | Steve Northover <steve> | 2008-08-25 19:47:05 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2008-08-25 19:47:05 +0000 |
commit | 6940f18b48d4360234489967f75e7e89afce228a (patch) | |
tree | 69a3b80887164c562d08bb8d96cf1320fcc62c12 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java | |
parent | 9d80fa41aebed8140fd6eb7eab6449cb2fe17efe (diff) | |
download | eclipse.platform.swt-6940f18b48d4360234489967f75e7e89afce228a.tar.gz eclipse.platform.swt-6940f18b48d4360234489967f75e7e89afce228a.tar.xz eclipse.platform.swt-6940f18b48d4360234489967f75e7e89afce228a.zip |
244574 - ProgressBar state can be visually lost by updating selection
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java index f9774ffc54..c7ec93a8df 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java @@ -315,19 +315,26 @@ public void setSelection (int value) { checkWidget (); /* * Feature in Vista. When the progress bar is not in - * a normal state, PBM_SETPOS does not set the position. + * a normal state, PBM_SETPOS does not set the position + * of the bar when the selection is equal to the minimum. * This is undocumented. The fix is to temporarily * set the state to PBST_NORMAL, set the position, then * reset the state. */ int /*long*/ state = 0; + boolean fixSelection = false; if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { - state = OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0); - OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_NORMAL, 0); + int minumum = /*64*/OS.SendMessage (handle, OS.PBM_GETRANGE, 1, 0); + int selection = (int)/*64*/OS.SendMessage (handle, OS.PBM_GETPOS, 0, 0); + if (selection == minumum) { + fixSelection = true; + state = OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0); + OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_NORMAL, 0); + } } OS.SendMessage (handle, OS.PBM_SETPOS, value, 0); if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { - OS.SendMessage (handle, OS.PBM_SETSTATE, state, 0); + if (fixSelection) OS.SendMessage (handle, OS.PBM_SETSTATE, state, 0); } } |