diff dwt/widgets/Control.d @ 8:a9ab4c738ed8

Fix: instanceof
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:32:39 +0200
parents e831403a80a9
children 5b53d338c709
line wrap: on
line diff
--- a/dwt/widgets/Control.d	Wed Aug 27 14:30:35 2008 +0200
+++ b/dwt/widgets/Control.d	Wed Aug 27 14:32:39 2008 +0200
@@ -655,7 +655,7 @@
 
 Font defaultFont () {
     //TODO - Controls only, does this leak?
-    if (view instanceof NSControl) {
+    if ( null !is cast(NSControl)view ) {
         NSFont nsFont = (cast(NSControl)view).font ();
         if (nsFont !is null) {
             return Font.cocoa_new (display, nsFont);
@@ -806,7 +806,7 @@
 
 void enableWidget (bool enabled) {
     //TODO - other views
-    if (view instanceof NSControl) {
+    if ( null !is cast(NSControl)view ) {
         (cast(NSControl)view).setEnabled(enabled);
     }
 }
@@ -1360,7 +1360,7 @@
 }
 
 bool isFocusAncestor (Control control) {
-    while (control !is null && control !is this && !(control instanceof Shell)) {
+    while (control !is null && control !is this && !( null !is cast(Shell)control )) {
         control = control.parent;
     }
     return control is this;
@@ -2566,7 +2566,7 @@
 
 void setFont (NSFont font) {
     //TODO - bad cast
-    if (view instanceof NSControl) {
+    if ( null !is cast(NSControl)view ) {
         (cast(NSControl)view).setFont(font);
     }
 }