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:
@@ -1053,6 +1053,29 @@ void wxFrame::OnActivate(
|
|||||||
wxActivateEvent& rEvent
|
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();
|
for (wxWindowList::Node* pNode = GetChildren().GetFirst();
|
||||||
pNode;
|
pNode;
|
||||||
pNode = pNode->GetNext())
|
pNode = pNode->GetNext())
|
||||||
@@ -1076,6 +1099,7 @@ void wxFrame::OnActivate(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} // end of wxFrame::OnActivate
|
} // end of wxFrame::OnActivate
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user