diff dwt/widgets/Menu.d @ 7:e831403a80a9

Add 'cast' to casts
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:30:35 +0200
parents 1a8b3cb347e0
children a9ab4c738ed8
line wrap: on
line diff
--- a/dwt/widgets/Menu.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/Menu.d	Wed Aug 27 14:30:35 2008 +0200
@@ -208,7 +208,7 @@
         } else {
             location = window.mouseLocationOutsideOfEventStream();
         }
-        NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), (short)0, 0, 0);
+        NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), cast(short)0, 0, 0);
         NSMenu.static_popUpContextMenu_withEvent_forView_ (nsMenu, nsEvent, shell.view);
     } else {
         nsMenu.cancelTracking ();
@@ -270,7 +270,7 @@
 
 void createHandle () {
 //  display.addMenu (this);
-    SWTMenu widget = (SWTMenu)new SWTMenu().alloc();
+    SWTMenu widget = cast(SWTMenu)new SWTMenu().alloc();
     widget.initWithTitle(NSString.stringWith(""));
     widget.setAutoenablesItems(false);
     widget.setTag(jniRef);
@@ -286,7 +286,7 @@
         nsItem = NSMenuItem.separatorItem();
         nsItem.retain();
     } else {
-        nsItem = (NSMenuItem)new SWTMenuItem().alloc();
+        nsItem = cast(NSMenuItem)new SWTMenuItem().alloc();
         nsItem.initWithTitle(NSString.stringWith(""), 0, NSString.stringWith(""));
         nsItem.setTarget(nsItem);
         nsItem.setAction(OS.sel_sendSelection);
@@ -641,7 +641,7 @@
     if (jniRef !is -1 && jniRef !is 0) {
         Object object = OS.JNIGetObject(jniRef);
         if (object instanceof MenuItem) {
-            MenuItem item = (MenuItem)object;
+            MenuItem item = cast(MenuItem)object;
             item.sendEvent (DWT.Arm);
         }
     }
@@ -802,10 +802,10 @@
     checkWidget();
     if (enabled) {
         state &= ~DISABLED;
-        //OS.EnableMenuItem (handle, (short)0);
+        //OS.EnableMenuItem (handle, cast(short)0);
     } else {
         state |= DISABLED;
-        //OS.DisableMenuItem (handle, (short)0);
+        //OS.DisableMenuItem (handle, cast(short)0);
     }
 }