Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSScroller.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 |
---|---|
18 import dwt.internal.cocoa.NSControl; | 18 import dwt.internal.cocoa.NSControl; |
19 import dwt.internal.cocoa.NSEvent; | 19 import dwt.internal.cocoa.NSEvent; |
20 import dwt.internal.cocoa.NSPoint; | 20 import dwt.internal.cocoa.NSPoint; |
21 import dwt.internal.cocoa.NSRect; | 21 import dwt.internal.cocoa.NSRect; |
22 import dwt.internal.cocoa.OS; | 22 import dwt.internal.cocoa.OS; |
23 import dwt.internal.objc.runtime; | 23 import objc = dwt.internal.objc.runtime; |
24 | 24 |
25 | 25 |
26 | 26 |
27 enum NSScrollArrowPosition | 27 enum NSScrollArrowPosition |
28 { | 28 { |
95 super(id); | 95 super(id); |
96 } | 96 } |
97 | 97 |
98 public NSScrollArrowPosition arrowsPosition () | 98 public NSScrollArrowPosition arrowsPosition () |
99 { | 99 { |
100 return cast(NSScrollArrowPosition) OS.objc_msgSend(this.id, OS.sel_arrowsPosition); | 100 return cast(NSScrollArrowPosition) OS.objc_msgSend(this.id_, OS.sel_arrowsPosition); |
101 } | 101 } |
102 | 102 |
103 public void checkSpaceForParts () | 103 public void checkSpaceForParts () |
104 { | 104 { |
105 OS.objc_msgSend(this.id, OS.sel_checkSpaceForParts); | 105 OS.objc_msgSend(this.id_, OS.sel_checkSpaceForParts); |
106 } | 106 } |
107 | 107 |
108 public NSControlSize controlSize () | 108 public NSControlSize controlSize () |
109 { | 109 { |
110 return cast(NSControlSize) OS.objc_msgSend(this.id, OS.sel_controlSize); | 110 return cast(NSControlSize) OS.objc_msgSend(this.id_, OS.sel_controlSize); |
111 } | 111 } |
112 | 112 |
113 public NSControlTint controlTint () | 113 public NSControlTint controlTint () |
114 { | 114 { |
115 return cast(NSControlTint) OS.objc_msgSend(this.id, OS.sel_controlTint); | 115 return cast(NSControlTint) OS.objc_msgSend(this.id_, OS.sel_controlTint); |
116 } | 116 } |
117 | 117 |
118 public void drawArrow (NSScrollerArrow whichArrow, bool flag) | 118 public void drawArrow (NSScrollerArrow whichArrow, bool flag) |
119 { | 119 { |
120 OS.objc_msgSend(this.id, OS.sel_drawArrow_1highlight_1, whichArrow, flag); | 120 OS.objc_msgSend(this.id_, OS.sel_drawArrow_1highlight_1, whichArrow, flag); |
121 } | 121 } |
122 | 122 |
123 public void drawKnob () | 123 public void drawKnob () |
124 { | 124 { |
125 OS.objc_msgSend(this.id, OS.sel_drawKnob); | 125 OS.objc_msgSend(this.id_, OS.sel_drawKnob); |
126 } | 126 } |
127 | 127 |
128 public void drawKnobSlotInRect (NSRect slotRect, bool flag) | 128 public void drawKnobSlotInRect (NSRect slotRect, bool flag) |
129 { | 129 { |
130 OS.objc_msgSend(this.id, OS.sel_drawKnobSlotInRect_1highlight_1, slotRect, flag); | 130 OS.objc_msgSend(this.id_, OS.sel_drawKnobSlotInRect_1highlight_1, slotRect, flag); |
131 } | 131 } |
132 | 132 |
133 public void drawParts () | 133 public void drawParts () |
134 { | 134 { |
135 OS.objc_msgSend(this.id, OS.sel_drawParts); | 135 OS.objc_msgSend(this.id_, OS.sel_drawParts); |
136 } | 136 } |
137 | 137 |
138 public void highlight (bool flag) | 138 public void highlight (bool flag) |
139 { | 139 { |
140 OS.objc_msgSend(this.id, OS.sel_highlight_1, flag); | 140 OS.objc_msgSend(this.id_, OS.sel_highlight_1, flag); |
141 } | 141 } |
142 | 142 |
143 public NSScrollerPart hitPart () | 143 public NSScrollerPart hitPart () |
144 { | 144 { |
145 return OS.objc_msgSend(this.id, OS.sel_hitPart); | 145 return cast(NSScrollerPart) OS.objc_msgSend(this.id_, OS.sel_hitPart); |
146 } | 146 } |
147 | 147 |
148 public CGFloat knobProportion () | 148 public CGFloat knobProportion () |
149 { | 149 { |
150 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_knobProportion); | 150 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_knobProportion); |
151 } | 151 } |
152 | 152 |
153 public NSRect rectForPart (NSScrollerPart partCode) | 153 public NSRect rectForPart (NSScrollerPart partCode) |
154 { | 154 { |
155 NSRect result; | 155 NSRect result; |
156 OS.objc_msgSend_stret(result, this.id, OS.sel_rectForPart_1, partCode); | 156 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectForPart_1, partCode); |
157 return result; | 157 return result; |
158 } | 158 } |
159 | 159 |
160 public static CGFloat scrollerWidth () | 160 public static CGFloat scrollerWidth () |
161 { | 161 { |
167 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSScroller, OS.sel_scrollerWidthForControlSize_1, controlSize); | 167 return cast(CGFloat) OS.objc_msgSend_fpret(OS.class_NSScroller, OS.sel_scrollerWidthForControlSize_1, controlSize); |
168 } | 168 } |
169 | 169 |
170 public void setArrowsPosition (NSScrollArrowPosition where) | 170 public void setArrowsPosition (NSScrollArrowPosition where) |
171 { | 171 { |
172 OS.objc_msgSend(this.id, OS.sel_setArrowsPosition_1, where); | 172 OS.objc_msgSend(this.id_, OS.sel_setArrowsPosition_1, where); |
173 } | 173 } |
174 | 174 |
175 public void setControlSize (NSControlSize controlSize) | 175 public void setControlSize (NSControlSize controlSize) |
176 { | 176 { |
177 OS.objc_msgSend(this.id, OS.sel_setControlSize_1, controlSize); | 177 OS.objc_msgSend(this.id_, OS.sel_setControlSize_1, controlSize); |
178 } | 178 } |
179 | 179 |
180 public void setControlTint (NSControlTint controlTint) | 180 public void setControlTint (NSControlTint controlTint) |
181 { | 181 { |
182 OS.objc_msgSend(this.id, OS.sel_setControlTint_1, controlTint); | 182 OS.objc_msgSend(this.id_, OS.sel_setControlTint_1, controlTint); |
183 } | 183 } |
184 | 184 |
185 public void setFloatValue (float aFloat, CGFloat proportion) | 185 public void setFloatValue (float aFloat, CGFloat proportion) |
186 { | 186 { |
187 OS.objc_msgSend(this.id, OS.sel_setFloatValue_1knobProportion_1, aFloat, proportion); | 187 OS.objc_msgSend(this.id_, OS.sel_setFloatValue_1knobProportion_1, aFloat, proportion); |
188 } | 188 } |
189 | 189 |
190 public void setKnobProportion (CGFloat proportion) | 190 public void setKnobProportion (CGFloat proportion) |
191 { | 191 { |
192 OS.objc_msgSend(this.id, OS.sel_setKnobProportion_1, proportion); | 192 OS.objc_msgSend(this.id_, OS.sel_setKnobProportion_1, proportion); |
193 } | 193 } |
194 | 194 |
195 public NSScrollerPart testPart (NSPoint thePoint) | 195 public NSScrollerPart testPart (NSPoint thePoint) |
196 { | 196 { |
197 return cast(NSScrollerPart) OS.objc_msgSend(this.id, OS.sel_testPart_1, thePoint); | 197 return cast(NSScrollerPart) OS.objc_msgSend(this.id_, OS.sel_testPart_1, thePoint); |
198 } | 198 } |
199 | 199 |
200 public void trackKnob (NSEvent theEvent) | 200 public void trackKnob (NSEvent theEvent) |
201 { | 201 { |
202 OS.objc_msgSend(this.id, OS.sel_trackKnob_1, theEvent !is null ? theEvent.id : null); | 202 OS.objc_msgSend(this.id_, OS.sel_trackKnob_1, theEvent !is null ? theEvent.id_ : null); |
203 } | 203 } |
204 | 204 |
205 public void trackScrollButtons (NSEvent theEvent) | 205 public void trackScrollButtons (NSEvent theEvent) |
206 { | 206 { |
207 OS.objc_msgSend(this.id, OS.sel_trackScrollButtons_1, theEvent !is null ? theEvent.id : null); | 207 OS.objc_msgSend(this.id_, OS.sel_trackScrollButtons_1, theEvent !is null ? theEvent.id_ : null); |
208 } | 208 } |
209 | 209 |
210 public NSUsableScrollerParts usableParts () | 210 public NSUsableScrollerParts usableParts () |
211 { | 211 { |
212 return cast(NSUsableScrollerParts) OS.objc_msgSend(this.id, OS.sel_usableParts); | 212 return cast(NSUsableScrollerParts) OS.objc_msgSend(this.id_, OS.sel_usableParts); |
213 } | 213 } |
214 | 214 |
215 } | 215 } |