Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSActionCell.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | f565d3a95c0a |
children | 62202ce0039f |
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSActionCell.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/internal/cocoa/NSActionCell.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,146 +1,47 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation * * Port to the D programming language: - * Jacob Carlborg <jacob.carlborg@gmail.com> + * Jacob Carlborg <doob@me.com> *******************************************************************************/ module dwt.internal.cocoa.NSActionCell; -import dwt.internal.cocoa.id; +import dwt.dwthelper.utils; + +import cocoa = dwt.internal.cocoa.id; import dwt.internal.cocoa.NSCell; -import dwt.internal.cocoa.NSFont; import dwt.internal.cocoa.NSImage; -import dwt.internal.cocoa.NSInteger; -import dwt.internal.cocoa.NSString; -import dwt.internal.cocoa.NSView; +import dwt.internal.cocoa.NSText; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; -public class NSActionCell : NSCell -{ - public this () - { - super(); - } - - public this (objc.id id) - { - super(id); - } - - public objc.SEL action () - { - return cast(objc.SEL) OS.objc_msgSend(this.id_, OS.sel_action); - } - - public NSView controlView () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_controlView); - return result !is null ? new NSView(result) : null; - } - - public double doubleValue () - { - return cast(double) OS.objc_msgSend_fpret(this.id_, OS.sel_doubleValue); - } +public class NSActionCell : NSCell { - public float floatValue () - { - return cast(float) OS.objc_msgSend_fpret(this.id_, OS.sel_floatValue); - } - - public int intValue () - { - return cast(int) OS.objc_msgSend(this.id_, OS.sel_intValue); - } - - public NSInteger integerValue () - { - return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_integerValue); - } +public this() { + super(); +} - public void setAction (objc.SEL aSelector) - { - OS.objc_msgSend(this.id_, OS.sel_setAction_1, aSelector); - } - - public void setAlignment (objc.id mode) - { - OS.objc_msgSend(this.id_, OS.sel_setAlignment_1, mode); - } - - public void setBezeled (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setBezeled_1, flag); - } +public this(objc.id id) { + super(id); +} - public void setBordered (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setBordered_1, flag); - } - - public void setControlView (NSView view) - { - OS.objc_msgSend(this.id_, OS.sel_setControlView_1, view !is null ? view.id_ : null); - } - - public void setEnabled (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setEnabled_1, flag); - } - - public void setFloatingPointFormat (bool autoRange, NSUInteger leftDigits, NSUInteger rightDigits) - { - OS.objc_msgSend(this.id_, OS.sel_setFloatingPointFormat_1left_1right_1, autoRange, leftDigits, rightDigits); - } - - public void setFont (NSFont fontObj) - { - OS.objc_msgSend(this.id_, OS.sel_setFont_1, fontObj !is null ? fontObj.id_ : null); - } - - public void setImage (NSImage image) - { - OS.objc_msgSend(this.id_, OS.sel_setImage_1, image !is null ? image.id_ : null); - } +public this(cocoa.id id) { + super(id); +} - public void setObjectValue (id obj) - { - OS.objc_msgSend(this.id_, OS.sel_setObjectValue_1, obj !is null ? obj.id_ : null); - } - - public void setTag (NSInteger anInt) - { - OS.objc_msgSend(this.id_, OS.sel_setTag_1, anInt); - } - - public void setTarget (id anObject) - { - OS.objc_msgSend(this.id_, OS.sel_setTarget_1, anObject !is null ? anObject.id_ : null); - } +public void setAlignment(NSTextAlignment mode) { + OS.objc_msgSend(this.id, OS.sel_setAlignment_, mode); +} - public NSString StringValue () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringValue); - return result !is null ? new NSString(result) : null; - } - - public NSInteger tag () - { - return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_tag); - } - - public id target () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_target); - return result !is null ? new id(result) : null; - } +public void setImage(NSImage image) { + OS.objc_msgSend(this.id, OS.sel_setImage_, image !is null ? image.id : null); +} }