Mercurial > projects > dwt-mac
diff dwt/widgets/TabItem.d @ 79:0dc55b17c290
Ported dwt.widgets.TabItem
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 24 Dec 2008 13:18:04 +0100 |
parents | cfa563df4fdd |
children | 63a09873578e |
line wrap: on
line diff
--- a/dwt/widgets/TabItem.d Wed Dec 24 13:12:21 2008 +0100 +++ b/dwt/widgets/TabItem.d Wed Dec 24 13:18:04 2008 +0100 @@ -7,6 +7,9 @@ * * Contributors: * IBM Corporation - initial API and implementation + * + * Port to the D programming language: + * Jacob Carlborg <doob@me.com> *******************************************************************************/ module dwt.widgets.TabItem; @@ -27,6 +30,10 @@ import dwt.internal.cocoa.NSWindow; import dwt.internal.cocoa.OS; +import dwt.widgets.Control; +import dwt.widgets.Item; +import dwt.widgets.TabFolder; + /** * Instances of this class represent a selectable user interface object * corresponding to a tab for a page in a tab folder. @@ -149,8 +156,8 @@ checkWidget(); Rectangle result = new Rectangle (0, 0, 0, 0); if (nsItem.respondsToSelector (OS.sel_accessibilityAttributeValue_)) { - int /*long*/ posValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilityPositionAttribute ()); - int /*long*/ sizeValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilitySizeAttribute ()); + objc.id posValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilityPositionAttribute_); + objc.id sizeValue = OS.objc_msgSend (nsItem.id, OS.sel_accessibilityAttributeValue_, OS.NSAccessibilitySizeAttribute_); NSValue val = new NSValue (posValue); NSPoint pt = val.pointValue (); NSWindow window = parent.view.window (); @@ -274,7 +281,7 @@ if (newControl !is null) { view = newControl.topView(); } else { - view = (NSView)new NSView().alloc(); + view = cast(NSView)(new NSView()).alloc(); view.initWithFrame (NSRect()); view.autorelease(); } @@ -323,7 +330,7 @@ char [] chars = new char [string.length ()]; string.getChars (0, chars.length, chars, 0); int length = fixMnemonic (chars); - NSString str = NSString.stringWithCharacters (chars, length); + NSString str = NSString.stringWithCharacters (chars.toString16().ptr, length); nsItem.setLabel (str); }