summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2008-08-25 19:56:19 +0000
committerSteve Northover <steve>2008-08-25 19:56:19 +0000
commita8303725e04b6933109cfd0077f864908933d0cd (patch)
tree98ed3b478808484520d5ad6c3c45e7c6ec11da52
parent941c0732929e0d836913a4e182f1a7bb90c7e46f (diff)
downloadeclipse.platform.swt-a8303725e04b6933109cfd0077f864908933d0cd.tar.gz
eclipse.platform.swt-a8303725e04b6933109cfd0077f864908933d0cd.tar.xz
eclipse.platform.swt-a8303725e04b6933109cfd0077f864908933d0cd.zip
244574 - ProgressBar state can be visually lost by updating selection
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java15
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);
}
}