diff dwt/widgets/TableItem.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 d8635bb48c7c
line wrap: on
line diff
--- a/dwt/widgets/TableItem.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/widgets/TableItem.d	Wed Aug 27 14:30:35 2008 +0200
@@ -153,7 +153,7 @@
 //      parent.sendEvent (DWT.MeasureItem, event);
 //      if (parent.itemHeight < event.height) {
 //          parent.itemHeight = event.height;
-//          OS.SetDataBrowserTableViewRowHeight (parent.handle, (short) event.height);
+//          OS.SetDataBrowserTableViewRowHeight (parent.handle, cast(short) event.height);
 //      }
 //      width = event.width;
 //  }
@@ -204,7 +204,7 @@
     char[] chars = new char[length];
     text.getChars(0, length, chars, 0);
     NSString str = NSString.stringWithCharacters(chars, length);
-    NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+    NSAttributedString attribStr = (cast(NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
     attribStr.autorelease();
     return attribStr;
 }
@@ -270,10 +270,10 @@
 public Rectangle getBounds () {
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
-    NSTableView tableView = (NSTableView) parent.view;
+    NSTableView tableView = cast(NSTableView) parent.view;
     NSRect rect = tableView.rectOfRow (parent.indexOf (this));
     rect = tableView.convertRect_toView_ (rect, parent.scrollView);
-    Rectangle result = new Rectangle((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
+    Rectangle result = new Rectangle(cast(int) rect.x, cast(int) rect.y, cast(int) rect.width, cast(int) rect.height);
     return result;
 }
 
@@ -292,11 +292,11 @@
 public Rectangle getBounds (int index) {
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
-    NSTableView tableView = (NSTableView) parent.view;
+    NSTableView tableView = cast(NSTableView) parent.view;
     if ((parent.style & DWT.CHECK) !is 0) index ++;
     NSRect rect = tableView.frameOfCellAtColumn (index, parent.indexOf (this));
     rect = tableView.convertRect_toView_ (rect, parent.scrollView);
-    Rectangle result = new Rectangle((int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
+    Rectangle result = new Rectangle(cast(int) rect.x, cast(int) rect.y, cast(int) rect.width, cast(int) rect.height);
     return result;
 }
 
@@ -619,8 +619,8 @@
 
 void redraw () {
 //  0[aTableView setNeedsDisplayInRect:[aTableView rectOfRow:row]];
-    ((NSTableView)parent.view).reloadData();
-    ((NSTableView)parent.view).tile();
+    (cast(NSTableView)parent.view).reloadData();
+    (cast(NSTableView)parent.view).tile();
 }
 
 void releaseHandle () {
@@ -670,7 +670,7 @@
     background = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -709,7 +709,7 @@
     cellBackground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -731,7 +731,7 @@
     if (this.checked is checked) return;
     this.checked = checked;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -763,7 +763,7 @@
     this.font = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -803,7 +803,7 @@
     cellFont [index] = font;
     if (oldFont !is null && oldFont.equals (font)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -835,7 +835,7 @@
     foreground = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -874,7 +874,7 @@
     cellForeground [index] = color;
     if (oldColor !is null && oldColor.equals (color)) return;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -896,7 +896,7 @@
     if (this.grayed is grayed) return;
     this.grayed = grayed;
     cached = true;
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.rectOfRow(parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -964,7 +964,7 @@
     }
 //  cached = true;
 //  if (index is 0) parent.setScrollWidth (this);
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }
@@ -1046,7 +1046,7 @@
     }
     cached = true;
     if (index is 0) parent.setScrollWidth (this);
-    NSTableView view = (NSTableView)parent.view;
+    NSTableView view = cast(NSTableView)parent.view;
     NSRect rect = view.frameOfCellAtColumn(index + ((parent.style & DWT.CHECK) !is 0 ? 1 : 0), parent.indexOf(this));
     view.setNeedsDisplayInRect(rect);
 }