OnActivate change for wxFrame to better deal with prior window focus and textctrl is no coded.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-04-16 14:22:41 +00:00
parent 4a45223c97
commit c4955899eb
2 changed files with 547 additions and 308 deletions

View File

@@ -1053,6 +1053,29 @@ void wxFrame::OnActivate(
wxActivateEvent& rEvent
)
{
if ( rEvent.GetActive() )
{
// restore focus to the child which was last focused
wxLogTrace(_T("focus"), _T("wxFrame %08x activated."), m_hWnd);
wxWindow* pParent = m_pWinLastFocused ? m_pWinLastFocused->GetParent()
: NULL;
if (!pParent)
{
pParent = this;
}
wxSetFocusToChild( pParent
,&m_pWinLastFocused
);
}
else // deactivating
{
//
// Remember the last focused child if it is our child
//
m_pWinLastFocused = FindFocus();
for (wxWindowList::Node* pNode = GetChildren().GetFirst();
pNode;
pNode = pNode->GetNext())
@@ -1076,6 +1099,7 @@ void wxFrame::OnActivate(
return;
}
}
}
} // end of wxFrame::OnActivate
// ----------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff