comparison dwt/internal/cocoa/NSComboBoxCell.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.NSComboBoxCell;
15
16 import dwt.internal.cocoa.id;
17 import dwt.internal.cocoa.NSArray;
18 import dwt.internal.cocoa.NSInteger;
19 import dwt.internal.cocoa.NSSize;
20 import dwt.internal.cocoa.NSString;
21 import dwt.internal.cocoa.NSTextFieldCell;
22 import dwt.internal.cocoa.OS;
23 import objc = dwt.internal.objc.runtime;
24
25 public class NSComboBoxCell : NSTextFieldCell
26 {
27
28 public this ()
29 {
30 super();
31 }
32
33 public this (objc.id id)
34 {
35 super(id);
36 }
37
38 public void addItemWithObjectValue (id object)
39 {
40 OS.objc_msgSend(this.id, OS.sel_addItemWithObjectValue_1, object !is null ? object.id : null);
41 }
42
43 public void addItemsWithObjectValues (NSArray objects)
44 {
45 OS.objc_msgSend(this.id, OS.sel_addItemsWithObjectValues_1, objects !is null ? objects.id : null);
46 }
47
48 public NSString completedString (NSString string)
49 {
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_completedString_1, string !is null ? string.id : null);
51 return result !is null ? new NSString(result) : null;
52 }
53
54 public bool completes ()
55 {
56 return OS.objc_msgSend(this.id, OS.sel_completes) !is null;
57 }
58
59 public id dataSource ()
60 {
61 objc.id result = OS.objc_msgSend(this.id, OS.sel_dataSource);
62 return result !is null ? new id(result) : null;
63 }
64
65 public void deselectItemAtIndex (NSInteger index)
66 {
67 OS.objc_msgSend(this.id, OS.sel_deselectItemAtIndex_1, index);
68 }
69
70 public bool hasVerticalScroller ()
71 {
72 return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) !is null;
73 }
74
75 public NSInteger indexOfItemWithObjectValue (id object)
76 {
77 return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithObjectValue_1, object !is null ? object.id : null);
78 }
79
80 public NSInteger indexOfSelectedItem ()
81 {
82 return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem);
83 }
84
85 public void insertItemWithObjectValue (id object, NSInteger index)
86 {
87 OS.objc_msgSend(this.id, OS.sel_insertItemWithObjectValue_1atIndex_1, object !is null ? object.id : null, index);
88 }
89
90 public NSSize intercellSpacing ()
91 {
92 NSSize result;
93 OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
94 return result;
95 }
96
97 public bool isButtonBordered ()
98 {
99 return OS.objc_msgSend(this.id, OS.sel_isButtonBordered) !is null;
100 }
101
102 public CGFloat itemHeight ()
103 {
104 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_itemHeight);
105 }
106
107 public id itemObjectValueAtIndex (NSInteger index)
108 {
109 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemObjectValueAtIndex_1, index);
110 return result !is null ? new id(result) : null;
111 }
112
113 public void noteNumberOfItemsChanged ()
114 {
115 OS.objc_msgSend(this.id, OS.sel_noteNumberOfItemsChanged);
116 }
117
118 public NSInteger numberOfItems ()
119 {
120 return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
121 }
122
123 public NSInteger numberOfVisibleItems ()
124 {
125 return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleItems);
126 }
127
128 public id objectValueOfSelectedItem ()
129 {
130 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectValueOfSelectedItem);
131 return result !is null ? new id(result) : null;
132 }
133
134 public NSArray objectValues ()
135 {
136 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectValues);
137 return result !is null ? new NSArray(result) : null;
138 }
139
140 public void reloadData ()
141 {
142 OS.objc_msgSend(this.id, OS.sel_reloadData);
143 }
144
145 public void removeAllItems ()
146 {
147 OS.objc_msgSend(this.id, OS.sel_removeAllItems);
148 }
149
150 public void removeItemAtIndex (NSInteger index)
151 {
152 OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
153 }
154
155 public void removeItemWithObjectValue (id object)
156 {
157 OS.objc_msgSend(this.id, OS.sel_removeItemWithObjectValue_1, object !is null ? object.id : null);
158 }
159
160 public void scrollItemAtIndexToTop (NSInteger index)
161 {
162 OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToTop_1, index);
163 }
164
165 public void scrollItemAtIndexToVisible (NSInteger index)
166 {
167 OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToVisible_1, index);
168 }
169
170 public void selectItemAtIndex (NSInteger index)
171 {
172 OS.objc_msgSend(this.id, OS.sel_selectItemAtIndex_1, index);
173 }
174
175 public void selectItemWithObjectValue (id object)
176 {
177 OS.objc_msgSend(this.id, OS.sel_selectItemWithObjectValue_1, object !is null ? object.id : null);
178 }
179
180 public void setButtonBordered (bool flag)
181 {
182 OS.objc_msgSend(this.id, OS.sel_setButtonBordered_1, flag);
183 }
184
185 public void setCompletes (bool completes)
186 {
187 OS.objc_msgSend(this.id, OS.sel_setCompletes_1, completes);
188 }
189
190 public void setDataSource (id aSource)
191 {
192 OS.objc_msgSend(this.id, OS.sel_setDataSource_1, aSource !is null ? aSource.id : null);
193 }
194
195 public void setHasVerticalScroller (bool flag)
196 {
197 OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag);
198 }
199
200 public void setIntercellSpacing (NSSize aSize)
201 {
202 OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize);
203 }
204
205 public void setItemHeight (CGFloat itemHeight)
206 {
207 OS.objc_msgSend(this.id, OS.sel_setItemHeight_1, itemHeight);
208 }
209
210 public void setNumberOfVisibleItems (NSInteger visibleItems)
211 {
212 OS.objc_msgSend(this.id, OS.sel_setNumberOfVisibleItems_1, visibleItems);
213 }
214
215 public void setUsesDataSource (bool flag)
216 {
217 OS.objc_msgSend(this.id, OS.sel_setUsesDataSource_1, flag);
218 }
219
220 public bool usesDataSource ()
221 {
222 return OS.objc_msgSend(this.id, OS.sel_usesDataSource) !is null;
223 }
224
225 }