comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSFormCell;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.NSActionCell;
18 import dwt.internal.cocoa.NSText : NSTextAlignment, NSWritingDirection;
19 import dwt.internal.cocoa.OS;
20 import objc = dwt.internal.objc.runtime;
21
22 public class NSFormCell : NSActionCell
23 {
24
25 public this ()
26 {
27 super();
28 }
29
30 public this (objc.id id)
31 {
32 super(id);
33 }
34
35 public NSAttributedString attributedTitle ()
36 {
37 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
38 return result !is null ? new NSAttributedString(result) : null;
39 }
40
41 public bool isOpaque ()
42 {
43 return OS.objc_msgSend(this.id, OS.sel_isOpaque) !is null;
44 }
45
46 public NSAttributedString placeholderAttributedString ()
47 {
48 objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString);
49 return result !is null ? new NSAttributedString(result) : null;
50 }
51
52 public NSString placeholderString ()
53 {
54 objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderString);
55 return result !is null ? new NSString(result) : null;
56 }
57
58 public void setAttributedTitle (NSAttributedString obj)
59 {
60 OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj !is null ? obj.id : null);
61 }
62
63 public void setPlaceholderAttributedString (NSAttributedString string)
64 {
65 OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string !is null ? string.id : null);
66 }
67
68 public void setPlaceholderString (NSString string)
69 {
70 OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string !is null ? string.id : null);
71 }
72
73 public void setTitle (NSString aString)
74 {
75 OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null);
76 }
77
78 public void setTitleAlignment (NSTextAlignment mode)
79 {
80 OS.objc_msgSend(this.id, OS.sel_setTitleAlignment_1, mode);
81 }
82
83 public void setTitleBaseWritingDirection (NSWritingDirection writingDirection)
84 {
85 OS.objc_msgSend(this.id, OS.sel_setTitleBaseWritingDirection_1, writingDirection);
86 }
87
88 public void setTitleFont (NSFont fontObj)
89 {
90 OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj !is null ? fontObj.id : null);
91 }
92
93 public void setTitleWidth (CGFloat width)
94 {
95 OS.objc_msgSend(this.id, OS.sel_setTitleWidth_1, width);
96 }
97
98 public void setTitleWithMnemonic (NSString stringWithAmpersand)
99 {
100 OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand !is null ? stringWithAmpersand.id : null);
101 }
102
103 public NSString title ()
104 {
105 objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
106 return result !is null ? new NSString(result) : null;
107 }
108
109 public NSTextAlignment titleAlignment ()
110 {
111 return OS.objc_msgSend(this.id, OS.sel_titleAlignment);
112 }
113
114 public NSWritingDirection titleBaseWritingDirection ()
115 {
116 return OS.objc_msgSend(this.id, OS.sel_titleBaseWritingDirection);
117 }
118
119 public NSFont titleFont ()
120 {
121 objc.id result = OS.objc_msgSend(this.id, OS.sel_titleFont);
122 return result !is null ? new NSFont(result) : null;
123 }
124
125 public CGFloat titleWidth ()
126 {
127 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth);
128 }
129
130 public CGFloat titleWidth_ (NSSize aSize)
131 {
132 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth_1, aSize);
133 }
134
135 }