Mercurial > projects > dwt-mac
diff dwt/widgets/TreeItem.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/TreeItem.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/widgets/TreeItem.d Wed Aug 27 14:30:35 2008 +0200 @@ -241,7 +241,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; // } @@ -347,7 +347,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; } @@ -412,11 +412,11 @@ public Rectangle getBounds () { checkWidget (); if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED); - NSOutlineView outlineView = (NSOutlineView) parent.view; + NSOutlineView outlineView = cast(NSOutlineView) parent.view; int row = outlineView.rowForItem(handle); NSRect rect = outlineView.rectOfRow (row); rect = outlineView.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; } @@ -438,12 +438,12 @@ checkWidget (); if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED); if (index !is 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0); - NSOutlineView outlineView = (NSOutlineView) parent.view; + NSOutlineView outlineView = cast(NSOutlineView) parent.view; int row = outlineView.rowForItem(handle); if ((parent.style & DWT.CHECK) !is 0) index ++; NSRect rect = outlineView.frameOfCellAtColumn(index, row); rect = outlineView.convertRect_toView_ (rect, parent.scrollView); - return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); + return new Rectangle(cast(int)rect.x, cast(int)rect.y, cast(int)rect.width, cast(int)rect.height); } /** @@ -961,7 +961,7 @@ background = color; if (oldColor !is null && oldColor.equals (color)) return; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -999,7 +999,7 @@ cellBackground [index] = color; if (oldColor !is null && oldColor.equals (color)) return; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1019,7 +1019,7 @@ if (this.checked is checked) return; this.checked = checked; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1038,9 +1038,9 @@ if (expanded is getExpanded ()) return; parent.ignoreExpand = true; if (expanded) { - ((NSOutlineView)parent.view).expandItem_(handle); + (cast(NSOutlineView)parent.view).expandItem_(handle); } else { - ((NSOutlineView)parent.view).collapseItem_(handle); + (cast(NSOutlineView)parent.view).collapseItem_(handle); } parent.ignoreExpand = false; cached = true; @@ -1079,7 +1079,7 @@ this.font = font; if (oldFont !is null && oldFont.equals (font)) return; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1117,7 +1117,7 @@ cellFont [index] = font; if (oldFont !is null && oldFont.equals (font)) return; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1150,7 +1150,7 @@ foreground = color; if (oldColor !is null && oldColor.equals (color)) return; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1188,7 +1188,7 @@ cellForeground [index] = color; if (oldColor !is null && oldColor.equals (color)) return; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1208,7 +1208,7 @@ if (this.grayed is grayed) return; this.grayed = grayed; cached = true; - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } /** @@ -1276,7 +1276,7 @@ } // cached = true; // if (index is 0) parent.setScrollWidth (this); - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } public void setImage (Image image) { @@ -1358,7 +1358,7 @@ } cached = true; if (index is 0) parent.setScrollWidth (this); - ((NSOutlineView)parent.view).reloadItem_(handle); + (cast(NSOutlineView)parent.view).reloadItem_(handle); } public void setText (String string) {