diff dwt/internal/cocoa/NSFormCell.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSFormCell.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSFormCell;
+
+import dwt.internal.cocoa.CGFloat;
+import dwt.internal.cocoa.NSActionCell;
+import dwt.internal.cocoa.NSText : NSTextAlignment, NSWritingDirection;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSFormCell : NSActionCell
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public NSAttributedString attributedTitle ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
+        return result !is null ? new NSAttributedString(result) : null;
+    }
+
+    public bool isOpaque ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isOpaque) !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 void setAttributedTitle (NSAttributedString obj)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj !is null ? obj.id : null);
+    }
+
+    public void setPlaceholderAttributedString (NSAttributedString string)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string !is null ? string.id : null);
+    }
+
+    public void setPlaceholderString (NSString string)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string !is null ? string.id : null);
+    }
+
+    public void setTitle (NSString aString)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null);
+    }
+
+    public void setTitleAlignment (NSTextAlignment mode)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitleAlignment_1, mode);
+    }
+
+    public void setTitleBaseWritingDirection (NSWritingDirection writingDirection)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitleBaseWritingDirection_1, writingDirection);
+    }
+
+    public void setTitleFont (NSFont fontObj)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj !is null ? fontObj.id : null);
+    }
+
+    public void setTitleWidth (CGFloat width)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitleWidth_1, width);
+    }
+
+    public void setTitleWithMnemonic (NSString stringWithAmpersand)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand !is null ? stringWithAmpersand.id : null);
+    }
+
+    public NSString title ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSTextAlignment titleAlignment ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_titleAlignment);
+    }
+
+    public NSWritingDirection titleBaseWritingDirection ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_titleBaseWritingDirection);
+    }
+
+    public NSFont titleFont ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_titleFont);
+        return result !is null ? new NSFont(result) : null;
+    }
+
+    public CGFloat titleWidth ()
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth);
+    }
+
+    public CGFloat titleWidth_ (NSSize aSize)
+    {
+        return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth_1, aSize);
+    }
+
+}