comparison dstep/appkit/NSComboBoxCell.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Sep 24, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.appkit.NSComboBoxCell;
8
9 import dstep.appkit.NSButtonCell;
10 import dstep.appkit.NSTableView;
11 import dstep.appkit.NSTextFieldCell;
12 import dstep.applicationservices.coregraphics.CGBase;
13 import dstep.foundation.NSArray;
14 import dstep.foundation.NSGeometry;
15 import dstep.foundation.NSObjCRuntime;
16 import dstep.foundation.NSString;
17 import dstep.objc.bridge.Bridge;
18 import dstep.objc.objc;
19
20 class NSComboBoxCell : NSTextFieldCell
21 {
22 mixin (ObjcWrap);
23
24 bool hasVerticalScroller ()
25 {
26 return invokeObjcSelf!(bool, "hasVerticalScroller");
27 }
28
29 void setHasVerticalScroller (bool flag)
30 {
31 return invokeObjcSelf!(void, "setHasVerticalScroller:", bool)(flag);
32 }
33
34 NSSize intercellSpacing ()
35 {
36 return invokeObjcSelf!(NSSize, "intercellSpacing");
37 }
38
39 void setIntercellSpacing (NSSize aSize)
40 {
41 return invokeObjcSelf!(void, "setIntercellSpacing:", NSSize)(aSize);
42 }
43
44 CGFloat itemHeight ()
45 {
46 return invokeObjcSelf!(CGFloat, "itemHeight");
47 }
48
49 void setItemHeight (CGFloat itemHeight)
50 {
51 return invokeObjcSelf!(void, "setItemHeight:", CGFloat)(itemHeight);
52 }
53
54 NSInteger numberOfVisibleItems ()
55 {
56 return invokeObjcSelf!(NSInteger, "numberOfVisibleItems");
57 }
58
59 void setNumberOfVisibleItems (NSInteger visibleItems)
60 {
61 return invokeObjcSelf!(void, "setNumberOfVisibleItems:", NSInteger)(visibleItems);
62 }
63
64 void setButtonBordered (bool flag)
65 {
66 return invokeObjcSelf!(void, "setButtonBordered:", bool)(flag);
67 }
68
69 bool isButtonBordered ()
70 {
71 return invokeObjcSelf!(bool, "isButtonBordered");
72 }
73
74 void reloadData ()
75 {
76 return invokeObjcSelf!(void, "reloadData");
77 }
78
79 void noteNumberOfItemsChanged ()
80 {
81 return invokeObjcSelf!(void, "noteNumberOfItemsChanged");
82 }
83
84 void setUsesDataSource (bool flag)
85 {
86 return invokeObjcSelf!(void, "setUsesDataSource:", bool)(flag);
87 }
88
89 bool usesDataSource ()
90 {
91 return invokeObjcSelf!(bool, "usesDataSource");
92 }
93
94 void scrollItemAtIndexToTop (NSInteger index)
95 {
96 return invokeObjcSelf!(void, "scrollItemAtIndexToTop:", NSInteger)(index);
97 }
98
99 void scrollItemAtIndexToVisible (NSInteger index)
100 {
101 return invokeObjcSelf!(void, "scrollItemAtIndexToVisible:", NSInteger)(index);
102 }
103
104 void selectItemAtIndex (NSInteger index)
105 {
106 return invokeObjcSelf!(void, "selectItemAtIndex:", NSInteger)(index);
107 }
108
109 void deselectItemAtIndex (NSInteger index)
110 {
111 return invokeObjcSelf!(void, "deselectItemAtIndex:", NSInteger)(index);
112 }
113
114 NSInteger indexOfSelectedItem ()
115 {
116 return invokeObjcSelf!(NSInteger, "indexOfSelectedItem");
117 }
118
119 NSInteger numberOfItems ()
120 {
121 return invokeObjcSelf!(NSInteger, "numberOfItems");
122 }
123
124 bool completes ()
125 {
126 return invokeObjcSelf!(bool, "completes");
127 }
128
129 void setCompletes (bool completes)
130 {
131 return invokeObjcSelf!(void, "setCompletes:", bool)(completes);
132 }
133
134 NSString completedString (NSString string)
135 {
136 return invokeObjcSelf!(NSString, "completedString:", NSString)(string);
137 }
138
139 Object dataSource ()
140 {
141 return invokeObjcSelf!(Object, "dataSource");
142 }
143
144 void setDataSource (Object aSource)
145 {
146 return invokeObjcSelf!(void, "setDataSource:", Object)(aSource);
147 }
148
149 void addItemWithObjectValue (Object object)
150 {
151 return invokeObjcSelf!(void, "addItemWithObjectValue:", Object)(object);
152 }
153
154 void addItemsWithObjectValues (NSArray objects)
155 {
156 return invokeObjcSelf!(void, "addItemsWithObjectValues:", NSArray)(objects);
157 }
158
159 void insertItemWithObjectValue (Object object, NSInteger index)
160 {
161 return invokeObjcSelf!(void, "insertItemWithObjectValue:atIndex:", Object, NSInteger)(object, index);
162 }
163
164 void removeItemWithObjectValue (Object object)
165 {
166 return invokeObjcSelf!(void, "removeItemWithObjectValue:", Object)(object);
167 }
168
169 void removeItemAtIndex (NSInteger index)
170 {
171 return invokeObjcSelf!(void, "removeItemAtIndex:", NSInteger)(index);
172 }
173
174 void removeAllItems ()
175 {
176 return invokeObjcSelf!(void, "removeAllItems");
177 }
178
179 void selectItemWithObjectValue (Object object)
180 {
181 return invokeObjcSelf!(void, "selectItemWithObjectValue:", Object)(object);
182 }
183
184 Object itemObjectValueAtIndex (NSInteger index)
185 {
186 return invokeObjcSelf!(Object, "itemObjectValueAtIndex:", NSInteger)(index);
187 }
188
189 Object objectValueOfSelectedItem ()
190 {
191 return invokeObjcSelf!(Object, "objectValueOfSelectedItem");
192 }
193
194 NSInteger indexOfItemWithObjectValue (Object object)
195 {
196 return invokeObjcSelf!(NSInteger, "indexOfItemWithObjectValue:", Object)(object);
197 }
198
199 NSArray objectValues ()
200 {
201 return invokeObjcSelf!(NSArray, "objectValues");
202 }
203 }
204
205 const TNSComboBoxCellDataSource = `
206
207 NSInteger numberOfItemsInComboBoxCell (NSComboBoxCell comboBoxCell)
208 {
209 return invokeObjcSelf!(NSInteger, "numberOfItemsInComboBoxCell:", NSComboBoxCell)(comboBoxCell);
210 }
211
212 Object comboBoxCell (NSComboBoxCell aComboBoxCell, NSInteger index)
213 {
214 return invokeObjcSelf!(Object, "comboBoxCell:objectValueForItemAtIndex:", NSComboBoxCell, NSInteger)(aComboBoxCell, index);
215 }
216
217 NSUInteger comboBoxCell (NSComboBoxCell aComboBoxCell, NSString string)
218 {
219 return invokeObjcSelf!(NSUInteger, "comboBoxCell:indexOfItemWithStringValue:", NSComboBoxCell, NSString)(aComboBoxCell, string);
220 }
221
222 NSString comboBoxCell (NSComboBoxCell aComboBoxCell, NSString uncompletedString)
223 {
224 return invokeObjcSelf!(NSString, "comboBoxCell:completedString:", NSComboBoxCell, NSString)(aComboBoxCell, uncompletedString);
225 }
226
227 //mixin ObjcBindMethod!(numberOfItemsInComboBoxCell, "numberOfItemsInComboBoxCell:");
228 //mixin ObjcBindMethod!(comboBoxCell, "comboBoxCell:objectValueForItemAtIndex:");
229 //mixin ObjcBindMethod!(comboBoxCell, "comboBoxCell:indexOfItemWithStringValue:");
230 //mixin ObjcBindMethod!(comboBoxCell, "comboBoxCell:completedString:");
231
232 `;
233