Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSScrollView.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.NSScrollView; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.CGFloat; | |
18 import dwt.internal.cocoa.NSClipView; | |
19 import dwt.internal.cocoa.NSColor; | |
20 import dwt.internal.cocoa.NSCursor; | |
21 import dwt.internal.cocoa.NSEvent; | |
22 import dwt.internal.cocoa.NSRect; | |
23 import dwt.internal.cocoa.NSRulerView; | |
24 import dwt.internal.cocoa.NSScroller; | |
25 import dwt.internal.cocoa.NSSize; | |
26 import dwt.internal.cocoa.NSView; | |
27 import dwt.internal.cocoa.OS; | |
28 import objc = dwt.internal.objc.runtime; | |
29 | |
30 public class NSScrollView : NSView | |
31 { | |
32 | |
33 public this () | |
34 { | |
35 super(); | |
36 } | |
37 | |
38 public this (objc.id id) | |
39 { | |
40 super(id); | |
41 } | |
42 | |
43 public bool autohidesScrollers () | |
44 { | |
45 return OS.objc_msgSend(this.id, OS.sel_autohidesScrollers) !is null; | |
46 } | |
47 | |
48 public NSColor backgroundColor () | |
49 { | |
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColor); | |
51 return result !is null ? new NSColor(result) : null; | |
52 } | |
53 | |
54 public NSBorderType borderType () | |
55 { | |
56 return cast(NSBorderType) OS.objc_msgSend(this.id, OS.sel_borderType); | |
57 } | |
58 | |
59 public NSSize contentSize () | |
60 { | |
61 NSSize result; | |
62 OS.objc_msgSend_struct(result, this.id, OS.sel_contentSize); | |
63 return result; | |
64 } | |
65 | |
66 public static NSSize contentSizeForFrameSize (NSSize fSize, bool hFlag, bool vFlag, NSBorderType aType) | |
67 { | |
68 NSSize result; | |
69 OS.objc_msgSend_stret(result, OS.class_NSScrollView, | |
70 OS.sel_contentSizeForFrameSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1, fSize, hFlag, vFlag, aType); | |
71 return result; | |
72 } | |
73 | |
74 public NSClipView contentView () | |
75 { | |
76 objc.id result = OS.objc_msgSend(this.id, OS.sel_contentView); | |
77 return result !is null ? new NSClipView(result) : null; | |
78 } | |
79 | |
80 public NSCursor documentCursor () | |
81 { | |
82 objc.id result = OS.objc_msgSend(this.id, OS.sel_documentCursor); | |
83 return result !is null ? new NSCursor(result) : null; | |
84 } | |
85 | |
86 public id documentView () | |
87 { | |
88 objc.id result = OS.objc_msgSend(this.id, OS.sel_documentView); | |
89 return result !is null ? new id(result) : null; | |
90 } | |
91 | |
92 public NSRect documentVisibleRect () | |
93 { | |
94 NSRect result; | |
95 OS.objc_msgSend_stret(result, this.id, OS.sel_documentVisibleRect); | |
96 return result; | |
97 } | |
98 | |
99 public bool drawsBackground () | |
100 { | |
101 return OS.objc_msgSend(this.id, OS.sel_drawsBackground) !is null; | |
102 } | |
103 | |
104 public static NSSize frameSizeForContentSize (NSSize cSize, bool hFlag, bool vFlag, NSBorderType aType) | |
105 { | |
106 NSSize result; | |
107 OS.objc_msgSend_struct(result, OS.class_NSScrollView, | |
108 OS.sel_frameSizeForContentSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1, cSize, hFlag, vFlag, aType); | |
109 return result; | |
110 } | |
111 | |
112 public bool hasHorizontalRuler () | |
113 { | |
114 return OS.objc_msgSend(this.id, OS.sel_hasHorizontalRuler) !is null; | |
115 } | |
116 | |
117 public bool hasHorizontalScroller () | |
118 { | |
119 return OS.objc_msgSend(this.id, OS.sel_hasHorizontalScroller) !is null; | |
120 } | |
121 | |
122 public bool hasVerticalRuler () | |
123 { | |
124 return OS.objc_msgSend(this.id, OS.sel_hasVerticalRuler) !is null; | |
125 } | |
126 | |
127 public bool hasVerticalScroller () | |
128 { | |
129 return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) !is null; | |
130 } | |
131 | |
132 public CGFloat horizontalLineScroll () | |
133 { | |
134 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_horizontalLineScroll); | |
135 } | |
136 | |
137 public CGFloat horizontalPageScroll () | |
138 { | |
139 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_horizontalPageScroll); | |
140 } | |
141 | |
142 public NSRulerView horizontalRulerView () | |
143 { | |
144 objc.id result = OS.objc_msgSend(this.id, OS.sel_horizontalRulerView); | |
145 return result !is null ? new NSRulerView(result) : null; | |
146 } | |
147 | |
148 public NSScroller horizontalScroller () | |
149 { | |
150 objc.id result = OS.objc_msgSend(this.id, OS.sel_horizontalScroller); | |
151 return result !is null ? new NSScroller(result) : null; | |
152 } | |
153 | |
154 public CGFloat lineScroll () | |
155 { | |
156 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_lineScroll); | |
157 } | |
158 | |
159 public CGFloat pageScroll () | |
160 { | |
161 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_pageScroll); | |
162 } | |
163 | |
164 public void reflectScrolledClipView (NSClipView cView) | |
165 { | |
166 OS.objc_msgSend(this.id, OS.sel_reflectScrolledClipView_1, cView !is null ? cView.id : null); | |
167 } | |
168 | |
169 public static objc.Class rulerViewClass () | |
170 { | |
171 return OS.objc_msgSend(OS.class_NSScrollView, OS.sel_rulerViewClass); | |
172 } | |
173 | |
174 public bool rulersVisible () | |
175 { | |
176 return OS.objc_msgSend(this.id, OS.sel_rulersVisible) !is null; | |
177 } | |
178 | |
179 public void scrollWheel (NSEvent theEvent) | |
180 { | |
181 OS.objc_msgSend(this.id, OS.sel_scrollWheel_1, theEvent !is null ? theEvent.id : null); | |
182 } | |
183 | |
184 public bool scrollsDynamically () | |
185 { | |
186 return OS.objc_msgSend(this.id, OS.sel_scrollsDynamically) !is null; | |
187 } | |
188 | |
189 public void setAutohidesScrollers (bool flag) | |
190 { | |
191 OS.objc_msgSend(this.id, OS.sel_setAutohidesScrollers_1, flag); | |
192 } | |
193 | |
194 public void setBackgroundColor (NSColor color) | |
195 { | |
196 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color !is null ? color.id : null); | |
197 } | |
198 | |
199 public void setBorderType (NSBorderType aType) | |
200 { | |
201 OS.objc_msgSend(this.id, OS.sel_setBorderType_1, aType); | |
202 } | |
203 | |
204 public void setContentView (NSClipView contentView) | |
205 { | |
206 OS.objc_msgSend(this.id, OS.sel_setContentView_1, contentView !is null ? contentView.id : null); | |
207 } | |
208 | |
209 public void setDocumentCursor (NSCursor anObj) | |
210 { | |
211 OS.objc_msgSend(this.id, OS.sel_setDocumentCursor_1, anObj !is null ? anObj.id : null); | |
212 } | |
213 | |
214 public void setDocumentView (NSView aView) | |
215 { | |
216 OS.objc_msgSend(this.id, OS.sel_setDocumentView_1, aView !is null ? aView.id : null); | |
217 } | |
218 | |
219 public void setDrawsBackground (bool flag) | |
220 { | |
221 OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag); | |
222 } | |
223 | |
224 public void setHasHorizontalRuler (bool flag) | |
225 { | |
226 OS.objc_msgSend(this.id, OS.sel_setHasHorizontalRuler_1, flag); | |
227 } | |
228 | |
229 public void setHasHorizontalScroller (bool flag) | |
230 { | |
231 OS.objc_msgSend(this.id, OS.sel_setHasHorizontalScroller_1, flag); | |
232 } | |
233 | |
234 public void setHasVerticalRuler (bool flag) | |
235 { | |
236 OS.objc_msgSend(this.id, OS.sel_setHasVerticalRuler_1, flag); | |
237 } | |
238 | |
239 public void setHasVerticalScroller (bool flag) | |
240 { | |
241 OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag); | |
242 } | |
243 | |
244 public void setHorizontalLineScroll (CGFloat value) | |
245 { | |
246 OS.objc_msgSend(this.id, OS.sel_setHorizontalLineScroll_1, value); | |
247 } | |
248 | |
249 public void setHorizontalPageScroll (CGFloat value) | |
250 { | |
251 OS.objc_msgSend(this.id, OS.sel_setHorizontalPageScroll_1, value); | |
252 } | |
253 | |
254 public void setHorizontalRulerView (NSRulerView ruler) | |
255 { | |
256 OS.objc_msgSend(this.id, OS.sel_setHorizontalRulerView_1, ruler !is null ? ruler.id : null); | |
257 } | |
258 | |
259 public void setHorizontalScroller (NSScroller anObject) | |
260 { | |
261 OS.objc_msgSend(this.id, OS.sel_setHorizontalScroller_1, anObject !is null ? anObject.id : null); | |
262 } | |
263 | |
264 public void setLineScroll (CGFloat value) | |
265 { | |
266 OS.objc_msgSend(this.id, OS.sel_setLineScroll_1, value); | |
267 } | |
268 | |
269 public void setPageScroll (CGFloat value) | |
270 { | |
271 OS.objc_msgSend(this.id, OS.sel_setPageScroll_1, value); | |
272 } | |
273 | |
274 public static void setRulerViewClass (objc.Class rulerViewClass) | |
275 { | |
276 OS.objc_msgSend(OS.class_NSScrollView, OS.sel_setRulerViewClass_1, rulerViewClass); | |
277 } | |
278 | |
279 public void setRulersVisible (bool flag) | |
280 { | |
281 OS.objc_msgSend(this.id, OS.sel_setRulersVisible_1, flag); | |
282 } | |
283 | |
284 public void setScrollsDynamically (bool flag) | |
285 { | |
286 OS.objc_msgSend(this.id, OS.sel_setScrollsDynamically_1, flag); | |
287 } | |
288 | |
289 public void setVerticalLineScroll (CGFloat value) | |
290 { | |
291 OS.objc_msgSend(this.id, OS.sel_setVerticalLineScroll_1, value); | |
292 } | |
293 | |
294 public void setVerticalPageScroll (CGFloat value) | |
295 { | |
296 OS.objc_msgSend(this.id, OS.sel_setVerticalPageScroll_1, value); | |
297 } | |
298 | |
299 public void setVerticalRulerView (NSRulerView ruler) | |
300 { | |
301 OS.objc_msgSend(this.id, OS.sel_setVerticalRulerView_1, ruler !is null ? ruler.id : null); | |
302 } | |
303 | |
304 public void setVerticalScroller (NSScroller anObject) | |
305 { | |
306 OS.objc_msgSend(this.id, OS.sel_setVerticalScroller_1, anObject !is null ? anObject.id : null); | |
307 } | |
308 | |
309 public void tile () | |
310 { | |
311 OS.objc_msgSend(this.id, OS.sel_tile); | |
312 } | |
313 | |
314 public CGFloat verticalLineScroll () | |
315 { | |
316 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_verticalLineScroll); | |
317 } | |
318 | |
319 public CGFloat verticalPageScroll () | |
320 { | |
321 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_verticalPageScroll); | |
322 } | |
323 | |
324 public NSRulerView verticalRulerView () | |
325 { | |
326 objc.id result = OS.objc_msgSend(this.id, OS.sel_verticalRulerView); | |
327 return result !is null ? new NSRulerView(result) : null; | |
328 } | |
329 | |
330 public NSScroller verticalScroller () | |
331 { | |
332 objc.id result = OS.objc_msgSend(this.id, OS.sel_verticalScroller); | |
333 return result !is null ? new NSScroller(result) : null; | |
334 } | |
335 | |
336 } |