Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSForm.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.NSForm; | |
15 | |
16 import dwt.internal.cocoa.CGFloat; | |
17 import dwt.internal.cocoa.id; | |
18 import dwt.internal.cocoa.NSFont; | |
19 import dwt.internal.cocoa.NSFormCell; | |
20 import dwt.internal.cocoa.NSInteger; | |
21 import dwt.internal.cocoa.NSMatrix; | |
22 import dwt.internal.cocoa.NSSize; | |
23 import dwt.internal.cocoa.NSString; | |
24 import dwt.internal.cocoa.NSText : NSTextAlignment, NSWritingDirection; | |
25 import dwt.internal.cocoa.OS; | |
26 import objc = dwt.internal.objc.runtime; | |
27 | |
28 public class NSForm : NSMatrix | |
29 { | |
30 | |
31 public this () | |
32 { | |
33 super(); | |
34 } | |
35 | |
36 public this (objc.id id) | |
37 { | |
38 super(id); | |
39 } | |
40 | |
41 public NSFormCell addEntry (NSString title) | |
42 { | |
43 objc.id result = OS.objc_msgSend(this.id, OS.sel_addEntry_1, title !is null ? title.id : null); | |
44 return result !is null ? new NSFormCell(result) : null; | |
45 } | |
46 | |
47 public id cellAtIndex (NSInteger index) | |
48 { | |
49 objc.id result = OS.objc_msgSend(this.id, OS.sel_cellAtIndex_1, index); | |
50 return result !is null ? new id(result) : null; | |
51 } | |
52 | |
53 public void drawCellAtIndex (NSInteger index) | |
54 { | |
55 OS.objc_msgSend(this.id, OS.sel_drawCellAtIndex_1, index); | |
56 } | |
57 | |
58 public NSInteger indexOfCellWithTag (NSInteger aTag) | |
59 { | |
60 return OS.objc_msgSend(this.id, OS.sel_indexOfCellWithTag_1, aTag); | |
61 } | |
62 | |
63 public NSInteger indexOfSelectedItem () | |
64 { | |
65 return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem); | |
66 } | |
67 | |
68 public NSFormCell insertEntry (NSString title, int index) | |
69 { | |
70 objc.id result = OS.objc_msgSend(this.id, OS.sel_insertEntry_1atIndex_1, title !is null ? title.id : null, index); | |
71 return result !is null ? new NSFormCell(result) : null; | |
72 } | |
73 | |
74 public void removeEntryAtIndex (NSInteger index) | |
75 { | |
76 OS.objc_msgSend(this.id, OS.sel_removeEntryAtIndex_1, index); | |
77 } | |
78 | |
79 public void selectTextAtIndex (NSInteger index) | |
80 { | |
81 OS.objc_msgSend(this.id, OS.sel_selectTextAtIndex_1, index); | |
82 } | |
83 | |
84 public void setBezeled (bool flag) | |
85 { | |
86 OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag); | |
87 } | |
88 | |
89 public void setBordered (bool flag) | |
90 { | |
91 OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag); | |
92 } | |
93 | |
94 public void setEntryWidth (CGFloat width) | |
95 { | |
96 OS.objc_msgSend(this.id, OS.sel_setEntryWidth_1, width); | |
97 } | |
98 | |
99 public void setFrameSize (NSSize newSize) | |
100 { | |
101 OS.objc_msgSend(this.id, OS.sel_setFrameSize_1, newSize); | |
102 } | |
103 | |
104 public void setInterlineSpacing (CGFloat spacing) | |
105 { | |
106 OS.objc_msgSend(this.id, OS.sel_setInterlineSpacing_1, spacing); | |
107 } | |
108 | |
109 public void setTextAlignment (NSInteger mode) | |
110 { | |
111 OS.objc_msgSend(this.id, OS.sel_setTextAlignment_1, mode); | |
112 } | |
113 | |
114 public void setTextBaseWritingDirection (NSWritingDirection writingDirection) | |
115 { | |
116 OS.objc_msgSend(this.id, OS.sel_setTextBaseWritingDirection_1, writingDirection); | |
117 } | |
118 | |
119 public void setTextFont (NSFont fontObj) | |
120 { | |
121 OS.objc_msgSend(this.id, OS.sel_setTextFont_1, fontObj !is null ? fontObj.id : null); | |
122 } | |
123 | |
124 public void setTitleAlignment (NSTextAlignment mode) | |
125 { | |
126 OS.objc_msgSend(this.id, OS.sel_setTitleAlignment_1, mode); | |
127 } | |
128 | |
129 public void setTitleBaseWritingDirection (NSWritingDirection writingDirection) | |
130 { | |
131 OS.objc_msgSend(this.id, OS.sel_setTitleBaseWritingDirection_1, writingDirection); | |
132 } | |
133 | |
134 public void setTitleFont (NSFont fontObj) | |
135 { | |
136 OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj !is null ? fontObj.id : null); | |
137 } | |
138 | |
139 } |