fix drag-and-drop window traversal to handle menus and other unrealized windows

svn: r16365
This commit is contained in:
Matthew Flatt 2009-10-19 14:01:34 +00:00
parent 35f0f15722
commit a71b5697ad

View File

@ -2513,11 +2513,13 @@ wxWindow *wxWindow::FindChildByWidget(Widget w)
wxChildNode *node, *next; wxChildNode *node, *next;
wxWindow *r; wxWindow *r;
if (X) {
if ((w == X->frame) if ((w == X->frame)
|| (w == X->handle)) || (w == X->handle))
return this; return this;
}
if (children) {
for (node = children->First(); node; node = next) { for (node = children->First(); node; node = next) {
wxWindow *child; wxWindow *child;
next = node->Next(); next = node->Next();
@ -2528,6 +2530,7 @@ wxWindow *wxWindow::FindChildByWidget(Widget w)
return r; return r;
} }
} }
}
return NULL; return NULL;
} }