Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSComboBoxCell.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
11 * Port to the D Programming language: | 11 * Port to the D Programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSComboBoxCell; | 14 module dwt.internal.cocoa.NSComboBoxCell; |
15 | 15 |
16 import dwt.internal.cocoa.CGFloat; | |
16 import dwt.internal.cocoa.id; | 17 import dwt.internal.cocoa.id; |
17 import dwt.internal.cocoa.NSArray; | 18 import dwt.internal.cocoa.NSArray; |
18 import dwt.internal.cocoa.NSInteger; | 19 import dwt.internal.cocoa.NSInteger; |
19 import dwt.internal.cocoa.NSSize; | 20 import dwt.internal.cocoa.NSSize; |
20 import dwt.internal.cocoa.NSString; | 21 import dwt.internal.cocoa.NSString; |
35 super(id); | 36 super(id); |
36 } | 37 } |
37 | 38 |
38 public void addItemWithObjectValue (id object) | 39 public void addItemWithObjectValue (id object) |
39 { | 40 { |
40 OS.objc_msgSend(this.id, OS.sel_addItemWithObjectValue_1, object !is null ? object.id : null); | 41 OS.objc_msgSend(this.id_, OS.sel_addItemWithObjectValue_1, object !is null ? object.id_ : null); |
41 } | 42 } |
42 | 43 |
43 public void addItemsWithObjectValues (NSArray objects) | 44 public void addItemsWithObjectValues (NSArray objects) |
44 { | 45 { |
45 OS.objc_msgSend(this.id, OS.sel_addItemsWithObjectValues_1, objects !is null ? objects.id : null); | 46 OS.objc_msgSend(this.id_, OS.sel_addItemsWithObjectValues_1, objects !is null ? objects.id_ : null); |
46 } | 47 } |
47 | 48 |
48 public NSString completedString (NSString string) | 49 public NSString completedString (NSString string) |
49 { | 50 { |
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_completedString_1, string !is null ? string.id : null); | 51 objc.id result = OS.objc_msgSend(this.id_, OS.sel_completedString_1, string !is null ? string.id_ : null); |
51 return result !is null ? new NSString(result) : null; | 52 return result !is null ? new NSString(result) : null; |
52 } | 53 } |
53 | 54 |
54 public bool completes () | 55 public bool completes () |
55 { | 56 { |
56 return OS.objc_msgSend(this.id, OS.sel_completes) !is null; | 57 return OS.objc_msgSend(this.id_, OS.sel_completes) !is null; |
57 } | 58 } |
58 | 59 |
59 public id dataSource () | 60 public id dataSource () |
60 { | 61 { |
61 objc.id result = OS.objc_msgSend(this.id, OS.sel_dataSource); | 62 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dataSource); |
62 return result !is null ? new id(result) : null; | 63 return result !is null ? new id(result) : null; |
63 } | 64 } |
64 | 65 |
65 public void deselectItemAtIndex (NSInteger index) | 66 public void deselectItemAtIndex (NSInteger index) |
66 { | 67 { |
67 OS.objc_msgSend(this.id, OS.sel_deselectItemAtIndex_1, index); | 68 OS.objc_msgSend(this.id_, OS.sel_deselectItemAtIndex_1, index); |
68 } | 69 } |
69 | 70 |
70 public bool hasVerticalScroller () | 71 public bool hasVerticalScroller () |
71 { | 72 { |
72 return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) !is null; | 73 return OS.objc_msgSend(this.id_, OS.sel_hasVerticalScroller) !is null; |
73 } | 74 } |
74 | 75 |
75 public NSInteger indexOfItemWithObjectValue (id object) | 76 public NSInteger indexOfItemWithObjectValue (id object) |
76 { | 77 { |
77 return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithObjectValue_1, object !is null ? object.id : null); | 78 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfItemWithObjectValue_1, object !is null ? object.id_ : null); |
78 } | 79 } |
79 | 80 |
80 public NSInteger indexOfSelectedItem () | 81 public NSInteger indexOfSelectedItem () |
81 { | 82 { |
82 return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem); | 83 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_indexOfSelectedItem); |
83 } | 84 } |
84 | 85 |
85 public void insertItemWithObjectValue (id object, NSInteger index) | 86 public void insertItemWithObjectValue (id object, NSInteger index) |
86 { | 87 { |
87 OS.objc_msgSend(this.id, OS.sel_insertItemWithObjectValue_1atIndex_1, object !is null ? object.id : null, index); | 88 OS.objc_msgSend(this.id_, OS.sel_insertItemWithObjectValue_1atIndex_1, object !is null ? object.id_ : null, index); |
88 } | 89 } |
89 | 90 |
90 public NSSize intercellSpacing () | 91 public NSSize intercellSpacing () |
91 { | 92 { |
92 NSSize result; | 93 NSSize result; |
93 OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing); | 94 OS.objc_msgSend_stret(&result, this.id_, OS.sel_intercellSpacing); |
94 return result; | 95 return result; |
95 } | 96 } |
96 | 97 |
97 public bool isButtonBordered () | 98 public bool isButtonBordered () |
98 { | 99 { |
99 return OS.objc_msgSend(this.id, OS.sel_isButtonBordered) !is null; | 100 return OS.objc_msgSend(this.id_, OS.sel_isButtonBordered) !is null; |
100 } | 101 } |
101 | 102 |
102 public CGFloat itemHeight () | 103 public CGFloat itemHeight () |
103 { | 104 { |
104 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_itemHeight); | 105 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_itemHeight); |
105 } | 106 } |
106 | 107 |
107 public id itemObjectValueAtIndex (NSInteger index) | 108 public id itemObjectValueAtIndex (NSInteger index) |
108 { | 109 { |
109 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemObjectValueAtIndex_1, index); | 110 objc.id result = OS.objc_msgSend(this.id_, OS.sel_itemObjectValueAtIndex_1, index); |
110 return result !is null ? new id(result) : null; | 111 return result !is null ? new id(result) : null; |
111 } | 112 } |
112 | 113 |
113 public void noteNumberOfItemsChanged () | 114 public void noteNumberOfItemsChanged () |
114 { | 115 { |
115 OS.objc_msgSend(this.id, OS.sel_noteNumberOfItemsChanged); | 116 OS.objc_msgSend(this.id_, OS.sel_noteNumberOfItemsChanged); |
116 } | 117 } |
117 | 118 |
118 public NSInteger numberOfItems () | 119 public NSInteger numberOfItems () |
119 { | 120 { |
120 return OS.objc_msgSend(this.id, OS.sel_numberOfItems); | 121 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfItems); |
121 } | 122 } |
122 | 123 |
123 public NSInteger numberOfVisibleItems () | 124 public NSInteger numberOfVisibleItems () |
124 { | 125 { |
125 return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleItems); | 126 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfVisibleItems); |
126 } | 127 } |
127 | 128 |
128 public id objectValueOfSelectedItem () | 129 public id objectValueOfSelectedItem () |
129 { | 130 { |
130 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectValueOfSelectedItem); | 131 objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectValueOfSelectedItem); |
131 return result !is null ? new id(result) : null; | 132 return result !is null ? new id(result) : null; |
132 } | 133 } |
133 | 134 |
134 public NSArray objectValues () | 135 public NSArray objectValues () |
135 { | 136 { |
136 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectValues); | 137 objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectValues); |
137 return result !is null ? new NSArray(result) : null; | 138 return result !is null ? new NSArray(result) : null; |
138 } | 139 } |
139 | 140 |
140 public void reloadData () | 141 public void reloadData () |
141 { | 142 { |
142 OS.objc_msgSend(this.id, OS.sel_reloadData); | 143 OS.objc_msgSend(this.id_, OS.sel_reloadData); |
143 } | 144 } |
144 | 145 |
145 public void removeAllItems () | 146 public void removeAllItems () |
146 { | 147 { |
147 OS.objc_msgSend(this.id, OS.sel_removeAllItems); | 148 OS.objc_msgSend(this.id_, OS.sel_removeAllItems); |
148 } | 149 } |
149 | 150 |
150 public void removeItemAtIndex (NSInteger index) | 151 public void removeItemAtIndex (NSInteger index) |
151 { | 152 { |
152 OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index); | 153 OS.objc_msgSend(this.id_, OS.sel_removeItemAtIndex_1, index); |
153 } | 154 } |
154 | 155 |
155 public void removeItemWithObjectValue (id object) | 156 public void removeItemWithObjectValue (id object) |
156 { | 157 { |
157 OS.objc_msgSend(this.id, OS.sel_removeItemWithObjectValue_1, object !is null ? object.id : null); | 158 OS.objc_msgSend(this.id_, OS.sel_removeItemWithObjectValue_1, object !is null ? object.id_ : null); |
158 } | 159 } |
159 | 160 |
160 public void scrollItemAtIndexToTop (NSInteger index) | 161 public void scrollItemAtIndexToTop (NSInteger index) |
161 { | 162 { |
162 OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToTop_1, index); | 163 OS.objc_msgSend(this.id_, OS.sel_scrollItemAtIndexToTop_1, index); |
163 } | 164 } |
164 | 165 |
165 public void scrollItemAtIndexToVisible (NSInteger index) | 166 public void scrollItemAtIndexToVisible (NSInteger index) |
166 { | 167 { |
167 OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToVisible_1, index); | 168 OS.objc_msgSend(this.id_, OS.sel_scrollItemAtIndexToVisible_1, index); |
168 } | 169 } |
169 | 170 |
170 public void selectItemAtIndex (NSInteger index) | 171 public void selectItemAtIndex (NSInteger index) |
171 { | 172 { |
172 OS.objc_msgSend(this.id, OS.sel_selectItemAtIndex_1, index); | 173 OS.objc_msgSend(this.id_, OS.sel_selectItemAtIndex_1, index); |
173 } | 174 } |
174 | 175 |
175 public void selectItemWithObjectValue (id object) | 176 public void selectItemWithObjectValue (id object) |
176 { | 177 { |
177 OS.objc_msgSend(this.id, OS.sel_selectItemWithObjectValue_1, object !is null ? object.id : null); | 178 OS.objc_msgSend(this.id_, OS.sel_selectItemWithObjectValue_1, object !is null ? object.id_ : null); |
178 } | 179 } |
179 | 180 |
180 public void setButtonBordered (bool flag) | 181 public void setButtonBordered (bool flag) |
181 { | 182 { |
182 OS.objc_msgSend(this.id, OS.sel_setButtonBordered_1, flag); | 183 OS.objc_msgSend(this.id_, OS.sel_setButtonBordered_1, flag); |
183 } | 184 } |
184 | 185 |
185 public void setCompletes (bool completes) | 186 public void setCompletes (bool completes) |
186 { | 187 { |
187 OS.objc_msgSend(this.id, OS.sel_setCompletes_1, completes); | 188 OS.objc_msgSend(this.id_, OS.sel_setCompletes_1, completes); |
188 } | 189 } |
189 | 190 |
190 public void setDataSource (id aSource) | 191 public void setDataSource (id aSource) |
191 { | 192 { |
192 OS.objc_msgSend(this.id, OS.sel_setDataSource_1, aSource !is null ? aSource.id : null); | 193 OS.objc_msgSend(this.id_, OS.sel_setDataSource_1, aSource !is null ? aSource.id_ : null); |
193 } | 194 } |
194 | 195 |
195 public void setHasVerticalScroller (bool flag) | 196 public void setHasVerticalScroller (bool flag) |
196 { | 197 { |
197 OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag); | 198 OS.objc_msgSend(this.id_, OS.sel_setHasVerticalScroller_1, flag); |
198 } | 199 } |
199 | 200 |
200 public void setIntercellSpacing (NSSize aSize) | 201 public void setIntercellSpacing (NSSize aSize) |
201 { | 202 { |
202 OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize); | 203 OS.objc_msgSend(this.id_, OS.sel_setIntercellSpacing_1, aSize); |
203 } | 204 } |
204 | 205 |
205 public void setItemHeight (CGFloat itemHeight) | 206 public void setItemHeight (CGFloat itemHeight) |
206 { | 207 { |
207 OS.objc_msgSend(this.id, OS.sel_setItemHeight_1, itemHeight); | 208 OS.objc_msgSend(this.id_, OS.sel_setItemHeight_1, itemHeight); |
208 } | 209 } |
209 | 210 |
210 public void setNumberOfVisibleItems (NSInteger visibleItems) | 211 public void setNumberOfVisibleItems (NSInteger visibleItems) |
211 { | 212 { |
212 OS.objc_msgSend(this.id, OS.sel_setNumberOfVisibleItems_1, visibleItems); | 213 OS.objc_msgSend(this.id_, OS.sel_setNumberOfVisibleItems_1, visibleItems); |
213 } | 214 } |
214 | 215 |
215 public void setUsesDataSource (bool flag) | 216 public void setUsesDataSource (bool flag) |
216 { | 217 { |
217 OS.objc_msgSend(this.id, OS.sel_setUsesDataSource_1, flag); | 218 OS.objc_msgSend(this.id_, OS.sel_setUsesDataSource_1, flag); |
218 } | 219 } |
219 | 220 |
220 public bool usesDataSource () | 221 public bool usesDataSource () |
221 { | 222 { |
222 return OS.objc_msgSend(this.id, OS.sel_usesDataSource) !is null; | 223 return OS.objc_msgSend(this.id_, OS.sel_usesDataSource) !is null; |
223 } | 224 } |
224 | 225 |
225 } | 226 } |