Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMenuItem.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 |
---|---|
37 super(id); | 37 super(id); |
38 } | 38 } |
39 | 39 |
40 public objc.SEL action () | 40 public objc.SEL action () |
41 { | 41 { |
42 return OS.objc_msgSend(this.id, OS.sel_action); | 42 return cast(objc.SEL) OS.objc_msgSend(this.id_, OS.sel_action); |
43 } | 43 } |
44 | 44 |
45 public NSAttributedString attributedTitle () | 45 public NSAttributedString attributedTitle () |
46 { | 46 { |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle); | 47 objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributedTitle); |
48 return result !is null ? new NSAttributedString(result) : null; | 48 return result !is null ? new NSAttributedString(result) : null; |
49 } | 49 } |
50 | 50 |
51 public bool hasSubmenu () | 51 public bool hasSubmenu () |
52 { | 52 { |
53 return OS.objc_msgSend(this.id, OS.sel_hasSubmenu) !is null; | 53 return OS.objc_msgSend(this.id_, OS.sel_hasSubmenu) !is null; |
54 } | 54 } |
55 | 55 |
56 public NSImage image () | 56 public NSImage image () |
57 { | 57 { |
58 objc.id result = OS.objc_msgSend(this.id, OS.sel_image); | 58 objc.id result = OS.objc_msgSend(this.id_, OS.sel_image); |
59 return result !is null ? new NSImage(result) : null; | 59 return result !is null ? new NSImage(result) : null; |
60 } | 60 } |
61 | 61 |
62 public NSInteger indentationLevel () | 62 public NSInteger indentationLevel () |
63 { | 63 { |
64 return OS.objc_msgSend(this.id, OS.sel_indentationLevel); | 64 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_indentationLevel); |
65 } | 65 } |
66 | 66 |
67 public NSMenuItem initWithTitle (NSString aString, objc.SEL aSelector, NSString charCode) | 67 public NSMenuItem initWithTitle (NSString aString, objc.SEL aSelector, NSString charCode) |
68 { | 68 { |
69 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithTitle_1action_1keyEquivalent_1, aString !is null ? aString.id : null, aSelector, | 69 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithTitle_1action_1keyEquivalent_1, aString !is null ? aString.id_ : null, aSelector, |
70 charCode !is null ? charCode.id : null); | 70 charCode !is null ? charCode.id_ : null); |
71 return result !is null ? this : null; | 71 return result !is null ? this : null; |
72 } | 72 } |
73 | 73 |
74 public bool isAlternate () | 74 public bool isAlternate () |
75 { | 75 { |
76 return OS.objc_msgSend(this.id, OS.sel_isAlternate) !is null; | 76 return OS.objc_msgSend(this.id_, OS.sel_isAlternate) !is null; |
77 } | 77 } |
78 | 78 |
79 public bool isEnabled () | 79 public bool isEnabled () |
80 { | 80 { |
81 return OS.objc_msgSend(this.id, OS.sel_isEnabled) !is null; | 81 return OS.objc_msgSend(this.id_, OS.sel_isEnabled) !is null; |
82 } | 82 } |
83 | 83 |
84 public bool isHidden () | 84 public bool isHidden () |
85 { | 85 { |
86 return OS.objc_msgSend(this.id, OS.sel_isHidden) !is null; | 86 return OS.objc_msgSend(this.id_, OS.sel_isHidden) !is null; |
87 } | 87 } |
88 | 88 |
89 public bool isHiddenOrHasHiddenAncestor () | 89 public bool isHiddenOrHasHiddenAncestor () |
90 { | 90 { |
91 return OS.objc_msgSend(this.id, OS.sel_isHiddenOrHasHiddenAncestor) !is null; | 91 return OS.objc_msgSend(this.id_, OS.sel_isHiddenOrHasHiddenAncestor) !is null; |
92 } | 92 } |
93 | 93 |
94 public bool isHighlighted () | 94 public bool isHighlighted () |
95 { | 95 { |
96 return OS.objc_msgSend(this.id, OS.sel_isHighlighted) !is null; | 96 return OS.objc_msgSend(this.id_, OS.sel_isHighlighted) !is null; |
97 } | 97 } |
98 | 98 |
99 public bool isSeparatorItem () | 99 public bool isSeparatorItem () |
100 { | 100 { |
101 return OS.objc_msgSend(this.id, OS.sel_isSeparatorItem) !is null; | 101 return OS.objc_msgSend(this.id_, OS.sel_isSeparatorItem) !is null; |
102 } | 102 } |
103 | 103 |
104 public NSString keyEquivalent () | 104 public NSString keyEquivalent () |
105 { | 105 { |
106 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent); | 106 objc.id result = OS.objc_msgSend(this.id_, OS.sel_keyEquivalent); |
107 return result !is null ? new NSString(result) : null; | 107 return result !is null ? new NSString(result) : null; |
108 } | 108 } |
109 | 109 |
110 public NSUInteger keyEquivalentModifierMask () | 110 public NSUInteger keyEquivalentModifierMask () |
111 { | 111 { |
112 return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask); | 112 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_keyEquivalentModifierMask); |
113 } | 113 } |
114 | 114 |
115 public NSMenu menu () | 115 public NSMenu menu () |
116 { | 116 { |
117 objc.id result = OS.objc_msgSend(this.id, OS.sel_menu); | 117 objc.id result = OS.objc_msgSend(this.id_, OS.sel_menu); |
118 return result !is null ? new NSMenu(result) : null; | 118 return result !is null ? new NSMenu(result) : null; |
119 } | 119 } |
120 | 120 |
121 public NSImage mixedStateImage () | 121 public NSImage mixedStateImage () |
122 { | 122 { |
123 objc.id result = OS.objc_msgSend(this.id, OS.sel_mixedStateImage); | 123 objc.id result = OS.objc_msgSend(this.id_, OS.sel_mixedStateImage); |
124 return result !is null ? new NSImage(result) : null; | 124 return result !is null ? new NSImage(result) : null; |
125 } | 125 } |
126 | 126 |
127 public NSString mnemonic () | 127 public NSString mnemonic () |
128 { | 128 { |
129 objc.id result = OS.objc_msgSend(this.id, OS.sel_mnemonic); | 129 objc.id result = OS.objc_msgSend(this.id_, OS.sel_mnemonic); |
130 return result !is null ? new NSString(result) : null; | 130 return result !is null ? new NSString(result) : null; |
131 } | 131 } |
132 | 132 |
133 public NSUInteger mnemonicLocation () | 133 public NSUInteger mnemonicLocation () |
134 { | 134 { |
135 return OS.objc_msgSend(this.id, OS.sel_mnemonicLocation); | 135 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_mnemonicLocation); |
136 } | 136 } |
137 | 137 |
138 public NSImage offStateImage () | 138 public NSImage offStateImage () |
139 { | 139 { |
140 objc.id result = OS.objc_msgSend(this.id, OS.sel_offStateImage); | 140 objc.id result = OS.objc_msgSend(this.id_, OS.sel_offStateImage); |
141 return result !is null ? new NSImage(result) : null; | 141 return result !is null ? new NSImage(result) : null; |
142 } | 142 } |
143 | 143 |
144 public NSImage onStateImage () | 144 public NSImage onStateImage () |
145 { | 145 { |
146 objc.id result = OS.objc_msgSend(this.id, OS.sel_onStateImage); | 146 objc.id result = OS.objc_msgSend(this.id_, OS.sel_onStateImage); |
147 return result !is null ? new NSImage(result) : null; | 147 return result !is null ? new NSImage(result) : null; |
148 } | 148 } |
149 | 149 |
150 public id representedObject () | 150 public id representedObject () |
151 { | 151 { |
152 objc.id result = OS.objc_msgSend(this.id, OS.sel_representedObject); | 152 objc.id result = OS.objc_msgSend(this.id_, OS.sel_representedObject); |
153 return result !is null ? new id(result) : null; | 153 return result !is null ? new id(result) : null; |
154 } | 154 } |
155 | 155 |
156 public static NSMenuItem separatorItem () | 156 public static NSMenuItem separatorItem () |
157 { | 157 { |
159 return result !is null ? new NSMenuItem(result) : null; | 159 return result !is null ? new NSMenuItem(result) : null; |
160 } | 160 } |
161 | 161 |
162 public void setAction (objc.SEL aSelector) | 162 public void setAction (objc.SEL aSelector) |
163 { | 163 { |
164 OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector); | 164 OS.objc_msgSend(this.id_, OS.sel_setAction_1, aSelector); |
165 } | 165 } |
166 | 166 |
167 public void setAlternate (bool isAlternate) | 167 public void setAlternate (bool isAlternate) |
168 { | 168 { |
169 OS.objc_msgSend(this.id, OS.sel_setAlternate_1, isAlternate); | 169 OS.objc_msgSend(this.id_, OS.sel_setAlternate_1, isAlternate); |
170 } | 170 } |
171 | 171 |
172 public void setAttributedTitle (NSAttributedString string) | 172 public void setAttributedTitle (NSAttributedString string) |
173 { | 173 { |
174 OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, string !is null ? string.id : null); | 174 OS.objc_msgSend(this.id_, OS.sel_setAttributedTitle_1, string !is null ? string.id_ : null); |
175 } | 175 } |
176 | 176 |
177 public void setEnabled (bool flag) | 177 public void setEnabled (bool flag) |
178 { | 178 { |
179 OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag); | 179 OS.objc_msgSend(this.id_, OS.sel_setEnabled_1, flag); |
180 } | 180 } |
181 | 181 |
182 public void setHidden (bool hidden) | 182 public void setHidden (bool hidden) |
183 { | 183 { |
184 OS.objc_msgSend(this.id, OS.sel_setHidden_1, hidden); | 184 OS.objc_msgSend(this.id_, OS.sel_setHidden_1, hidden); |
185 } | 185 } |
186 | 186 |
187 public void setImage (NSImage menuImage) | 187 public void setImage (NSImage menuImage) |
188 { | 188 { |
189 OS.objc_msgSend(this.id, OS.sel_setImage_1, menuImage !is null ? menuImage.id : null); | 189 OS.objc_msgSend(this.id_, OS.sel_setImage_1, menuImage !is null ? menuImage.id_ : null); |
190 } | 190 } |
191 | 191 |
192 public void setIndentationLevel (NSInteger indentationLevel) | 192 public void setIndentationLevel (NSInteger indentationLevel) |
193 { | 193 { |
194 OS.objc_msgSend(this.id, OS.sel_setIndentationLevel_1, indentationLevel); | 194 OS.objc_msgSend(this.id_, OS.sel_setIndentationLevel_1, indentationLevel); |
195 } | 195 } |
196 | 196 |
197 public void setKeyEquivalent (NSString aKeyEquivalent) | 197 public void setKeyEquivalent (NSString aKeyEquivalent) |
198 { | 198 { |
199 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, aKeyEquivalent !is null ? aKeyEquivalent.id : null); | 199 OS.objc_msgSend(this.id_, OS.sel_setKeyEquivalent_1, aKeyEquivalent !is null ? aKeyEquivalent.id_ : null); |
200 } | 200 } |
201 | 201 |
202 public void setKeyEquivalentModifierMask (NSUInteger mask) | 202 public void setKeyEquivalentModifierMask (NSUInteger mask) |
203 { | 203 { |
204 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask); | 204 OS.objc_msgSend(this.id_, OS.sel_setKeyEquivalentModifierMask_1, mask); |
205 } | 205 } |
206 | 206 |
207 public void setMenu (NSMenu menu) | 207 public void setMenu (NSMenu menu) |
208 { | 208 { |
209 OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu !is null ? menu.id : null); | 209 OS.objc_msgSend(this.id_, OS.sel_setMenu_1, menu !is null ? menu.id_ : null); |
210 } | 210 } |
211 | 211 |
212 public void setMixedStateImage (NSImage image) | 212 public void setMixedStateImage (NSImage image) |
213 { | 213 { |
214 OS.objc_msgSend(this.id, OS.sel_setMixedStateImage_1, image !is null ? image.id : null); | 214 OS.objc_msgSend(this.id_, OS.sel_setMixedStateImage_1, image !is null ? image.id_ : null); |
215 } | 215 } |
216 | 216 |
217 public void setMnemonicLocation (NSUInteger location) | 217 public void setMnemonicLocation (NSUInteger location) |
218 { | 218 { |
219 OS.objc_msgSend(this.id, OS.sel_setMnemonicLocation_1, location); | 219 OS.objc_msgSend(this.id_, OS.sel_setMnemonicLocation_1, location); |
220 } | 220 } |
221 | 221 |
222 public void setOffStateImage (NSImage image) | 222 public void setOffStateImage (NSImage image) |
223 { | 223 { |
224 OS.objc_msgSend(this.id, OS.sel_setOffStateImage_1, image !is null ? image.id : null); | 224 OS.objc_msgSend(this.id_, OS.sel_setOffStateImage_1, image !is null ? image.id_ : null); |
225 } | 225 } |
226 | 226 |
227 public void setOnStateImage (NSImage image) | 227 public void setOnStateImage (NSImage image) |
228 { | 228 { |
229 OS.objc_msgSend(this.id, OS.sel_setOnStateImage_1, image !is null ? image.id : null); | 229 OS.objc_msgSend(this.id_, OS.sel_setOnStateImage_1, image !is null ? image.id_ : null); |
230 } | 230 } |
231 | 231 |
232 public void setRepresentedObject (id anObject) | 232 public void setRepresentedObject (id anObject) |
233 { | 233 { |
234 OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, anObject !is null ? anObject.id : null); | 234 OS.objc_msgSend(this.id_, OS.sel_setRepresentedObject_1, anObject !is null ? anObject.id_ : null); |
235 } | 235 } |
236 | 236 |
237 public void setState (NSInteger state) | 237 public void setState (NSInteger state) |
238 { | 238 { |
239 OS.objc_msgSend(this.id, OS.sel_setState_1, state); | 239 OS.objc_msgSend(this.id_, OS.sel_setState_1, state); |
240 } | 240 } |
241 | 241 |
242 public void setSubmenu (NSMenu submenu) | 242 public void setSubmenu (NSMenu submenu) |
243 { | 243 { |
244 OS.objc_msgSend(this.id, OS.sel_setSubmenu_1, submenu !is null ? submenu.id : null); | 244 OS.objc_msgSend(this.id_, OS.sel_setSubmenu_1, submenu !is null ? submenu.id_ : null); |
245 } | 245 } |
246 | 246 |
247 public void setTag (NSInteger anInt) | 247 public void setTag (NSInteger anInt) |
248 { | 248 { |
249 OS.objc_msgSend(this.id, OS.sel_setTag_1, anInt); | 249 OS.objc_msgSend(this.id_, OS.sel_setTag_1, anInt); |
250 } | 250 } |
251 | 251 |
252 public void setTarget (id anObject) | 252 public void setTarget (id anObject) |
253 { | 253 { |
254 OS.objc_msgSend(this.id, OS.sel_setTarget_1, anObject !is null ? anObject.id : null); | 254 OS.objc_msgSend(this.id_, OS.sel_setTarget_1, anObject !is null ? anObject.id_ : null); |
255 } | 255 } |
256 | 256 |
257 public void setTitle (NSString aString) | 257 public void setTitle (NSString aString) |
258 { | 258 { |
259 OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null); | 259 OS.objc_msgSend(this.id_, OS.sel_setTitle_1, aString !is null ? aString.id_ : null); |
260 } | 260 } |
261 | 261 |
262 public void setTitleWithMnemonic (NSString stringWithAmpersand) | 262 public void setTitleWithMnemonic (NSString stringWithAmpersand) |
263 { | 263 { |
264 OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand !is null ? stringWithAmpersand.id : null); | 264 OS.objc_msgSend(this.id_, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand !is null ? stringWithAmpersand.id_ : null); |
265 } | 265 } |
266 | 266 |
267 public void setToolTip (NSString toolTip) | 267 public void setToolTip (NSString toolTip) |
268 { | 268 { |
269 OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip !is null ? toolTip.id : null); | 269 OS.objc_msgSend(this.id_, OS.sel_setToolTip_1, toolTip !is null ? toolTip.id_ : null); |
270 } | 270 } |
271 | 271 |
272 public static void setUsesUserKeyEquivalents (bool flag) | 272 public static void setUsesUserKeyEquivalents (bool flag) |
273 { | 273 { |
274 OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_setUsesUserKeyEquivalents_1, flag); | 274 OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_setUsesUserKeyEquivalents_1, flag); |
275 } | 275 } |
276 | 276 |
277 public void setView (NSView view) | 277 public void setView (NSView view) |
278 { | 278 { |
279 OS.objc_msgSend(this.id, OS.sel_setView_1, view !is null ? view.id : null); | 279 OS.objc_msgSend(this.id_, OS.sel_setView_1, view !is null ? view.id_ : null); |
280 } | 280 } |
281 | 281 |
282 public NSInteger state () | 282 public NSInteger state () |
283 { | 283 { |
284 return OS.objc_msgSend(this.id, OS.sel_state); | 284 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_state); |
285 } | 285 } |
286 | 286 |
287 public NSMenu submenu () | 287 public NSMenu submenu () |
288 { | 288 { |
289 objc.id result = OS.objc_msgSend(this.id, OS.sel_submenu); | 289 objc.id result = OS.objc_msgSend(this.id_, OS.sel_submenu); |
290 return result !is null ? new NSMenu(result) : null; | 290 return result !is null ? new NSMenu(result) : null; |
291 } | 291 } |
292 | 292 |
293 public NSInteger tag () | 293 public NSInteger tag () |
294 { | 294 { |
295 return OS.objc_msgSend(this.id, OS.sel_tag); | 295 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_tag); |
296 } | 296 } |
297 | 297 |
298 public id target () | 298 public id target () |
299 { | 299 { |
300 objc.id result = OS.objc_msgSend(this.id, OS.sel_target); | 300 objc.id result = OS.objc_msgSend(this.id_, OS.sel_target); |
301 return result !is null ? new id(result) : null; | 301 return result !is null ? new id(result) : null; |
302 } | 302 } |
303 | 303 |
304 public NSString title () | 304 public NSString title () |
305 { | 305 { |
306 objc.id result = OS.objc_msgSend(this.id, OS.sel_title); | 306 objc.id result = OS.objc_msgSend(this.id_, OS.sel_title); |
307 return result !is null ? new NSString(result) : null; | 307 return result !is null ? new NSString(result) : null; |
308 } | 308 } |
309 | 309 |
310 public NSString toolTip () | 310 public NSString toolTip () |
311 { | 311 { |
312 objc.id result = OS.objc_msgSend(this.id, OS.sel_toolTip); | 312 objc.id result = OS.objc_msgSend(this.id_, OS.sel_toolTip); |
313 return result !is null ? new NSString(result) : null; | 313 return result !is null ? new NSString(result) : null; |
314 } | 314 } |
315 | 315 |
316 public NSString userKeyEquivalent () | 316 public NSString userKeyEquivalent () |
317 { | 317 { |
318 objc.id result = OS.objc_msgSend(this.id, OS.sel_userKeyEquivalent); | 318 objc.id result = OS.objc_msgSend(this.id_, OS.sel_userKeyEquivalent); |
319 return result !is null ? new NSString(result) : null; | 319 return result !is null ? new NSString(result) : null; |
320 } | 320 } |
321 | 321 |
322 public static bool usesUserKeyEquivalents () | 322 public static bool usesUserKeyEquivalents () |
323 { | 323 { |
324 return OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_usesUserKeyEquivalents) !is null; | 324 return OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_usesUserKeyEquivalents) !is null; |
325 } | 325 } |
326 | 326 |
327 public NSView view () | 327 public NSView view () |
328 { | 328 { |
329 objc.id result = OS.objc_msgSend(this.id, OS.sel_view); | 329 objc.id result = OS.objc_msgSend(this.id_, OS.sel_view); |
330 return result !is null ? new NSView(result) : null; | 330 return result !is null ? new NSView(result) : null; |
331 } | 331 } |
332 | 332 |
333 } | 333 } |