comparison dwt/internal/cocoa/NSSplitView.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.NSSplitView;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSColor;
19 import dwt.internal.cocoa.NSInteger;
20 import dwt.internal.cocoa.NSRect;
21 import dwt.internal.cocoa.NSString;
22 import dwt.internal.cocoa.NSView;
23 import dwt.internal.cocoa.OS;
24 import objc = dwt.internal.objc.runtime;
25
26
27
28 enum NSSplitViewDividerStyle : NSInteger
29 {
30 NSSplitViewDividerStyleThick = 1,
31 NSSplitViewDividerStyleThin
32 }
33
34 alias NSSplitViewDividerStyle.NSSplitViewDividerStyleThick NSSplitViewDividerStyleThick;
35 alias NSSplitViewDividerStyle.NSSplitViewDividerStyleThin NSSplitViewDividerStyleThin;
36
37
38
39 public class NSSplitView : NSView
40 {
41
42 public this ()
43 {
44 super();
45 }
46
47 public this (objc.id id)
48 {
49 super(id);
50 }
51
52 public void adjustSubviews ()
53 {
54 OS.objc_msgSend(this.id, OS.sel_adjustSubviews);
55 }
56
57 public NSString autosaveName ()
58 {
59 objc.id result = OS.objc_msgSend(this.id, OS.sel_autosaveName);
60 return result !is null ? new NSString(result) : null;
61 }
62
63 public id delegatee ()
64 {
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
66 return result !is null ? new id(result) : null;
67 }
68
69 public NSColor dividerColor ()
70 {
71 objc.id result = OS.objc_msgSend(this.id, OS.sel_dividerColor);
72 return result !is null ? new NSColor(result) : null;
73 }
74
75 public NSSplitViewDividerStyle dividerStyle ()
76 {
77 return cast(NSSplitViewDividerStyle) OS.objc_msgSend(this.id, OS.sel_dividerStyle);
78 }
79
80 public CGFloat dividerThickness ()
81 {
82 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_dividerThickness);
83 }
84
85 public void drawDividerInRect (NSRect rect)
86 {
87 OS.objc_msgSend(this.id, OS.sel_drawDividerInRect_1, rect);
88 }
89
90 public bool isPaneSplitter ()
91 {
92 return OS.objc_msgSend(this.id, OS.sel_isPaneSplitter) !is null;
93 }
94
95 public bool isSubviewCollapsed (NSView subview)
96 {
97 return OS.objc_msgSend(this.id, OS.sel_isSubviewCollapsed_1, subview !is null ? subview.id : null) !is null;
98 }
99
100 public bool isVertical ()
101 {
102 return OS.objc_msgSend(this.id, OS.sel_isVertical) !is null;
103 }
104
105 public CGFloat maxPossiblePositionOfDividerAtIndex (NSInteger dividerIndex)
106 {
107 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_maxPossiblePositionOfDividerAtIndex_1, dividerIndex);
108 }
109
110 public CGFloat minPossiblePositionOfDividerAtIndex (NSInteger dividerIndex)
111 {
112 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_minPossiblePositionOfDividerAtIndex_1, dividerIndex);
113 }
114
115 public void setAutosaveName (NSString autosaveName)
116 {
117 OS.objc_msgSend(this.id, OS.sel_setAutosaveName_1, autosaveName !is null ? autosaveName.id : null);
118 }
119
120 public void setDelegate (id delegatee)
121 {
122 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
123 }
124
125 public void setDividerStyle (NSSplitViewDividerStyle dividerStyle)
126 {
127 OS.objc_msgSend(this.id, OS.sel_setDividerStyle_1, dividerStyle);
128 }
129
130 public void setIsPaneSplitter (bool flag)
131 {
132 OS.objc_msgSend(this.id, OS.sel_setIsPaneSplitter_1, flag);
133 }
134
135 public void setPosition (CGFloat position, NSInteger dividerIndex)
136 {
137 OS.objc_msgSend(this.id, OS.sel_setPosition_1ofDividerAtIndex_1, position, dividerIndex);
138 }
139
140 public void setVertical (bool flag)
141 {
142 OS.objc_msgSend(this.id, OS.sel_setVertical_1, flag);
143 }
144
145 }