added and documented wxWindow::MoveBefore/AfterInTabOrder()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-07-01 11:44:37 +00:00
parent eeb9e3d08f
commit a24de76b33
4 changed files with 72 additions and 4 deletions

View File

@@ -2408,7 +2408,7 @@ bool wxWindowBase::TryParent(wxEvent& event)
}
// ----------------------------------------------------------------------------
// navigation
// keyboard navigation
// ----------------------------------------------------------------------------
// Navigates in the specified direction.
@@ -2424,6 +2424,30 @@ bool wxWindowBase::Navigate(int flags)
return false;
}
void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)
{
// check that we're not a top level window
wxCHECK_RET( GetParent(),
_T("MoveBefore/AfterInTabOrder() don't work for TLWs!") );
// find the target window in the siblings list
wxWindowList& siblings = GetParent()->GetChildren();
wxWindowList::compatibility_iterator i = siblings.Find(win);
wxCHECK_RET( i, _T("MoveBefore/AfterInTabOrder(): win is not a sibling") );
// unfortunately, when wxUSE_STL == 1 DetachNode() is not implemented so we
// can't just move the node around
siblings.DeleteObject(this);
if ( move == MoveBefore || ((i = i->GetNext()) != NULL) )
{
siblings.Insert(i, this);
}
else // MoveAfter and win was the last sibling
{
siblings.Append(this);
}
}
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------