|
Jochen,
> is there a way to intercept mouse clicks on a view or any of its
> subview without hooking event handlers into all of these?
>
> For now I hooked into all of the subPresenters
> EachSubpresenter>>when: #leftButtonPressed send:
> subviewLeftButtonPressed to: self.
Not really. This is because of the way Windows performs the
distribution of mouse clicks. Basically, hit testing is performed
"bottom-up" with the sub-views being looked at first which means that
there is no easy way to override a mouse click just in the parent view.
One thing you could look into (depending on whether the views in
question by your own classes or not) would be to override #wmNcHitTest:
wParam:lParam: in the sub-views and have the method answer
HTTRANSPARENT. This would then make the sub-views appear invisible when
Windows performs its hit-testing and it would then pass the mouse
clicks up the view parent chain. You can see an example of this in
TextEdit>>wmNcHitTest: wParam:lParam:.
Best regards,
--
Andy Bower
Dolphin Support
www.object-arts.com
|