Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSToolbarItem.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.NSToolbarItem; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSImage; | |
18 import dwt.internal.cocoa.NSInteger; | |
19 import dwt.internal.cocoa.NSMenuItem; | |
20 import dwt.internal.cocoa.NSObject; | |
21 import dwt.internal.cocoa.NSSize; | |
22 import dwt.internal.cocoa.NSString; | |
23 import dwt.internal.cocoa.NSToolbar; | |
24 import dwt.internal.cocoa.NSView; | |
25 import dwt.internal.cocoa.OS; | |
26 import objc = dwt.internal.objc.runtime; | |
27 | |
28 public class NSToolbarItem : NSObject | |
29 { | |
30 | |
31 public this () | |
32 { | |
33 super(); | |
34 } | |
35 | |
36 public this (objc.id id) | |
37 { | |
38 super(id); | |
39 } | |
40 | |
41 public objc.SEL action () | |
42 { | |
43 return cast(objc.SEL) OS.objc_msgSend(this.id, OS.sel_action); | |
44 } | |
45 | |
46 public bool allowsDuplicatesInToolbar () | |
47 { | |
48 return OS.objc_msgSend(this.id, OS.sel_allowsDuplicatesInToolbar) !is null; | |
49 } | |
50 | |
51 public bool autovalidates () | |
52 { | |
53 return OS.objc_msgSend(this.id, OS.sel_autovalidates) !is null; | |
54 } | |
55 | |
56 public NSImage image () | |
57 { | |
58 objc.id result = OS.objc_msgSend(this.id, OS.sel_image); | |
59 return result !is null ? new NSImage(result) : null; | |
60 } | |
61 | |
62 public id initWithItemIdentifier (NSString itemIdentifier) | |
63 { | |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithItemIdentifier_1, itemIdentifier !is null ? itemIdentifier.id : null); | |
65 return result !is null ? new id(result) : null; | |
66 } | |
67 | |
68 public bool isEnabled () | |
69 { | |
70 return OS.objc_msgSend(this.id, OS.sel_isEnabled) !is null; | |
71 } | |
72 | |
73 public NSString itemIdentifier () | |
74 { | |
75 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemIdentifier); | |
76 return result !is null ? new NSString(result) : null; | |
77 } | |
78 | |
79 public NSString label () | |
80 { | |
81 objc.id result = OS.objc_msgSend(this.id, OS.sel_label); | |
82 return result !is null ? new NSString(result) : null; | |
83 } | |
84 | |
85 public NSSize maxSize () | |
86 { | |
87 NSSize result; | |
88 OS.objc_msgSend_stret(result, this.id, OS.sel_maxSize); | |
89 return result; | |
90 } | |
91 | |
92 public NSMenuItem menuFormRepresentation () | |
93 { | |
94 objc.id result = OS.objc_msgSend(this.id, OS.sel_menuFormRepresentation); | |
95 return result !is null ? new NSMenuItem(result) : null; | |
96 } | |
97 | |
98 public NSSize minSize () | |
99 { | |
100 NSSize result; | |
101 OS.objc_msgSend_stret(result, this.id, OS.sel_minSize); | |
102 return result; | |
103 } | |
104 | |
105 public NSString paletteLabel () | |
106 { | |
107 objc.id result = OS.objc_msgSend(this.id, OS.sel_paletteLabel); | |
108 return result !is null ? new NSString(result) : null; | |
109 } | |
110 | |
111 public void setAction (objc.SEL action) | |
112 { | |
113 OS.objc_msgSend(this.id, OS.sel_setAction_1, action); | |
114 } | |
115 | |
116 public void setAutovalidates (bool resistance) | |
117 { | |
118 OS.objc_msgSend(this.id, OS.sel_setAutovalidates_1, resistance); | |
119 } | |
120 | |
121 public void setEnabled (bool enabled) | |
122 { | |
123 OS.objc_msgSend(this.id, OS.sel_setEnabled_1, enabled); | |
124 } | |
125 | |
126 public void setImage (NSImage image) | |
127 { | |
128 OS.objc_msgSend(this.id, OS.sel_setImage_1, image !is null ? image.id : null); | |
129 } | |
130 | |
131 public void setLabel (NSString label) | |
132 { | |
133 OS.objc_msgSend(this.id, OS.sel_setLabel_1, label !is null ? label.id : null); | |
134 } | |
135 | |
136 public void setMaxSize (NSSize size) | |
137 { | |
138 OS.objc_msgSend(this.id, OS.sel_setMaxSize_1, size); | |
139 } | |
140 | |
141 public void setMenuFormRepresentation (NSMenuItem menuItem) | |
142 { | |
143 OS.objc_msgSend(this.id, OS.sel_setMenuFormRepresentation_1, menuItem !is null ? menuItem.id : null); | |
144 } | |
145 | |
146 public void setMinSize (NSSize size) | |
147 { | |
148 OS.objc_msgSend(this.id, OS.sel_setMinSize_1, size); | |
149 } | |
150 | |
151 public void setPaletteLabel (NSString paletteLabel) | |
152 { | |
153 OS.objc_msgSend(this.id, OS.sel_setPaletteLabel_1, paletteLabel !is null ? paletteLabel.id : null); | |
154 } | |
155 | |
156 public void setTag (NSInteger tag) | |
157 { | |
158 OS.objc_msgSend(this.id, OS.sel_setTag_1, tag); | |
159 } | |
160 | |
161 public void setTarget (id target) | |
162 { | |
163 OS.objc_msgSend(this.id, OS.sel_setTarget_1, target !is null ? target.id : null); | |
164 } | |
165 | |
166 public void setToolTip (NSString toolTip) | |
167 { | |
168 OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip !is null ? toolTip.id : null); | |
169 } | |
170 | |
171 public void setView (NSView view) | |
172 { | |
173 OS.objc_msgSend(this.id, OS.sel_setView_1, view !is null ? view.id : null); | |
174 } | |
175 | |
176 public void setVisibilityPriority (NSInteger visibilityPriority) | |
177 { | |
178 OS.objc_msgSend(this.id, OS.sel_setVisibilityPriority_1, visibilityPriority); | |
179 } | |
180 | |
181 public NSInteger tag () | |
182 { | |
183 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_tag); | |
184 } | |
185 | |
186 public id target () | |
187 { | |
188 objc.id result = OS.objc_msgSend(this.id, OS.sel_target); | |
189 return result !is null ? new id(result) : null; | |
190 } | |
191 | |
192 public NSString toolTip () | |
193 { | |
194 objc.id result = OS.objc_msgSend(this.id, OS.sel_toolTip); | |
195 return result !is null ? new NSString(result) : null; | |
196 } | |
197 | |
198 public NSToolbar toolbar () | |
199 { | |
200 objc.id result = OS.objc_msgSend(this.id, OS.sel_toolbar); | |
201 return result !is null ? new NSToolbar(result) : null; | |
202 } | |
203 | |
204 public void validate () | |
205 { | |
206 OS.objc_msgSend(this.id, OS.sel_validate); | |
207 } | |
208 | |
209 public NSView view () | |
210 { | |
211 objc.id result = OS.objc_msgSend(this.id, OS.sel_view); | |
212 return result !is null ? new NSView(result) : null; | |
213 } | |
214 | |
215 public NSInteger visibilityPriority () | |
216 { | |
217 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_visibilityPriority); | |
218 } | |
219 | |
220 } |