Add SetFocusIgnoringChildren() to wxControlContainer. This

makes corresponding hacks in wxListCtrl and wxTreeCtrl
    obsolete. With docs.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2004-12-11 12:51:05 +00:00
parent d61f720033
commit ababa106ae
5 changed files with 41 additions and 24 deletions

View File

@@ -606,8 +606,6 @@ public:
void Freeze();
void Thaw();
void SetFocus();
void OnRenameTimer();
bool OnRenameAccept(size_t itemEdit, const wxString& value);
void OnRenameCancelled(size_t itemEdit);
@@ -2047,7 +2045,7 @@ void wxListTextCtrl::Finish()
m_finished = true;
m_owner->SetFocus();
m_owner->SetFocusIgnoringChildren();
}
}
@@ -3299,26 +3297,6 @@ void wxListMainWindow::OnChar( wxKeyEvent &event )
// focus handling
// ----------------------------------------------------------------------------
void wxListMainWindow::SetFocus()
{
// VS: wxListMainWindow derives from wxPanel (via wxScrolledWindow) and wxPanel
// overrides SetFocus in such way that it does never change focus from
// panel's child to the panel itself. Unfortunately, we must be able to change
// focus to the panel from wxListTextCtrl because the text control should
// disappear when the user clicks outside it.
wxWindow *oldFocus = DoFindFocus();
if ( oldFocus && oldFocus->GetParent() == this )
{
wxWindow::SetFocus();
}
else
{
wxScrolledWindow::SetFocus();
}
}
void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
{
if ( GetParent() )