diff dwt/widgets/Composite.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 43c42c637c9c
children f353be82b6be
line wrap: on
line diff
--- a/dwt/widgets/Composite.d	Mon Feb 11 00:56:33 2008 +0100
+++ b/dwt/widgets/Composite.d	Mon Feb 11 02:44:32 2008 +0100
@@ -1065,7 +1065,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;
     if ((state & CANVAS) !is 0) {
         /* Return zero to indicate that the background was not erased */
         if ((style & DWT.NO_BACKGROUND) !is 0) return LRESULT.ZERO;
@@ -1075,7 +1075,7 @@
 
 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 ((state & CANVAS) !is 0) {
         int flags = 0;
         if (hooksKeys ()) {
@@ -1083,18 +1083,18 @@
         }
         if ((style & DWT.NO_FOCUS) !is 0) flags |= OS.DLGC_STATIC;
         if (OS.GetWindow (handle, OS.GW_CHILD) !is null) flags |= OS.DLGC_STATIC;
-        if (flags !is 0) return cast(LRESULT)flags;
+        if (flags !is 0) return new LRESULT (flags);
     }
     return result;
 }
 
 override LRESULT WM_GETFONT (int wParam, int lParam) {
     LRESULT result = super.WM_GETFONT (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     int code = callWindowProc (handle, OS.WM_GETFONT, wParam, lParam);
-    if (code !is 0) return cast( LRESULT )(code);
+    if (code !is 0) return new LRESULT (code);
     if (font is null) font = defaultFont ();
-    return cast( LRESULT )(font);
+    return new LRESULT (cast(int) font);
 }
 
 override LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {
@@ -1112,7 +1112,7 @@
 
 override LRESULT WM_NCPAINT (int wParam, int lParam) {
     LRESULT result = super.WM_NCPAINT (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     if ((state & CANVAS) !is 0) {
         result = wmNCPaint (handle, wParam, lParam);
     }
@@ -1335,7 +1335,7 @@
 
 override LRESULT WM_PRINTCLIENT (int wParam, int lParam) {
     LRESULT result = super.WM_PRINTCLIENT (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
     if ((state & CANVAS) !is 0) {
         forceResize ();
         auto nSavedDC = OS.SaveDC (cast(HDC)wParam);
@@ -1421,7 +1421,7 @@
 
 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;
     auto hwndChild = OS.GetWindow (handle, OS.GW_CHILD);
     while (hwndChild !is null) {
         OS.SendMessage (hwndChild, OS.WM_SYSCOLORCHANGE, 0, 0);
@@ -1432,7 +1432,7 @@
 
 override LRESULT WM_SYSCOMMAND (int wParam, int lParam) {
     LRESULT result = super.WM_SYSCOMMAND (wParam, lParam);
-    if (result !is LRESULT.NULL) return result;
+    if (result !is null) return result;
 
     /*
     * Check to see if the command is a system command or
@@ -1461,7 +1461,7 @@
                         OS.RedrawWindow (handle, null, null, flags);
                     }
                 if (code is 0) return LRESULT.ZERO;
-                return cast( LRESULT )(code);
+                return new LRESULT (code);
             default:
         }
     }
@@ -1471,7 +1471,7 @@
 
 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;
     if ((state & CANVAS) !is 0) OS.InvalidateRect (handle, null, false);
     return result;
 }
@@ -1495,10 +1495,10 @@
             OS.ExcludeClipRect (hDC, border, border, rect.right - border, rect.bottom - border);
             OS.DrawThemeBackground (display.hEditTheme (), hDC, OS.EP_EDITTEXT, OS.ETS_NORMAL, &rect, null);
             OS.ReleaseDC (hwnd, hDC);
-            return cast(LRESULT )(code);
+            return new LRESULT (code);
         }
     }
-    return LRESULT.NULL;
+    return null;
 }
 
 override LRESULT wmNotify (NMHDR* hdr, int wParam, int lParam) {