Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTabView.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.NSTabView; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSCell : NSControlSize, NSControlTint; | |
19 import dwt.internal.cocoa.NSFont; | |
20 import dwt.internal.cocoa.NSInteger; | |
21 import dwt.internal.cocoa.NSPoint; | |
22 import dwt.internal.cocoa.NSRect; | |
23 import dwt.internal.cocoa.NSSize; | |
24 import dwt.internal.cocoa.NSTabViewItem; | |
25 import dwt.internal.cocoa.NSView; | |
26 import dwt.internal.cocoa.OS; | |
27 import objc = dwt.internal.objc.runtime; | |
28 | |
29 enum NSTabViewType | |
30 { | |
31 NSTopTabsBezelBorder = 0, | |
32 NSLeftTabsBezelBorder = 1, | |
33 NSBottomTabsBezelBorder = 2, | |
34 NSRightTabsBezelBorder = 3, | |
35 NSNoTabsBezelBorder = 4, | |
36 NSNoTabsLineBorder = 5, | |
37 NSNoTabsNoBorder = 6 | |
38 } | |
39 | |
40 alias NSTabViewType.NSTopTabsBezelBorder NSTopTabsBezelBorder; | |
41 alias NSTabViewType.NSLeftTabsBezelBorder NSLeftTabsBezelBorder; | |
42 alias NSTabViewType.NSBottomTabsBezelBorder NSBottomTabsBezelBorder; | |
43 alias NSTabViewType.NSRightTabsBezelBorder NSRightTabsBezelBorder; | |
44 alias NSTabViewType.NSNoTabsBezelBorder NSNoTabsBezelBorder; | |
45 alias NSTabViewType.NSNoTabsLineBorder NSNoTabsLineBorder; | |
46 alias NSTabViewType.NSNoTabsNoBorder NSNoTabsNoBorder; | |
47 | |
48 public class NSTabView : NSView | |
49 { | |
50 | |
51 public this () | |
52 { | |
53 super(); | |
54 } | |
55 | |
56 public this (objc.id id) | |
57 { | |
58 super(id); | |
59 } | |
60 | |
61 public void addTabViewItem (NSTabViewItem tabViewItem) | |
62 { | |
63 OS.objc_msgSend(this.id, OS.sel_addTabViewItem_1, tabViewItem !is null ? tabViewItem.id : null); | |
64 } | |
65 | |
66 public bool allowsTruncatedLabels () | |
67 { | |
68 return OS.objc_msgSend(this.id, OS.sel_allowsTruncatedLabels) !is null; | |
69 } | |
70 | |
71 public NSRect contentRect () | |
72 { | |
73 NSRect result; | |
74 OS.objc_msgSend_stret(result, this.id, OS.sel_contentRect); | |
75 return result; | |
76 } | |
77 | |
78 public NSControlSize controlSize () | |
79 { | |
80 return cast(NSControlSize) OS.objc_msgSend(this.id, OS.sel_controlSize); | |
81 } | |
82 | |
83 public NSControlTint controlTint () | |
84 { | |
85 return OS.objc_msgSend(this.id, OS.sel_controlTint); | |
86 } | |
87 | |
88 public id delegatee () | |
89 { | |
90 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
91 return result !is null ? new id(result) : null; | |
92 } | |
93 | |
94 public bool drawsBackground () | |
95 { | |
96 return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is null; | |
97 } | |
98 | |
99 public NSFont font () | |
100 { | |
101 objc.id result = OS.objc_msgSend(this.id, OS.sel_font); | |
102 return result !is null ? new NSFont(result) : null; | |
103 } | |
104 | |
105 public NSInteger indexOfTabViewItem (NSTabViewItem tabViewItem) | |
106 { | |
107 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_indexOfTabViewItem_1, tabViewItem !is null ? tabViewItem.id : null); | |
108 } | |
109 | |
110 public NSInteger indexOfTabViewItemWithIdentifier (id identifier) | |
111 { | |
112 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_indexOfTabViewItemWithIdentifier_1, identifier !is null ? identifier.id : null); | |
113 } | |
114 | |
115 public void insertTabViewItem (NSTabViewItem tabViewItem, NSInteger index) | |
116 { | |
117 OS.objc_msgSend(this.id, OS.sel_insertTabViewItem_1atIndex_1, tabViewItem !is null ? tabViewItem.id : null, index); | |
118 } | |
119 | |
120 public NSSize minimumSize () | |
121 { | |
122 NSSize result; | |
123 OS.objc_msgSend_struct(result, this.id, OS.sel_minimumSize); | |
124 return result; | |
125 } | |
126 | |
127 public NSInteger numberOfTabViewItems () | |
128 { | |
129 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_numberOfTabViewItems); | |
130 } | |
131 | |
132 public void removeTabViewItem (NSTabViewItem tabViewItem) | |
133 { | |
134 OS.objc_msgSend(this.id, OS.sel_removeTabViewItem_1, tabViewItem !is null ? tabViewItem.id : null); | |
135 } | |
136 | |
137 public void selectFirstTabViewItem (id sender) | |
138 { | |
139 OS.objc_msgSend(this.id, OS.sel_selectFirstTabViewItem_1, sender !is null ? sender.id : null); | |
140 } | |
141 | |
142 public void selectLastTabViewItem (id sender) | |
143 { | |
144 OS.objc_msgSend(this.id, OS.sel_selectLastTabViewItem_1, sender !is null ? sender.id : null); | |
145 } | |
146 | |
147 public void selectNextTabViewItem (id sender) | |
148 { | |
149 OS.objc_msgSend(this.id, OS.sel_selectNextTabViewItem_1, sender !is null ? sender.id : null); | |
150 } | |
151 | |
152 public void selectPreviousTabViewItem (id sender) | |
153 { | |
154 OS.objc_msgSend(this.id, OS.sel_selectPreviousTabViewItem_1, sender !is null ? sender.id : null); | |
155 } | |
156 | |
157 public void selectTabViewItem (NSTabViewItem tabViewItem) | |
158 { | |
159 OS.objc_msgSend(this.id, OS.sel_selectTabViewItem_1, tabViewItem !is null ? tabViewItem.id : null); | |
160 } | |
161 | |
162 public void selectTabViewItemAtIndex (NSInteger index) | |
163 { | |
164 OS.objc_msgSend(this.id, OS.sel_selectTabViewItemAtIndex_1, index); | |
165 } | |
166 | |
167 public void selectTabViewItemWithIdentifier (id identifier) | |
168 { | |
169 OS.objc_msgSend(this.id, OS.sel_selectTabViewItemWithIdentifier_1, identifier !is null ? identifier.id : null); | |
170 } | |
171 | |
172 public NSTabViewItem selectedTabViewItem () | |
173 { | |
174 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedTabViewItem); | |
175 return result !is null ? new NSTabViewItem(result) : null; | |
176 } | |
177 | |
178 public void setAllowsTruncatedLabels (bool allowTruncatedLabels) | |
179 { | |
180 OS.objc_msgSend(this.id, OS.sel_setAllowsTruncatedLabels_1, allowTruncatedLabels); | |
181 } | |
182 | |
183 public void setControlSize (NSControlSize controlSize) | |
184 { | |
185 OS.objc_msgSend(this.id, OS.sel_setControlSize_1, controlSize); | |
186 } | |
187 | |
188 public void setControlTint (NSControlTint controlTint) | |
189 { | |
190 OS.objc_msgSend(this.id, OS.sel_setControlTint_1, controlTint); | |
191 } | |
192 | |
193 public void setDelegate (id anObject) | |
194 { | |
195 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject !is null ? anObject.id : null); | |
196 } | |
197 | |
198 public void setDrawsBackground (bool flag) | |
199 { | |
200 OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag); | |
201 } | |
202 | |
203 public void setFont (NSFont font) | |
204 { | |
205 OS.objc_msgSend(this.id, OS.sel_setFont_1, font !is null ? font.id : null); | |
206 } | |
207 | |
208 public void setTabViewType (NSTabViewType tabViewType) | |
209 { | |
210 OS.objc_msgSend(this.id, OS.sel_setTabViewType_1, tabViewType); | |
211 } | |
212 | |
213 public NSTabViewItem tabViewItemAtIndex (NSInteger index) | |
214 { | |
215 objc.id result = OS.objc_msgSend(this.id, OS.sel_tabViewItemAtIndex_1, index); | |
216 return result !is null ? new NSTabViewItem(result) : null; | |
217 } | |
218 | |
219 public NSTabViewItem tabViewItemAtPoint (NSPoint point) | |
220 { | |
221 objc.id result = OS.objc_msgSend(this.id, OS.sel_tabViewItemAtPoint_1, point); | |
222 return result !is null ? new NSTabViewItem(result) : null; | |
223 } | |
224 | |
225 public NSArray tabViewItems () | |
226 { | |
227 objc.id result = OS.objc_msgSend(this.id, OS.sel_tabViewItems); | |
228 return result !is null ? new NSArray(result) : null; | |
229 } | |
230 | |
231 public NSTabViewType tabViewType () | |
232 { | |
233 return cast(NSTabViewType) OS.objc_msgSend(this.id, OS.sel_tabViewType); | |
234 } | |
235 | |
236 public void takeSelectedTabViewItemFromSender (id sender) | |
237 { | |
238 OS.objc_msgSend(this.id, OS.sel_takeSelectedTabViewItemFromSender_1, sender !is null ? sender.id : null); | |
239 } | |
240 | |
241 } |