keyboard/focus handling improved a bit more:
1. wxFrame doesn't give focus to anything at all on activation 2. last control restored more often (some problems still persist) 3. buttons process enter 4. text controls with wxTE_PROCESS_TAB still leave TAB work as dialog navigation key if the event wasn't processed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,7 +42,7 @@ END_EVENT_TABLE()
|
||||
|
||||
void wxPanel::Init()
|
||||
{
|
||||
m_lastFocus = 0;
|
||||
m_winLastFocused = (wxWindow *)NULL;
|
||||
m_btnDefault = (wxButton *)NULL;
|
||||
}
|
||||
|
||||
@@ -144,11 +144,13 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event )
|
||||
|
||||
void wxPanel::OnFocus(wxFocusEvent& event)
|
||||
{
|
||||
if (m_lastFocus != 0)
|
||||
if ( m_winLastFocused )
|
||||
{
|
||||
wxWindow* child = FindWindow(m_lastFocus);
|
||||
if (child)
|
||||
child->SetFocus();
|
||||
// it might happen that the window got reparented...
|
||||
if ( m_winLastFocused->GetParent() != this )
|
||||
m_winLastFocused = (wxWindow *)NULL;
|
||||
else
|
||||
m_winLastFocused->SetFocus();
|
||||
}
|
||||
else
|
||||
event.Skip();
|
||||
|
||||
Reference in New Issue
Block a user