Mercurial > projects > dwt-mac
diff dwt/widgets/Label.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/Label.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/widgets/Label.d Wed Aug 27 14:30:35 2008 +0200 @@ -133,8 +133,8 @@ textView.sizeToFit(); NSRect newRect = textView.frame(); textView.setFrame (oldRect); - width = (int)newRect.width; - height = (int)newRect.height; + width = cast(int)newRect.width; + height = cast(int)newRect.height; } } if (wHint !is DWT.DEFAULT) width = wHint; @@ -143,7 +143,7 @@ } void createHandle () { - SWTBox widget = (SWTBox)new SWTBox().alloc(); + SWTBox widget = cast(SWTBox)new SWTBox().alloc(); widget.initWithFrame(new NSRect()); widget.setTag(jniRef); widget.setTitle(NSString.stringWith("")); @@ -152,11 +152,11 @@ } else { widget.setBorderType(OS.NSNoBorder); - NSImageView imageWidget = (NSImageView)new SWTImageView().alloc(); + NSImageView imageWidget = cast(NSImageView)new SWTImageView().alloc(); imageWidget.initWithFrame(new NSRect()); imageWidget.setTag(jniRef); - SWTTextField textWidget = (SWTTextField)new SWTTextField().alloc(); + SWTTextField textWidget = cast(SWTTextField)new SWTTextField().alloc(); textWidget.initWithFrame(new NSRect()); textWidget.setBordered(false); textWidget.setEditable(false); @@ -193,7 +193,7 @@ int length = fixMnemonic (chars); 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; } @@ -349,7 +349,7 @@ this.image = image; isImage = true; imageView.setImage(image !is null ? image.handle : null); - ((NSBox)view).setContentView(imageView); + (cast(NSBox)view).setContentView(imageView); } /** @@ -387,7 +387,7 @@ text = string; NSCell cell = new NSCell(textView.cell()); cell.setAttributedStringValue(createString()); - ((NSBox)view).setContentView(textView); + (cast(NSBox)view).setContentView(textView); } }