diff dwt/widgets/Button.d @ 108:6f75fdfa1bcd

Change LRESULT to class, like done in the old DWT.
author Frank Benoit <benoit@tionex.de>
date Mon, 11 Feb 2008 02:44:32 +0100
parents aee1890f38c3
children ab60f3309436
line wrap: on
line diff
--- a/dwt/widgets/Button.d	Mon Feb 11 00:56:33 2008 +0100
+++ b/dwt/widgets/Button.d	Mon Feb 11 02:44:32 2008 +0100
@@ -358,9 +358,9 @@
     addListener (DWT.DefaultSelection,typedListener);
 }
 
-override LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam) {
-    if (handle is null) return LRESULT.ZERO;
-    return cast(LRESULT) OS.CallWindowProc ( ButtonProc, hwnd, msg, wParam, lParam);
+override int callWindowProc (HWND hwnd, int msg, int wParam, int lParam) {
+    if (handle is null) return 0;
+    return OS.CallWindowProc ( ButtonProc, hwnd, msg, wParam, lParam);
 }
 
 static int checkStyle (int style) {
@@ -1064,7 +1064,7 @@
 
 override LRESULT WM_ERASEBKGND (int wParam, int lParam) {
     LRESULT result = super.WM_ERASEBKGND (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     /*
     * Bug in Windows.  For some reason, the HBRUSH that
     * is returned from WM_CTRLCOLOR is misaligned when
@@ -1086,9 +1086,9 @@
 
 override LRESULT WM_GETDLGCODE (int wParam, int lParam) {
     LRESULT result = super.WM_GETDLGCODE (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     if ((style & DWT.ARROW) !is 0) {
-        return cast( LRESULT )(OS.DLGC_STATIC);
+        return new LRESULT (OS.DLGC_STATIC);
     }
     return result;
 }
@@ -1102,12 +1102,12 @@
 }
 
 override LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {
-    if (ignoreMouse) return LRESULT.NULL;
+    if (ignoreMouse) return null;
     return super.WM_LBUTTONDOWN (wParam, lParam);
 }
 
 override LRESULT WM_LBUTTONUP (int wParam, int lParam) {
-    if (ignoreMouse) return LRESULT.NULL;
+    if (ignoreMouse) return null;
     return super.WM_LBUTTONUP (wParam, lParam);
 }
 
@@ -1134,7 +1134,7 @@
 
 override LRESULT WM_SIZE (int wParam, int lParam) {
     LRESULT result = super.WM_SIZE (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     if (OS.COMCTL32_MAJOR >= 6) {
         if ((style & (DWT.PUSH | DWT.TOGGLE)) !is 0) {
             if (imageList !is null && text.length !is 0) {
@@ -1152,14 +1152,14 @@
 
 override LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) {
     LRESULT result = super.WM_SYSCOLORCHANGE (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     if (image2 !is null) _setImage (image);
     return result;
 }
 
 override LRESULT WM_UPDATEUISTATE (int wParam, int lParam) {
     LRESULT result = super.WM_UPDATEUISTATE (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     /*
     * Feature in Windows.  When WM_UPDATEUISTATE is sent to
     * a button, it sends WM_CTLCOLORBTN to get the foreground
@@ -1185,7 +1185,7 @@
             if (redraw) {
                 OS.InvalidateRect (handle, null, false);
                 int code = OS.DefWindowProc (handle, OS.WM_UPDATEUISTATE, wParam, lParam);
-                return cast( LRESULT )(code);
+                return new LRESULT (code);
             }
         }
     }
@@ -1228,7 +1228,7 @@
         if ((style & (DWT.RADIO | DWT.CHECK)) !is 0) {
             if (findImageControl () !is null) {
                 OS.SetBkMode (cast(HANDLE)wParam, OS.TRANSPARENT);
-                return cast( LRESULT )(OS.GetStockObject (OS.NULL_BRUSH));
+                return new LRESULT ( cast(int) OS.GetStockObject (OS.NULL_BRUSH));
             }
         }
     }
@@ -1272,7 +1272,7 @@
         if ((struct_.itemState & OS.ODS_SELECTED) !is 0) uState |= OS.DFCS_PUSHED;
         OS.DrawFrameControl (struct_.hDC, &rect, OS.DFC_SCROLL, uState);
     }
-    return LRESULT.NULL;
+    return null;
 }
 
 }