- if (!node)
- {
-/*
- if (GetParent() != NULL)
- {
- wxNavigationKeyEvent new_event;
- new_event.SetDirection( event.GetDirection() );
- new_event.SetWindowChange(FALSE);
- new_event.SetCurrentFocus( this );
-
- if (GetParent()->GetEventHandler()->ProcessEvent(new_event))
- {
- return;
- }
- }
-*/
-
- node = event.GetDirection() ? m_children.First() : m_children.Last();
- }
-
- wxWindow *child = (wxWindow*) node->Data();
-
- if (child->AcceptsFocus())
- {
- child->SetFocus();
- return;
- }
-
- node = node->Next();
+ if (!node)
+ {
+ node = event.GetDirection() ? GetChildren().First()
+ : GetChildren().Last();
+
+ continue;
+ }
+
+ wxWindow *child = (wxWindow *)node->Data();
+
+ if (child->AcceptsFocus())
+ {
+ // ok, event processed
+ child->SetFocus();
+ return;
+ }
+
+ node = event.GetDirection() ? node->Next() : node->Previous();