Fix wxFindWindowAtPoint() with nested windows in wxMSW.
Return the deepest child of the window and not the first one as this function needs to return the window that is at the top of Z-order. Closes #14591. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -177,6 +177,18 @@ void MiscGUIFuncsTestCase::FindWindowAtPoint()
|
||||
wxFindWindowAtPoint(parent->ClientToScreen(wxPoint(11, 91)))
|
||||
);
|
||||
|
||||
btn2->Show();
|
||||
wxWindow* btn3 = new wxButton(btn2, wxID_ANY, "3", wxPoint(0, 0));
|
||||
btn3->Disable();
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE
|
||||
(
|
||||
"Point over recursive disabled child controls corresponds to deepest child",
|
||||
btn3,
|
||||
wxFindWindowAtPoint(parent->ClientToScreen(wxPoint(11, 91)))
|
||||
);
|
||||
wxASSERT(wxFindWindowAtPoint(parent->ClientToScreen(wxPoint(11, 91))) == btn3);
|
||||
|
||||
wxDELETE(btn1);
|
||||
wxDELETE(btn3); // delete child before parent
|
||||
wxDELETE(btn2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user