# HG changeset patch # User Jacob Carlborg # Date 1230121084 -3600 # Node ID 0dc55b17c2902811d3c7f8036fe47ac5f6c64c60 # Parent d226cd03f84a2651b975dd8d51ade5fc534a0f83 Ported dwt.widgets.TabItem diff -r d226cd03f84a -r 0dc55b17c290 dwt/dwthelper/utils.d --- a/dwt/dwthelper/utils.d Wed Dec 24 13:12:21 2008 +0100 +++ b/dwt/dwthelper/utils.d Wed Dec 24 13:18:04 2008 +0100 @@ -413,8 +413,8 @@ return res.length; } -public alias tango.text.convert.Utf.toString16 toString16; -public alias tango.text.convert.Utf.toString toString; +alias tango.text.convert.Utf.toString16 toString16; +alias tango.text.convert.Utf.toString toString; int getRelativeCodePointOffset( String str, int startIndex, int searchRelCp ){ int ignore; diff -r d226cd03f84a -r 0dc55b17c290 dwt/widgets/TabItem.d --- 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 *******************************************************************************/ 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); }