summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2005-07-11 18:43:09 +0000
committerSteve Northover <steve>2005-07-11 18:43:09 +0000
commit9aef482062e98afeee0662d0510a4011d90973c6 (patch)
tree8c0989f19b830f15389f22ded5bb1dc898db0948 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
parente4e4a6c8886b31045cd9a1fde05655074c7a8efa (diff)
downloadeclipse.platform.swt-9aef482062e98afeee0662d0510a4011d90973c6.tar.gz
eclipse.platform.swt-9aef482062e98afeee0662d0510a4011d90973c6.tar.xz
eclipse.platform.swt-9aef482062e98afeee0662d0510a4011d90973c6.zip
103349 - Scale widget switches focus when setting background
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
index 412d6d1bf0..5baca8e244 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Slider.java
@@ -66,6 +66,7 @@ import org.eclipse.swt.events.*;
*/
public class Slider extends Control {
int increment, pageIncrement;
+ boolean ignoreFocus;
static final int ScrollBarProc;
static final TCHAR ScrollBarClass = new TCHAR (0, "SCROLLBAR", true);
static {
@@ -371,11 +372,13 @@ void setBounds (int x, int y, int width, int height, int flags) {
/*
* Bug in Windows. If the scroll bar is resized when it has focus,
* the flashing cursor that is used to show that the scroll bar has
- * focus is not moved. The fix is to post a fake WM_SETFOCUS to
+ * focus is not moved. The fix is to send a fake WM_SETFOCUS to
* get the scroll bar to recompute the size of the flashing cursor.
*/
if (OS.GetFocus () == handle) {
- OS.PostMessage (handle, OS.WM_SETFOCUS, 0, 0);
+ ignoreFocus = true;
+ OS.SendMessage (handle, OS.WM_SETFOCUS, 0, 0);
+ ignoreFocus = false;
}
}
@@ -488,12 +491,14 @@ boolean SetScrollInfo (int hwnd, int flags, SCROLLINFO info, boolean fRedraw) {
/*
* Bug in Windows. If the thumb is resized when it has focus,
* the flashing cursor that is used to show that the scroll bar
- * has focus is not moved. The fix is to post a fake WM_SETFOCUS
+ * has focus is not moved. The fix is to send a fake WM_SETFOCUS
* to get the scroll bar to recompute the size of the flashing
* cursor.
*/
if (OS.GetFocus () == handle) {
- OS.PostMessage (handle, OS.WM_SETFOCUS, 0, 0);
+ ignoreFocus = true;
+ OS.SendMessage (handle, OS.WM_SETFOCUS, 0, 0);
+ ignoreFocus = false;
}
return result;
}
@@ -703,6 +708,11 @@ LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {
return result;
}
+LRESULT WM_SETFOCUS (int wParam, int lParam) {
+ if (ignoreFocus) return null;
+ return super.WM_SETFOCUS (wParam, lParam);
+}
+
LRESULT wmScrollChild (int wParam, int lParam) {
/* Do nothing when scrolling is ending */