comparison dwt/internal/cocoa/NSButton.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.NSButton;
15
16 import dwt.internal.cocoa.NSAttributedString;
17 import dwt.internal.cocoa.NSControl;
18 import dwt.internal.cocoa.NSEvent;
19 import dwt.internal.cocoa.NSImage;
20 import dwt.internal.cocoa.NSInteger;
21 import dwt.internal.cocoa.NSSound;
22 import dwt.internal.cocoa.NSString;
23 import dwt.internal.cocoa.OS;
24 import objc = dwt.internal.objc.runtime;
25
26 public class NSButton : NSControl
27 {
28
29 public this ()
30 {
31 super();
32 }
33
34 public this (objc.id id)
35 {
36 super(id);
37 }
38
39 public bool allowsMixedState ()
40 {
41 return OS.objc_msgSend(this.id, OS.sel_allowsMixedState) !is null;
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 alternateTitle ()
51 {
52 objc.id result = OS.objc_msgSend(this.id, OS.sel_alternateTitle);
53 return result !is null ? new NSString(result) : null;
54 }
55
56 public NSAttributedString attributedAlternateTitle ()
57 {
58 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedAlternateTitle);
59 return result !is null ? new NSAttributedString(result) : null;
60 }
61
62 public NSAttributedString attributedTitle ()
63 {
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
65 return result !is null ? new NSAttributedString(result) : null;
66 }
67
68 public objc.id bezelStyle ()
69 {
70 return OS.objc_msgSend(this.id, OS.sel_bezelStyle);
71 }
72
73 public void getPeriodicDelay (float* delay, float* interval)
74 {
75 OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval);
76 }
77
78 public void highlight (bool flag)
79 {
80 OS.objc_msgSend(this.id, OS.sel_highlight_1, flag);
81 }
82
83 public NSImage image ()
84 {
85 objc.id result = OS.objc_msgSend(this.id, OS.sel_image);
86 return result !is null ? new NSImage(result) : null;
87 }
88
89 public objc.id imagePosition ()
90 {
91 return OS.objc_msgSend(this.id, OS.sel_imagePosition);
92 }
93
94 public bool isBordered ()
95 {
96 return OS.objc_msgSend(this.id, OS.sel_isBordered) !is null;
97 }
98
99 public bool isTransparent ()
100 {
101 return OS.objc_msgSend(this.id, OS.sel_isTransparent) !is null;
102 }
103
104 public NSString keyEquivalent ()
105 {
106 objc.id result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent);
107 return result !is null ? new NSString(result) : null;
108 }
109
110 public NSUInteger keyEquivalentModifierMask ()
111 {
112 return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask);
113 }
114
115 public bool performKeyEquivalent (NSEvent key)
116 {
117 return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, key !is null ? key.id : null) !is null;
118 }
119
120 public void setAllowsMixedState (bool flag)
121 {
122 OS.objc_msgSend(this.id, OS.sel_setAllowsMixedState_1, flag);
123 }
124
125 public void setAlternateImage (NSImage image)
126 {
127 OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image !is null ? image.id : null);
128 }
129
130 public void setAlternateTitle (NSString aString)
131 {
132 OS.objc_msgSend(this.id, OS.sel_setAlternateTitle_1, aString !is null ? aString.id : null);
133 }
134
135 public void setAttributedAlternateTitle (NSAttributedString obj)
136 {
137 OS.objc_msgSend(this.id, OS.sel_setAttributedAlternateTitle_1, obj !is null ? obj.id : null);
138 }
139
140 public void setAttributedTitle (NSAttributedString aString)
141 {
142 OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, aString !is null ? aString.id : null);
143 }
144
145 public void setBezelStyle (objc.id bezelStyle)
146 {
147 OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, bezelStyle);
148 }
149
150 public void setBordered (bool flag)
151 {
152 OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
153 }
154
155 public void setButtonType (objc.id aType)
156 {
157 OS.objc_msgSend(this.id, OS.sel_setButtonType_1, aType);
158 }
159
160 public void setImage (NSImage image)
161 {
162 OS.objc_msgSend(this.id, OS.sel_setImage_1, image !is null ? image.id : null);
163 }
164
165 public void setImagePosition (objc.id aPosition)
166 {
167 OS.objc_msgSend(this.id, OS.sel_setImagePosition_1, aPosition);
168 }
169
170 public void setKeyEquivalent (NSString charCode)
171 {
172 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, charCode !is null ? charCode.id : null);
173 }
174
175 public void setKeyEquivalentModifierMask (NSUInteger mask)
176 {
177 OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask);
178 }
179
180 public void setNextState ()
181 {
182 OS.objc_msgSend(this.id, OS.sel_setNextState);
183 }
184
185 public void setPeriodicDelay (float delay, float interval)
186 {
187 OS.objc_msgSend(this.id, OS.sel_setPeriodicDelay_1interval_1, delay, interval);
188 }
189
190 public void setShowsBorderOnlyWhileMouseInside (bool show)
191 {
192 OS.objc_msgSend(this.id, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show);
193 }
194
195 public void setSound (NSSound aSound)
196 {
197 OS.objc_msgSend(this.id, OS.sel_setSound_1, aSound !is null ? aSound.id : null);
198 }
199
200 public void setState (NSInteger value)
201 {
202 OS.objc_msgSend(this.id, OS.sel_setState_1, value);
203 }
204
205 public void setTitle (NSString aString)
206 {
207 OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString !is null ? aString.id : null);
208 }
209
210 public void setTitleWithMnemonic (NSString StringWithAmpersand)
211 {
212 OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, StringWithAmpersand !is null ? StringWithAmpersand.id : null);
213 }
214
215 public void setTransparent (bool flag)
216 {
217 OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag);
218 }
219
220 public bool showsBorderOnlyWhileMouseInside ()
221 {
222 return OS.objc_msgSend(this.id, OS.sel_showsBorderOnlyWhileMouseInside) !is null;
223 }
224
225 public NSSound sound ()
226 {
227 objc.id result = OS.objc_msgSend(this.id, OS.sel_sound);
228 return result !is null ? new NSSound(result) : null;
229 }
230
231 public NSInteger state ()
232 {
233 return OS.objc_msgSend(this.id, OS.sel_state);
234 }
235
236 public NSString title ()
237 {
238 objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
239 return result !is null ? new NSString(result) : null;
240 }
241
242 }