135 |
} |
} |
136 |
|
|
137 |
/** |
/** |
138 |
* forward invocation. It tries to call a method (onClick for example) |
* this private method look at all the widgets in the container and |
139 |
* to each object the container has. |
* try to call a method which corresponds to an event (such as |
140 |
* If it no object responds, it do nothing. |
* leftMouseUp). |
|
* If the object responds, it can do nothing if it is a click on an |
|
|
* invalid area. |
|
141 |
*/ |
*/ |
142 |
- (void) forwardInvocation: (NSInvocation*)objectInvoke |
- (void) _widgetInvocation: (NSInvocation*)objectInvoke |
143 |
{ |
{ |
144 |
NSEnumerator *enumerator = [_widgets objectEnumerator]; |
NSEnumerator *enumerator = [_widgets objectEnumerator]; |
|
NSEvent *event; |
|
145 |
UiWidget *widget; |
UiWidget *widget; |
146 |
|
NSEvent *event; |
147 |
int leftBorder, rightBorder, topBorder, bottomBorder, x, y; |
int leftBorder, rightBorder, topBorder, bottomBorder, x, y; |
148 |
SEL sel; |
SEL sel; |
149 |
|
|
154 |
|
|
155 |
/* FIXME - seul le widget le plus en avant recoit l'evenement */ |
/* FIXME - seul le widget le plus en avant recoit l'evenement */ |
156 |
|
|
157 |
|
/* phase descendante */ |
158 |
while ( (widget = [enumerator nextObject]) ) |
while ( (widget = [enumerator nextObject]) ) |
159 |
{ |
{ |
160 |
leftBorder = [self x] + [widget x]; |
leftBorder = [self x] + [widget x]; |
179 |
} |
} |
180 |
} |
} |
181 |
|
|
182 |
|
|
183 |
|
/** |
184 |
|
* This method look if the controller (the delegate) can responds to |
185 |
|
* the action method, and then the invocation call the action method |
186 |
|
* on the delegate. |
187 |
|
*/ |
188 |
|
- (void) _actionInvocation: (NSInvocation*)objectInvoke |
189 |
|
{ |
190 |
|
if ([_delegate respondsToSelector: [objectInvoke selector]]) |
191 |
|
return [objectInvoke invokeWithTarget: _delegate]; |
192 |
|
else |
193 |
|
return [self doesNotRecognizeSelector: [objectInvoke selector]]; |
194 |
|
} |
195 |
|
|
196 |
|
/** |
197 |
|
* forward invocation. It tries to call a method (onClick for example) |
198 |
|
* to each object the container has. |
199 |
|
* If it no object responds, it do nothing. |
200 |
|
* If the object responds, it can do nothing if it is a click on an |
201 |
|
* invalid area. |
202 |
|
*/ |
203 |
|
- (void) forwardInvocation: (NSInvocation*)objectInvoke |
204 |
|
{ |
205 |
|
if ( sel_eq ([objectInvoke selector], @selector (actionImplemented)) ) |
206 |
|
[self _actionInvocation: objectInvoke]; |
207 |
|
else |
208 |
|
[self _widgetInvocation: objectInvoke]; |
209 |
|
} |
210 |
|
|
211 |
@end |
@end |