[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] ChildWindowFromPoint and other questions

Mark Loumbert wrote:
I noticed that you implemented a recursion inside the wxChildWindowFromPoint function to go deep through all childs to find the deepest one - that might not work exactly as the native Win32 fn works. As msdn says: The ChildWindowFromPoint function determines which, if any, of the child windows belonging to a parent window contains the specified point. The search is restricted to immediate child windows, grandchildren, and deeper descendant windows are not searched.

Serves me right for not reading the MSW documentation accurately.
Yes, limiting recursion would be good here. The only issue that
because of the way wxWidgets does things, one might have a different
window depth on wxWidgets than plain MFC. I will add some sort of
an option to control the depth of search (i.e. allow a depth of
1 which is what wxWidgets does).

Furthermore: The return value is a handle to the child window that contains the point, even if the child window is hidden or disabled.

OK, that's different too, because all windows are ignored if hidden.

> If
the point lies outside the parent window, the return value is NULL. If the point is within the parent window but not within any child window, the return value is a handle to the parent window.

I think that bits OK, don't you?

I think we have to run through childs without a recursion, don't you think ? I know these are minor things but still they can alter the intended behaviour.

Yes they are important points. If you can verify this addresses your
concerns, I will fix it. But it will be tomorrow as I have to go eat.