summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2008-02-21 23:32:33 +0000
committerSteve Northover <steve>2008-02-21 23:32:33 +0000
commit257956b6dd31f969247b68558fac32348be012a7 (patch)
tree1cd06a16bd118c0874aa34ef62cd3630d4a13c60
parentb5b144c870a845c6b674bd3aa5351bdf169ec16c (diff)
downloadeclipse.platform.swt-257956b6dd31f969247b68558fac32348be012a7.tar.gz
eclipse.platform.swt-257956b6dd31f969247b68558fac32348be012a7.tar.xz
eclipse.platform.swt-257956b6dd31f969247b68558fac32348be012a7.zip
219874 - Exploit Vista progress bars [/*public*/]
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ProgressBar.java39
1 files changed, 31 insertions, 8 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 8805e3f53e..8d890d5cde 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
@@ -199,9 +199,17 @@ public int getSelection () {
*
* @since 3.4
*/
-public int getState () {
+/*public*/ int getState () {
checkWidget ();
- return (int)/*64*/OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0);
+ if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
+ int state = (int)/*64*/OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0);
+ switch (state) {
+ case OS.PBST_NORMAL: return SWT.NORMAL;
+ case OS.PBST_ERROR: return SWT.ERROR;
+ case OS.PBST_PAUSED: return SWT.PAUSED;
+ }
+ }
+ return SWT.NORMAL;
}
void releaseWidget () {
@@ -297,7 +305,15 @@ public void setMinimum (int value) {
*/
public void setSelection (int value) {
checkWidget ();
+ int state = 0;
+ 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);
+ }
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);
+ }
}
/**
@@ -313,13 +329,20 @@ public void setSelection (int value) {
*
* @since 3.4
*/
-public void setState (int state) {
+/*public*/ void setState (int state) {
checkWidget ();
- switch (state) {
- case SWT.NORMAL:
- case SWT.ERROR:
- case SWT.PAUSED:
- OS.SendMessage (handle, OS.PBM_SETSTATE, state, 0);
+ if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
+ switch (state) {
+ case SWT.NORMAL:
+ OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_NORMAL, 0);
+ break;
+ case SWT.ERROR:
+ OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_ERROR, 0);
+ break;
+ case SWT.PAUSED:
+ OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_PAUSED, 0);
+ break;
+ }
}
}