Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTableHeaderView.d @ 45:d8635bb48c7c
Merge with SWT 3.5
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 01 Dec 2008 17:07:00 +0100 |
parents | f565d3a95c0a |
children | 62202ce0039f |
comparison
equal
deleted
inserted
replaced
44:ca5e494f2bbf | 45:d8635bb48c7c |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2007 IBM Corporation and others. | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | 3 * All rights reserved. This program and the accompanying materials |
4 * are made available under the terms of the Eclipse Public License v1.0 | 4 * are made available under the terms of the Eclipse Public License v1.0 |
5 * which accompanies this distribution, and is available at | 5 * which accompanies this distribution, and is available at |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * | 10 * |
11 * Port to the D programming language: | 11 * Port to the D programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <doob@me.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSTableHeaderView; | 14 module dwt.internal.cocoa.NSTableHeaderView; |
15 | 15 |
16 import dwt.internal.cocoa.CGFloat; | 16 import dwt.dwthelper.utils; |
17 import dwt.internal.cocoa.NSInteger; | 17 import cocoa = dwt.internal.cocoa.id; |
18 import dwt.internal.cocoa.NSPoint; | 18 import dwt.internal.cocoa.NSPoint; |
19 import dwt.internal.cocoa.NSRect; | 19 import dwt.internal.cocoa.NSRect; |
20 import dwt.internal.cocoa.NSTableView; | |
21 import dwt.internal.cocoa.NSView; | 20 import dwt.internal.cocoa.NSView; |
22 import dwt.internal.cocoa.OS; | 21 import dwt.internal.cocoa.OS; |
22 import dwt.internal.objc.cocoa.Cocoa; | |
23 import objc = dwt.internal.objc.runtime; | 23 import objc = dwt.internal.objc.runtime; |
24 | 24 |
25 public class NSTableHeaderView : NSView | 25 public class NSTableHeaderView : NSView { |
26 { | |
27 | 26 |
28 public this () | 27 public this() { |
29 { | 28 super(); |
30 super(); | 29 } |
31 } | |
32 | 30 |
33 public this (objc.id id) | 31 public this(objc.id id) { |
34 { | 32 super(id); |
35 super(id); | 33 } |
36 } | |
37 | 34 |
38 public NSInteger columnAtPoint (NSPoint point) | 35 public this(cocoa.id id) { |
39 { | 36 super(id); |
40 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_columnAtPoint_1, point); | 37 } |
41 } | |
42 | 38 |
43 public NSInteger draggedColumn () | 39 public NSInteger columnAtPoint(NSPoint point) { |
44 { | 40 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_columnAtPoint_, point); |
45 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_draggedColumn); | 41 } |
46 } | |
47 | 42 |
48 public CGFloat draggedDistance () | 43 public NSRect headerRectOfColumn(NSInteger column) { |
49 { | 44 NSRect result = NSRect(); |
50 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_draggedDistance); | 45 OS.objc_msgSend_stret(result, this.id, OS.sel_headerRectOfColumn_, column); |
51 } | 46 return result; |
52 | 47 } |
53 public NSRect headerRectOfColumn (NSInteger column) | |
54 { | |
55 NSRect result; | |
56 OS.objc_msgSend_stret(&result, this.id_, OS.sel_headerRectOfColumn_1, column); | |
57 return result; | |
58 } | |
59 | |
60 public NSInteger resizedColumn () | |
61 { | |
62 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_resizedColumn); | |
63 } | |
64 | |
65 public void setTableView (NSTableView tableView) | |
66 { | |
67 OS.objc_msgSend(this.id_, OS.sel_setTableView_1, tableView !is null ? tableView.id_ : null); | |
68 } | |
69 | |
70 public NSTableView tableView () | |
71 { | |
72 objc.id result = OS.objc_msgSend(this.id_, OS.sel_tableView); | |
73 return result !is null ? new NSTableView(result) : null; | |
74 } | |
75 | 48 |
76 } | 49 } |