Mercurial > projects > dwt-mac
annotate dwt/internal/cocoa/NSOutlineView.d @ 139:86fc761a24ae
Fixes #11
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 04 Jun 2009 23:23:10 +0200 |
parents | d8635bb48c7c |
children |
rev | line source |
---|---|
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
1 /******************************************************************************* |
45 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
7 * |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
8 * Contributors: |
45 | 9 * IBM Corporation - initial API and implementation |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
10 * |
13
f565d3a95c0a
Ported dwt.internal
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
1
diff
changeset
|
11 * Port to the D programming language: |
45 | 12 * Jacob Carlborg <doob@me.com> |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
13 *******************************************************************************/ |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
14 module dwt.internal.cocoa.NSOutlineView; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
15 |
45 | 16 import dwt.dwthelper.utils; |
17 import dwt.internal.c.Carbon; | |
18 import cocoa = dwt.internal.cocoa.id; | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
19 import dwt.internal.cocoa.NSTableColumn; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
20 import dwt.internal.cocoa.NSTableView; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
21 import dwt.internal.cocoa.OS; |
45 | 22 import dwt.internal.objc.cocoa.Cocoa; |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
23 import objc = dwt.internal.objc.runtime; |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
24 |
45 | 25 public class NSOutlineView : NSTableView { |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
26 |
45 | 27 public this() { |
28 super(); | |
29 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
30 |
45 | 31 public this(objc.id id) { |
32 super(id); | |
33 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
34 |
45 | 35 public this(cocoa.id id) { |
36 super(id); | |
37 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
38 |
45 | 39 public void collapseItem(cocoa.id item) { |
40 OS.objc_msgSend(this.id, OS.sel_collapseItem_, item !is null ? item.id : null); | |
41 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
42 |
45 | 43 public void expandItem(cocoa.id item) { |
44 OS.objc_msgSend(this.id, OS.sel_expandItem_, item !is null ? item.id : null); | |
45 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
46 |
45 | 47 public CGFloat indentationPerLevel() { |
48 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_indentationPerLevel); | |
49 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
50 |
45 | 51 public cocoa.id itemAtRow(NSInteger row) { |
52 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemAtRow_, row); | |
53 return result !is null ? new cocoa.id(result) : null; | |
54 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
55 |
45 | 56 public NSInteger levelForItem(cocoa.id item) { |
57 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_levelForItem_, item !is null ? item.id : null); | |
58 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
59 |
45 | 60 public NSTableColumn outlineTableColumn() { |
61 objc.id result = OS.objc_msgSend(this.id, OS.sel_outlineTableColumn); | |
62 return result !is null ? new NSTableColumn(result) : null; | |
63 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
64 |
45 | 65 public void reloadItem(cocoa.id item) { |
66 OS.objc_msgSend(this.id, OS.sel_reloadItem_, item !is null ? item.id : null); | |
67 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
68 |
45 | 69 public void reloadItem(cocoa.id item, bool reloadChildren) { |
70 OS.objc_msgSend(this.id, OS.sel_reloadItem_reloadChildren_, item !is null ? item.id : null, reloadChildren); | |
71 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
72 |
45 | 73 public NSInteger rowForItem(cocoa.id item) { |
74 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_rowForItem_, item !is null ? item.id : null); | |
75 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
76 |
45 | 77 public void setAutoresizesOutlineColumn(bool resize) { |
78 OS.objc_msgSend(this.id, OS.sel_setAutoresizesOutlineColumn_, resize); | |
79 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
80 |
45 | 81 public void setAutosaveExpandedItems(bool save) { |
82 OS.objc_msgSend(this.id, OS.sel_setAutosaveExpandedItems_, save); | |
83 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
84 |
45 | 85 public void setIndentationPerLevel(CGFloat indentationPerLevel) { |
86 OS.objc_msgSend(this.id, OS.sel_setIndentationPerLevel_, indentationPerLevel); | |
87 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
88 |
45 | 89 public void setOutlineTableColumn(NSTableColumn outlineTableColumn) { |
90 OS.objc_msgSend(this.id, OS.sel_setOutlineTableColumn_, outlineTableColumn !is null ? outlineTableColumn.id : null); | |
91 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
92 |
45 | 93 public static objc.Class cellClass() { |
94 return cast(objc.Class) OS.objc_msgSend(OS.class_NSOutlineView, OS.sel_cellClass); | |
95 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
96 |
45 | 97 public static void setCellClass(objc.Class factoryId) { |
98 OS.objc_msgSend(OS.class_NSOutlineView, OS.sel_setCellClass_, factoryId); | |
99 } | |
0
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
100 |
380af2bdd8e5
Upload of whole dwt tree
Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
parents:
diff
changeset
|
101 } |