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,19 +2513,22 @@ wxWindow *wxWindow::FindChildByWidget(Widget w)
wxChildNode *node, *next;
wxWindow *r;
if ((w == X->frame)
|| (w == X->handle))
return this;
if (X) {
if ((w == X->frame)
|| (w == X->handle))
return this;
}
for (node = children->First(); node; node = next) {
wxWindow *child;
next = node->Next();
child = (wxWindow*)(node->Data());
if (child) {
r = child->FindChildByWidget(w);
if (r)
return r;
if (children) {
for (node = children->First(); node; node = next) {
wxWindow *child;
next = node->Next();
child = (wxWindow*)(node->Data());
if (child) {
r = child->FindChildByWidget(w);
if (r)
return r;
}
}
}