diff dwt/widgets/Tracker.d @ 213:36f5cb12e1a2

Update to SWT 3.4M7
author Frank Benoit <benoit@tionex.de>
date Sat, 17 May 2008 17:34:28 +0200
parents 6f75fdfa1bcd
children 8efa9bb96c53
line wrap: on
line diff
--- a/dwt/widgets/Tracker.d	Mon May 05 00:12:38 2008 +0200
+++ b/dwt/widgets/Tracker.d	Sat May 17 17:34:28 2008 +0200
@@ -55,7 +55,8 @@
     bool tracking, cancelled, stippled;
     Rectangle [] rectangles, proportions;
     Rectangle bounds;
-    HCURSOR resizeCursor, clientCursor;
+    HCURSOR resizeCursor;
+    Cursor clientCursor;
     int cursorOrientation = DWT.NONE;
     bool inEvent = false;
     HWND hwndTransparent;
@@ -507,11 +508,11 @@
             null,
             OS.GetModuleHandle (null),
             null);
-        oldProc = cast(WNDPROC) OS.GetWindowLong (hwndTransparent, OS.GWL_WNDPROC);
+        oldProc = cast(WNDPROC) OS.GetWindowLongPtr (hwndTransparent, OS.GWLP_WNDPROC);
         //newProc = new Callback (this, "transparentProc", 4); //$NON-NLS-1$
         //int newProcAddress = newProc.getAddress ();
         //if (newProcAddress is 0) DWT.error (DWT.ERROR_NO_MORE_CALLBACKS);
-        OS.SetWindowLong (hwndTransparent, OS.GWL_WNDPROC, cast(int) &transparentFunc );
+        OS.SetWindowLongPtr (hwndTransparent, OS.GWLP_WNDPROC, cast(LONG_PTR) &transparentFunc );
 
         //PORTING_FIXME: Vista version
         version( VISTA ) if (isVista) {
@@ -788,10 +789,9 @@
  */
 public void setCursor(Cursor newCursor) {
     checkWidget();
-    clientCursor = null;
+    clientCursor = newCursor;
     if (newCursor !is null) {
-        clientCursor = newCursor.handle;
-        if (inEvent) OS.SetCursor (clientCursor);
+        if (inEvent) OS.SetCursor (clientCursor.handle);
     }
 }
 
@@ -858,7 +858,7 @@
             break;
         case OS.WM_SETCURSOR:
             if (clientCursor !is null) {
-                OS.SetCursor (clientCursor);
+                OS.SetCursor (clientCursor.handle);
                 return 1;
             }
             if (resizeCursor !is null) {
@@ -906,7 +906,7 @@
             }
         default:
     }
-    return OS.CallWindowProc (oldProc, hwnd, msg, wParam, lParam);
+    return oldProc( hwnd, msg, wParam, lParam);
 }
 
 void update () {
@@ -1063,11 +1063,11 @@
     return result;
 }
 
-LRESULT wmMouse (int message, int wParam, int lParam) {
+LRESULT wmMouse (int message, int /*long*/ wParam, int /*long*/ lParam) {
     bool isMirrored = parent !is null && (parent.style & DWT.MIRRORED) !is 0;
     int newPos = OS.GetMessagePos ();
-    int newX = cast(short) (newPos & 0xFFFF);
-    int newY = cast(short) (newPos >> 16);
+    int newX = OS.GET_X_LPARAM (newPos);
+    int newY = OS.GET_Y_LPARAM (newPos);
     if (newX !is oldX || newY !is oldY) {
         Rectangle [] oldRectangles = rectangles;
         bool oldStippled = stippled;