Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSTextFieldCell.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 |
line wrap: on
line diff
--- a/dwt/internal/cocoa/NSTextFieldCell.d Tue Oct 21 15:20:04 2008 +0200 +++ b/dwt/internal/cocoa/NSTextFieldCell.d Mon Dec 01 17:07:00 2008 +0100 @@ -1,133 +1,46 @@ /******************************************************************************* - * 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.NSTextFieldCell; +import dwt.dwthelper.utils; +import cocoa = dwt.internal.cocoa.id; import dwt.internal.cocoa.NSActionCell; -import dwt.internal.cocoa.NSArray; -import dwt.internal.cocoa.NSAttributedString; import dwt.internal.cocoa.NSColor; -import dwt.internal.cocoa.NSString; -import dwt.internal.cocoa.NSText; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; -enum NSTextFieldBezelStyle -{ - NSTextFieldSquareBezel = 0, - NSTextFieldRoundedBezel = 1 +public class NSTextFieldCell : NSActionCell { + +public this() { + super(); +} + +public this(objc.id id) { + super(id); } -alias NSTextFieldBezelStyle.NSTextFieldSquareBezel NSTextFieldSquareBezel; -alias NSTextFieldBezelStyle.NSTextFieldRoundedBezel NSTextFieldRoundedBezel; - -public class NSTextFieldCell : NSActionCell -{ - - public this () - { - super(); - } - - public this (objc.id id) - { - super(id); - } - - public NSArray allowedInputSourceLocales () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_allowedInputSourceLocales); - return result !is null ? new NSArray(result) : null; - } - - public NSColor backgroundColor () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); - return result !is null ? new NSColor(result) : null; - } - - public NSTextFieldBezelStyle bezelStyle () - { - return cast(NSTextFieldBezelStyle) OS.objc_msgSend(this.id_, OS.sel_bezelStyle); - } - - public bool drawsBackground () - { - return OS.objc_msgSend(this.id_, OS.sel_drawsBackground) !is null; - } - - public NSAttributedString placeholderAttributedString () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_placeholderAttributedString); - return result !is null ? new NSAttributedString(result) : null; - } - - public NSString placeholderString () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_placeholderString); - return result !is null ? new NSString(result) : null; - } +public this(cocoa.id id) { + super(id); +} - public void setAllowedInputSourceLocales (NSArray localeIdentifiers) - { - OS.objc_msgSend(this.id_, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers !is null ? localeIdentifiers.id_ : null); - } - - public void setBackgroundColor (NSColor color) - { - OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null); - } - - public void setBezelStyle (NSTextFieldBezelStyle style) - { - OS.objc_msgSend(this.id_, OS.sel_setBezelStyle_1, style); - } - - public void setDrawsBackground (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setDrawsBackground_1, flag); - } - - public void setPlaceholderAttributedString (NSAttributedString string) - { - OS.objc_msgSend(this.id_, OS.sel_setPlaceholderAttributedString_1, string !is null ? string.id_ : null); - } +public void setTextColor(NSColor color) { + OS.objc_msgSend(this.id, OS.sel_setTextColor_, color !is null ? color.id : null); +} - public void setPlaceholderString (NSString string) - { - OS.objc_msgSend(this.id_, OS.sel_setPlaceholderString_1, string !is null ? string.id_ : null); - } - - public void setTextColor (NSColor color) - { - OS.objc_msgSend(this.id_, OS.sel_setTextColor_1, color !is null ? color.id_ : null); - } - - public NSText setUpFieldEditorAttributes (NSText textObj) - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_setUpFieldEditorAttributes_1, textObj !is null ? textObj.id_ : null); - return result !is null ? new NSText(result) : null; - } - - public void setWantsNotificationForMarkedText (bool flag) - { - OS.objc_msgSend(this.id_, OS.sel_setWantsNotificationForMarkedText_1, flag); - } - - public NSColor textColor () - { - objc.id result = OS.objc_msgSend(this.id_, OS.sel_textColor); - return result !is null ? new NSColor(result) : null; - } +public NSColor textColor() { + objc.id result = OS.objc_msgSend(this.id, OS.sel_textColor); + return result !is null ? new NSColor(result) : null; +} }