Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSButtonCell.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.NSButtonCell; | |
15 | |
16 import dwt.internal.cocoa.CGFloat; | |
17 import dwt.internal.cocoa.NSActionCell; | |
18 import dwt.internal.cocoa.NSAttributedString; | |
19 import dwt.internal.cocoa.NSColor; | |
20 import dwt.internal.cocoa.NSEvent; | |
21 import dwt.internal.cocoa.NSFont; | |
22 import dwt.internal.cocoa.NSImage; | |
23 import dwt.internal.cocoa.NSInteger; | |
24 import dwt.internal.cocoa.NSRect; | |
25 import dwt.internal.cocoa.NSSound; | |
26 import dwt.internal.cocoa.NSString; | |
27 import dwt.internal.cocoa.NSView; | |
28 import dwt.internal.cocoa.OS; | |
29 import objc = dwt.internal.objc.runtime; | |
30 | |
31 public class NSButtonCell : NSActionCell | |
32 { | |
33 | |
34 public this () | |
35 { | |
36 super(); | |
37 } | |
38 | |
39 public this (objc.id id) | |
40 { | |
41 super(id); | |
42 } | |
43 | |
44 public NSImage alternateImage () | |
45 { | |
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateImage); | |
47 return result !is null ? new NSImage(result) : null; | |
48 } | |
49 | |
50 public NSString alternateMnemonic () | |
51 { | |
52 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateMnemonic); | |
53 return result !is null ? new NSString(result) : null; | |
54 } | |
55 | |
56 public NSUInteger alternateMnemonicLocation () | |
57 { | |
58 return OS.objc_msgSend(this.id, OS.sel_alternateMnemonicLocation); | |
59 } | |
60 | |
61 public NSString alternateTitle () | |
62 { | |
63 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateTitle); | |
64 return result !is null ? new NSString(result) : null; | |
65 } | |
66 | |
67 public NSAttributedString attributedAlternateTitle () | |
68 { | |
69 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedAlternateTitle); | |
70 return result !is null ? new NSAttributedString(result) : null; | |
71 } | |
72 | |
73 public NSAttributedString attributedTitle () | |
74 { | |
75 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle); | |
76 return result !is null ? new NSAttributedString(result) : null; | |
77 } | |
78 | |
79 public NSColor backgroundColor () | |
80 { | |
81 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | |
82 return result !is null ? new NSColor(result) : null; | |
83 } | |
84 | |
85 public objc.id bezelStyle () | |
86 { | |
87 return OS.objc_msgSend(this.id, OS.sel_bezelStyle); | |
88 } | |
89 | |
90 public void drawBezelWithFrame (NSRect frame, NSView controlView) | |
91 { | |
92 OS.objc_msgSend(this.id, OS.sel_drawBezelWithFrame_1inView_1, frame, controlView !is null ? controlView.id : null); | |
93 } | |
94 | |
95 public void drawImage (NSImage image, NSRect frame, NSView controlView) | |
96 { | |
97 OS.objc_msgSend(this.id, OS.sel_drawImage_1withFrame_1inView_1, image !is null ? image.id : null, frame, | |
98 controlView !is null ? controlView.id : null); | |
99 } | |
100 | |
101 public NSRect drawTitle (NSAttributedString title, NSRect frame, NSView controlView) | |
102 { | |
103 NSRect result; | |
104 OS.objc_msgSend_stret(result, this.id, OS.sel_drawTitle_1withFrame_1inView_1, title !is null ? title.id : null, frame, | |
105 controlView !is null ? controlView.id : null); | |
106 return result; | |
107 } | |
108 | |
109 public void getPeriodicDelay (float* delay, float* interval) | |
110 { | |
111 OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval); | |
112 } | |
113 | |
114 public objc.id gradientType () | |
115 { | |
116 return OS.objc_msgSend(this.id, OS.sel_gradientType); | |
117 } | |
118 | |
119 public NSInteger highlightsBy () | |
120 { | |
121 return OS.objc_msgSend(this.id, OS.sel_highlightsBy); | |
122 } | |
123 | |
124 public bool imageDimsWhenDisabled () | |
125 { | |
126 return OS.objc_msgSend(this.id, OS.sel_imageDimsWhenDisabled) !is null; | |
127 } | |
128 | |
129 public objc.id imagePosition () | |
130 { | |
131 return OS.objc_msgSend(this.id, OS.sel_imagePosition); | |
132 } | |
133 | |
134 public objc.id imageScaling () | |
135 { | |
136 return OS.objc_msgSend(this.id, OS.sel_imageScaling); | |
137 } | |
138 | |
139 public bool isOpaque () | |
140 { | |
141 return OS.objc_msgSend(this.id, OS.sel_isOpaque) !is null; | |
142 } | |
143 | |
144 public bool isTransparent () | |
145 { | |
146 return OS.objc_msgSend(this.id, OS.sel_isTransparent) !is null; | |
147 } | |
148 | |
149 public NSString keyEquivalent () | |
150 { | |
151 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent); | |
152 return result !is null ? new NSString(result) : null; | |
153 } | |
154 | |
155 public NSFont keyEquivalentFont () | |
156 { | |
157 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalentFont); | |
158 return result !is null ? new NSFont(result) : null; | |
159 } | |
160 | |
161 public NSUInteger keyEquivalentModifierMask () | |
162 { | |
163 return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask); | |
164 } | |
165 | |
166 public void mouseEntered (NSEvent event) | |
167 { | |
168 OS.objc_msgSend(this.id, OS.sel_mouseEntered_1, event !is null ? event.id : null); | |
169 } | |
170 | |
171 public void mouseExited (NSEvent event) | |
172 { | |
173 OS.objc_msgSend(this.id, OS.sel_mouseExited_1, event !is null ? event.id : null); | |
174 } | |
175 | |
176 public void performClick (id sender) | |
177 { | |
178 OS.objc_msgSend(this.id, OS.sel_performClick_1, sender !is null ? sender.id : null); | |
179 } | |
180 | |
181 public void setAlternateImage (NSImage image) | |
182 { | |
183 OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image !is null ? image.id : null); | |
184 } | |
185 | |
186 public void setAlternateMnemonicLocation (NSUInteger location) | |
187 { | |
188 OS.objc_msgSend(this.id, OS.sel_setAlternateMnemonicLocation_1, location); | |
189 } | |
190 | |
191 public void setAlternateTitle (NSString aString) | |
192 { | |
193 OS.objc_msgSend(this.id, OS.sel_setAlternateTitle_1, aString !is null ? aString.id : null); | |
194 } | |
195 | |
196 public void setAlternateTitleWithMnemonic (NSString StringWithAmpersand) | |
197 { | |
198 OS.objc_msgSend(this.id, OS.sel_setAlternateTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null); | |
199 } | |
200 | |
201 public void setAttributedAlternateTitle (NSAttributedString obj) | |
202 { | |
203 OS.objc_msgSend(this.id, OS.sel_setAttributedAlternateTitle_1, obj !is null ? obj.id : null); | |
204 } | |
205 | |
206 public void setAttributedTitle (NSAttributedString obj) | |
207 { | |
208 OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj !is null ? obj.id : null); | |
209 } | |
210 | |
211 public void setBackgroundColor (NSColor color) | |
212 { | |
213 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | |
214 } | |
215 | |
216 public void setBezelStyle (objc.id bezelStyle) | |
217 { | |
218 OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, bezelStyle); | |
219 } | |
220 | |
221 public void setButtonType (objc.id aType) | |
222 { | |
223 OS.objc_msgSend(this.id, OS.sel_setButtonType_1, aType); | |
224 } | |
225 | |
226 public void setFont (NSFont fontObj) | |
227 { | |
228 OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj !is null ? fontObj.id : null); | |
229 } | |
230 | |
231 public void setGradientType (objc.id type) | |
232 { | |
233 OS.objc_msgSend(this.id, OS.sel_setGradientType_1, type); | |
234 } | |
235 | |
236 public void setHighlightsBy (NSInteger aType) | |
237 { | |
238 OS.objc_msgSend(this.id, OS.sel_setHighlightsBy_1, aType); | |
239 } | |
240 | |
241 public void setImageDimsWhenDisabled (bool flag) | |
242 { | |
243 OS.objc_msgSend(this.id, OS.sel_setImageDimsWhenDisabled_1, flag); | |
244 } | |
245 | |
246 public void setImagePosition (objc.id aPosition) | |
247 { | |
248 OS.objc_msgSend(this.id, OS.sel_setImagePosition_1, aPosition); | |
249 } | |
250 | |
251 public void setImageScaling (objc.id scaling) | |
252 { | |
253 OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, scaling); | |
254 } | |
255 | |
256 public void setKeyEquivalent (NSString aKeyEquivalent) | |
257 { | |
258 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, aKeyEquivalent !is null ? aKeyEquivalent.id : null); | |
259 } | |
260 | |
261 public void setKeyEquivalentFont_ (NSFont fontObj) | |
262 { | |
263 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1, fontObj !is null ? fontObj.id : null); | |
264 } | |
265 | |
266 public void setKeyEquivalentFont_size_ (NSString fontName, CGFloat fontSize) | |
267 { | |
268 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1size_1, fontName !is null ? fontName.id : null, fontSize); | |
269 } | |
270 | |
271 public void setKeyEquivalentModifierMask (NSUInteger mask) | |
272 { | |
273 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask); | |
274 } | |
275 | |
276 public void setPeriodicDelay (float delay, float interval) | |
277 { | |
278 OS.objc_msgSend(this.id, OS.sel_setPeriodicDelay_1interval_1, delay, interval); | |
279 } | |
280 | |
281 public void setShowsBorderOnlyWhileMouseInside (bool show) | |
282 { | |
283 OS.objc_msgSend(this.id, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show); | |
284 } | |
285 | |
286 public void setShowsStateBy (NSInteger aType) | |
287 { | |
288 OS.objc_msgSend(this.id, OS.sel_setShowsStateBy_1, aType); | |
289 } | |
290 | |
291 public void setSound (NSSound aSound) | |
292 { | |
293 OS.objc_msgSend(this.id, OS.sel_setSound_1, aSound !is null ? aSound.id : null); | |
294 } | |
295 | |
296 public void setTitle (NSString aString) | |
297 { | |
298 OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null); | |
299 } | |
300 | |
301 public void setTitleWithMnemonic (NSString StringWithAmpersand) | |
302 { | |
303 OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null); | |
304 } | |
305 | |
306 public void setTransparent (bool flag) | |
307 { | |
308 OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag); | |
309 } | |
310 | |
311 public bool showsBorderOnlyWhileMouseInside () | |
312 { | |
313 return OS.objc_msgSend(this.id, OS.sel_showsBorderOnlyWhileMouseInside) !is null; | |
314 } | |
315 | |
316 public NSInteger showsStateBy () | |
317 { | |
318 return OS.objc_msgSend(this.id, OS.sel_showsStateBy); | |
319 } | |
320 | |
321 public NSSound sound () | |
322 { | |
323 objc.id result = OS.objc_msgSend(this.id, OS.sel_sound); | |
324 return result !is null ? new NSSound(result) : null; | |
325 } | |
326 | |
327 public NSString title () | |
328 { | |
329 objc.id result = OS.objc_msgSend(this.id, OS.sel_title); | |
330 return result !is null ? new NSString(result) : null; | |
331 } | |
332 | |
333 } |