Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTextFieldCell.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.NSTextFieldCell; | |
15 | |
16 import dwt.internal.cocoa.NSActionCell; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSAttributedString; | |
19 import dwt.internal.cocoa.NSColor; | |
20 import dwt.internal.cocoa.NSString; | |
21 import dwt.internal.cocoa.NSText; | |
22 import dwt.internal.cocoa.OS; | |
23 import objc = dwt.internal.objc.runtime; | |
24 | |
25 enum NSTextFieldBezelStyle | |
26 { | |
27 NSTextFieldSquareBezel = 0, | |
28 NSTextFieldRoundedBezel = 1 | |
29 } | |
30 | |
31 alias NSTextFieldBezelStyle.NSTextFieldSquareBezel NSTextFieldSquareBezel; | |
32 alias NSTextFieldBezelStyle.NSTextFieldRoundedBezel NSTextFieldRoundedBezel; | |
33 | |
34 public class NSTextFieldCell : NSActionCell | |
35 { | |
36 | |
37 public this () | |
38 { | |
39 super(); | |
40 } | |
41 | |
42 public this (objc.id id) | |
43 { | |
44 super(id); | |
45 } | |
46 | |
47 public NSArray allowedInputSourceLocales () | |
48 { | |
49 objc.id result = OS.objc_msgSend(this.id, OS.sel_allowedInputSourceLocales); | |
50 return result !is null ? new NSArray(result) : null; | |
51 } | |
52 | |
53 public NSColor backgroundColor () | |
54 { | |
55 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | |
56 return result !is null ? new NSColor(result) : null; | |
57 } | |
58 | |
59 public NSTextFieldBezelStyle bezelStyle () | |
60 { | |
61 return cast(NSTextFieldBezelStyle) OS.objc_msgSend(this.id, OS.sel_bezelStyle); | |
62 } | |
63 | |
64 public bool drawsBackground () | |
65 { | |
66 return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is null; | |
67 } | |
68 | |
69 public NSAttributedString placeholderAttributedString () | |
70 { | |
71 objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString); | |
72 return result !is null ? new NSAttributedString(result) : null; | |
73 } | |
74 | |
75 public NSString placeholderString () | |
76 { | |
77 objc.id result = OS.objc_msgSend(this.id, OS.sel_placeholderString); | |
78 return result !is null ? new NSString(result) : null; | |
79 } | |
80 | |
81 public void setAllowedInputSourceLocales (NSArray localeIdentifiers) | |
82 { | |
83 OS.objc_msgSend(this.id, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers !is null ? localeIdentifiers.id : null); | |
84 } | |
85 | |
86 public void setBackgroundColor (NSColor color) | |
87 { | |
88 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | |
89 } | |
90 | |
91 public void setBezelStyle (NSTextFieldBezelStyle style) | |
92 { | |
93 OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, style); | |
94 } | |
95 | |
96 public void setDrawsBackground (bool flag) | |
97 { | |
98 OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag); | |
99 } | |
100 | |
101 public void setPlaceholderAttributedString (NSAttributedString string) | |
102 { | |
103 OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string !is null ? string.id : null); | |
104 } | |
105 | |
106 public void setPlaceholderString (NSString string) | |
107 { | |
108 OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string !is null ? string.id : null); | |
109 } | |
110 | |
111 public void setTextColor (NSColor color) | |
112 { | |
113 OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color !is null ? color.id : null); | |
114 } | |
115 | |
116 public NSText setUpFieldEditorAttributes (NSText textObj) | |
117 { | |
118 objc.id result = OS.objc_msgSend(this.id, OS.sel_setUpFieldEditorAttributes_1, textObj !is null ? textObj.id : null); | |
119 return result !is null ? new NSText(result) : null; | |
120 } | |
121 | |
122 public void setWantsNotificationForMarkedText (bool flag) | |
123 { | |
124 OS.objc_msgSend(this.id, OS.sel_setWantsNotificationForMarkedText_1, flag); | |
125 } | |
126 | |
127 public NSColor textColor () | |
128 { | |
129 objc.id result = OS.objc_msgSend(this.id, OS.sel_textColor); | |
130 return result !is null ? new NSColor(result) : null; | |
131 } | |
132 | |
133 } |