summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2008-03-28 16:43:53 +0000
committerSteve Northover <steve>2008-03-28 16:43:53 +0000
commit17ee310c8a6cf19b889e32ff7bcbe8b32154f6e5 (patch)
treefbdeaf795e119eaffb51afb9db7a0c24579336ea /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
parentbd84842070ddbb1c7d4c356159fbb84d263877b7 (diff)
downloadeclipse.platform.swt-17ee310c8a6cf19b889e32ff7bcbe8b32154f6e5.tar.gz
eclipse.platform.swt-17ee310c8a6cf19b889e32ff7bcbe8b32154f6e5.tar.xz
eclipse.platform.swt-17ee310c8a6cf19b889e32ff7bcbe8b32154f6e5.zip
support WM_PAINT with wParam as an HDC
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
index 54d6f1300c..a1e6248a39 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
@@ -121,7 +121,23 @@ public void addSelectionListener (SelectionListener listener) {
int /*long*/ callWindowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, int /*long*/ lParam) {
if (handle == 0) return 0;
- if (LinkProc != 0) return OS.CallWindowProc (LinkProc, hwnd, msg, wParam, lParam);
+ if (LinkProc != 0) {
+ /*
+ * Feature in Windows. By convention, native Windows controls
+ * check for a non-NULL wParam, assume that it is an HDC and
+ * paint using that device. The SysLink control does not.
+ * The fix is to check for an HDC and use WM_PRINTCLIENT.
+ */
+ switch (msg) {
+ case OS.WM_PAINT:
+ if (wParam != 0) {
+ OS.SendMessage (hwnd, OS.WM_PRINTCLIENT, wParam, 0);
+ return 0;
+ }
+ break;
+ }
+ return OS.CallWindowProc (LinkProc, hwnd, msg, wParam, lParam);
+ }
return OS.DefWindowProc (hwnd, msg, wParam, lParam);
}