Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSSegmentedCell.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
36 alias NSBackgroundStyle.NSBackgroundStyleLight NSBackgroundStyleLight; | 36 alias NSBackgroundStyle.NSBackgroundStyleLight NSBackgroundStyleLight; |
37 alias NSBackgroundStyle.NSBackgroundStyleDark NSBackgroundStyleDark; | 37 alias NSBackgroundStyle.NSBackgroundStyleDark NSBackgroundStyleDark; |
38 alias NSBackgroundStyle.NSBackgroundStyleRaised NSBackgroundStyleRaised; | 38 alias NSBackgroundStyle.NSBackgroundStyleRaised NSBackgroundStyleRaised; |
39 alias NSBackgroundStyle.NSBackgroundStyleLowered NSBackgroundStyleLowered; | 39 alias NSBackgroundStyle.NSBackgroundStyleLowered NSBackgroundStyleLowered; |
40 | 40 |
41 enum NSSegmentSwitchTracking | 41 enum NSSegmentSwitchTracking : NSUInteger |
42 { | 42 { |
43 NSSegmentSwitchTrackingSelectOne = 0, | 43 NSSegmentSwitchTrackingSelectOne = 0, |
44 NSSegmentSwitchTrackingSelectAny = 1, | 44 NSSegmentSwitchTrackingSelectAny = 1, |
45 NSSegmentSwitchTrackingMomentary = 2 | 45 NSSegmentSwitchTrackingMomentary = 2 |
46 } | 46 } |
62 super(id); | 62 super(id); |
63 } | 63 } |
64 | 64 |
65 public void drawSegment (NSInteger segment, NSRect frame, NSView controlView) | 65 public void drawSegment (NSInteger segment, NSRect frame, NSView controlView) |
66 { | 66 { |
67 OS.objc_msgSend(this.id, OS.sel_drawSegment_1inFrame_1withView_1, segment, frame, controlView !is null ? controlView.id : null); | 67 OS.objc_msgSend(this.id_, OS.sel_drawSegment_1inFrame_1withView_1, segment, frame, controlView !is null ? controlView.id_ : null); |
68 } | 68 } |
69 | 69 |
70 public NSImage imageForSegment (NSInteger segment) | 70 public NSImage imageForSegment (NSInteger segment) |
71 { | 71 { |
72 objc.id result = OS.objc_msgSend(this.id, OS.sel_imageForSegment_1, segment); | 72 objc.id result = OS.objc_msgSend(this.id_, OS.sel_imageForSegment_1, segment); |
73 return result !is null ? new NSImage(result) : null; | 73 return result !is null ? new NSImage(result) : null; |
74 } | 74 } |
75 | 75 |
76 public NSImageScaling imageScalingForSegment (NSInteger segment) | 76 public NSImageScaling imageScalingForSegment (NSInteger segment) |
77 { | 77 { |
78 return OS.objc_msgSend(this.id, OS.sel_imageScalingForSegment_1, segment); | 78 return cast(NSImageScaling) OS.objc_msgSend(this.id_, OS.sel_imageScalingForSegment_1, segment); |
79 } | 79 } |
80 | 80 |
81 public NSBackgroundStyle interiorBackgroundStyleForSegment (NSInteger segment) | 81 public NSBackgroundStyle interiorBackgroundStyleForSegment (NSInteger segment) |
82 { | 82 { |
83 return OS.objc_msgSend(this.id, OS.sel_interiorBackgroundStyleForSegment_1, segment); | 83 return cast(NSBackgroundStyle) OS.objc_msgSend(this.id_, OS.sel_interiorBackgroundStyleForSegment_1, segment); |
84 } | 84 } |
85 | 85 |
86 public bool isEnabledForSegment (NSInteger segment) | 86 public bool isEnabledForSegment (NSInteger segment) |
87 { | 87 { |
88 return OS.objc_msgSend(this.id, OS.sel_isEnabledForSegment_1, segment) !is null; | 88 return OS.objc_msgSend(this.id_, OS.sel_isEnabledForSegment_1, segment) !is null; |
89 } | 89 } |
90 | 90 |
91 public bool isSelectedForSegment (NSInteger segment) | 91 public bool isSelectedForSegment (NSInteger segment) |
92 { | 92 { |
93 return OS.objc_msgSend(this.id, OS.sel_isSelectedForSegment_1, segment) !is null; | 93 return OS.objc_msgSend(this.id_, OS.sel_isSelectedForSegment_1, segment) !is null; |
94 } | 94 } |
95 | 95 |
96 public NSString labelForSegment (NSInteger segment) | 96 public NSString labelForSegment (NSInteger segment) |
97 { | 97 { |
98 objc.id result = OS.objc_msgSend(this.id, OS.sel_labelForSegment_1, segment); | 98 objc.id result = OS.objc_msgSend(this.id_, OS.sel_labelForSegment_1, segment); |
99 return result !is null ? new NSString(result) : null; | 99 return result !is null ? new NSString(result) : null; |
100 } | 100 } |
101 | 101 |
102 public void makeNextSegmentKey () | 102 public void makeNextSegmentKey () |
103 { | 103 { |
104 OS.objc_msgSend(this.id, OS.sel_makeNextSegmentKey); | 104 OS.objc_msgSend(this.id_, OS.sel_makeNextSegmentKey); |
105 } | 105 } |
106 | 106 |
107 public void makePreviousSegmentKey () | 107 public void makePreviousSegmentKey () |
108 { | 108 { |
109 OS.objc_msgSend(this.id, OS.sel_makePreviousSegmentKey); | 109 OS.objc_msgSend(this.id_, OS.sel_makePreviousSegmentKey); |
110 } | 110 } |
111 | 111 |
112 public NSMenu menuForSegment (NSInteger segment) | 112 public NSMenu menuForSegment (NSInteger segment) |
113 { | 113 { |
114 objc.id result = OS.objc_msgSend(this.id, OS.sel_menuForSegment_1, segment); | 114 objc.id result = OS.objc_msgSend(this.id_, OS.sel_menuForSegment_1, segment); |
115 return result !is null ? new NSMenu(result) : null; | 115 return result !is null ? new NSMenu(result) : null; |
116 } | 116 } |
117 | 117 |
118 public NSInteger segmentCount () | 118 public NSInteger segmentCount () |
119 { | 119 { |
120 return OS.objc_msgSend(this.id, OS.sel_segmentCount); | 120 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_segmentCount); |
121 } | 121 } |
122 | 122 |
123 public NSInteger segmentStyle () | 123 public NSInteger segmentStyle () |
124 { | 124 { |
125 return OS.objc_msgSend(this.id, OS.sel_segmentStyle); | 125 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_segmentStyle); |
126 } | 126 } |
127 | 127 |
128 public bool selectSegmentWithTag (NSInteger tag) | 128 public bool selectSegmentWithTag (NSInteger tag) |
129 { | 129 { |
130 return OS.objc_msgSend(this.id, OS.sel_selectSegmentWithTag_1, tag) !is null; | 130 return OS.objc_msgSend(this.id_, OS.sel_selectSegmentWithTag_1, tag) !is null; |
131 } | 131 } |
132 | 132 |
133 public NSInteger selectedSegment () | 133 public NSInteger selectedSegment () |
134 { | 134 { |
135 return OS.objc_msgSend(this.id, OS.sel_selectedSegment); | 135 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedSegment); |
136 } | 136 } |
137 | 137 |
138 public void setEnabled (bool enabled, NSInteger segment) | 138 public void setEnabled (bool enabled, NSInteger segment) |
139 { | 139 { |
140 OS.objc_msgSend(this.id, OS.sel_setEnabled_1forSegment_1, enabled, segment); | 140 OS.objc_msgSend(this.id_, OS.sel_setEnabled_1forSegment_1, enabled, segment); |
141 } | 141 } |
142 | 142 |
143 public void setImage (NSImage image, NSInteger segment) | 143 public void setImage (NSImage image, NSInteger segment) |
144 { | 144 { |
145 OS.objc_msgSend(this.id, OS.sel_setImage_1forSegment_1, image !is null ? image.id : null, segment); | 145 OS.objc_msgSend(this.id_, OS.sel_setImage_1forSegment_1, image !is null ? image.id_ : null, segment); |
146 } | 146 } |
147 | 147 |
148 public void setImageScaling (NSImageScaling scaling, NSInteger segment) | 148 public void setImageScaling (NSImageScaling scaling, NSInteger segment) |
149 { | 149 { |
150 OS.objc_msgSend(this.id, OS.sel_setImageScaling_1forSegment_1, scaling, segment); | 150 OS.objc_msgSend(this.id_, OS.sel_setImageScaling_1forSegment_1, scaling, segment); |
151 } | 151 } |
152 | 152 |
153 public void setLabel (NSString label, NSInteger segment) | 153 public void setLabel (NSString label, NSInteger segment) |
154 { | 154 { |
155 OS.objc_msgSend(this.id, OS.sel_setLabel_1forSegment_1, label !is null ? label.id : null, segment); | 155 OS.objc_msgSend(this.id_, OS.sel_setLabel_1forSegment_1, label !is null ? label.id_ : null, segment); |
156 } | 156 } |
157 | 157 |
158 public void setMenu (NSMenu menu, NSInteger segment) | 158 public void setMenu (NSMenu menu, NSInteger segment) |
159 { | 159 { |
160 OS.objc_msgSend(this.id, OS.sel_setMenu_1forSegment_1, menu !is null ? menu.id : null, segment); | 160 OS.objc_msgSend(this.id_, OS.sel_setMenu_1forSegment_1, menu !is null ? menu.id_ : null, segment); |
161 } | 161 } |
162 | 162 |
163 public void setSegmentCount (NSInteger count) | 163 public void setSegmentCount (NSInteger count) |
164 { | 164 { |
165 OS.objc_msgSend(this.id, OS.sel_setSegmentCount_1, count); | 165 OS.objc_msgSend(this.id_, OS.sel_setSegmentCount_1, count); |
166 } | 166 } |
167 | 167 |
168 public void setSegmentStyle (NSInteger segmentStyle) | 168 public void setSegmentStyle (NSInteger segmentStyle) |
169 { | 169 { |
170 OS.objc_msgSend(this.id, OS.sel_setSegmentStyle_1, segmentStyle); | 170 OS.objc_msgSend(this.id_, OS.sel_setSegmentStyle_1, segmentStyle); |
171 } | 171 } |
172 | 172 |
173 public void setSelected (bool selected, NSInteger segment) | 173 public void setSelected (bool selected, NSInteger segment) |
174 { | 174 { |
175 OS.objc_msgSend(this.id, OS.sel_setSelected_1forSegment_1, selected, segment); | 175 OS.objc_msgSend(this.id_, OS.sel_setSelected_1forSegment_1, selected, segment); |
176 } | 176 } |
177 | 177 |
178 public void setSelectedSegment (NSInteger selectedSegment) | 178 public void setSelectedSegment (NSInteger selectedSegment) |
179 { | 179 { |
180 OS.objc_msgSend(this.id, OS.sel_setSelectedSegment_1, selectedSegment); | 180 OS.objc_msgSend(this.id_, OS.sel_setSelectedSegment_1, selectedSegment); |
181 } | 181 } |
182 | 182 |
183 public void setTag (NSInteger tag, NSInteger segment) | 183 public void setTag (NSInteger tag, NSInteger segment) |
184 { | 184 { |
185 OS.objc_msgSend(this.id, OS.sel_setTag_1forSegment_1, tag, segment); | 185 OS.objc_msgSend(this.id_, OS.sel_setTag_1forSegment_1, tag, segment); |
186 } | 186 } |
187 | 187 |
188 public void setToolTip (NSString toolTip, NSInteger segment) | 188 public void setToolTip (NSString toolTip, NSInteger segment) |
189 { | 189 { |
190 OS.objc_msgSend(this.id, OS.sel_setToolTip_1forSegment_1, toolTip !is null ? toolTip.id : null, segment); | 190 OS.objc_msgSend(this.id_, OS.sel_setToolTip_1forSegment_1, toolTip !is null ? toolTip.id_ : null, segment); |
191 } | 191 } |
192 | 192 |
193 public void setTrackingMode (NSSegmentSwitchTracking trackingMode) | 193 public void setTrackingMode (NSSegmentSwitchTracking trackingMode) |
194 { | 194 { |
195 OS.objc_msgSend(this.id, OS.sel_setTrackingMode_1, trackingMode); | 195 OS.objc_msgSend(this.id_, OS.sel_setTrackingMode_1, trackingMode); |
196 } | 196 } |
197 | 197 |
198 public void setWidth (CGFloat width, NSInteger segment) | 198 public void setWidth (CGFloat width, NSInteger segment) |
199 { | 199 { |
200 OS.objc_msgSend(this.id, OS.sel_setWidth_1forSegment_1, width, segment); | 200 OS.objc_msgSend(this.id_, OS.sel_setWidth_1forSegment_1, width, segment); |
201 } | 201 } |
202 | 202 |
203 public NSInteger tagForSegment (NSInteger segment) | 203 public NSInteger tagForSegment (NSInteger segment) |
204 { | 204 { |
205 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_tagForSegment_1, segment); | 205 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_tagForSegment_1, segment); |
206 } | 206 } |
207 | 207 |
208 public NSString toolTipForSegment (NSInteger segment) | 208 public NSString toolTipForSegment (NSInteger segment) |
209 { | 209 { |
210 objc.id result = OS.objc_msgSend(this.id, OS.sel_toolTipForSegment_1, segment); | 210 objc.id result = OS.objc_msgSend(this.id_, OS.sel_toolTipForSegment_1, segment); |
211 return result !is null ? new NSString(result) : null; | 211 return result !is null ? new NSString(result) : null; |
212 } | 212 } |
213 | 213 |
214 public NSSegmentSwitchTracking trackingMode () | 214 public NSSegmentSwitchTracking trackingMode () |
215 { | 215 { |
216 return cast(NSSegmentSwitchTracking) OS.objc_msgSend(this.id, OS.sel_trackingMode); | 216 return cast(NSSegmentSwitchTracking) OS.objc_msgSend(this.id_, OS.sel_trackingMode); |
217 } | 217 } |
218 | 218 |
219 public CGFloat widthForSegment (NSInteger segment) | 219 public CGFloat widthForSegment (NSInteger segment) |
220 { | 220 { |
221 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_widthForSegment_1, segment); | 221 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_widthForSegment_1, segment); |
222 } | 222 } |
223 | 223 |
224 } | 224 } |