added wxWindow::GetPrev/NextSibling() [backport of r50108 from trunk]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@50111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-11-20 16:12:12 +00:00
parent 20d78b39b2
commit cf22e46119
5 changed files with 88 additions and 10 deletions

View File

@@ -2617,6 +2617,27 @@ bool wxWindowBase::TryParent(wxEvent& event)
return wxEvtHandler::TryParent(event);
}
// ----------------------------------------------------------------------------
// window relationships
// ----------------------------------------------------------------------------
wxWindow *wxWindowBase::DoGetSibling(MoveKind order) const
{
wxCHECK_MSG( GetParent(), NULL,
_T("GetPrev/NextSibling() don't work for TLWs!") );
wxWindowList& siblings = GetParent()->GetChildren();
wxWindowList::compatibility_iterator i = siblings.Find(this);
wxCHECK_MSG( i, NULL, _T("window not a child of its parent?") );
if ( order == MoveBefore )
i = i->GetPrevious();
else // MoveAfter
i = i->GetNext();
return i ? i->GetData() : NULL;
}
// ----------------------------------------------------------------------------
// keyboard navigation
// ----------------------------------------------------------------------------