Fix hotkey editing on OSX.

Focus was on the dialog instead of the panel.  The dialog doesn't
have the IsUserPanel flag set and so wxEVT_CHAR processing doesn't
happen.  (Why?  I haven't a clue.)

Also fixed some more performance issues with the auto-column-widths.

Fixes https://gitlab.com/kicad/code/kicad/issues/6591
This commit is contained in:
Jeff Young 2020-12-11 01:53:15 +00:00
parent fc57860caf
commit 645c49427c
1 changed files with 18 additions and 5 deletions

View File

@ -132,6 +132,7 @@ public:
// specials like Tab and Return, are received, particularly on MSW.
panel->Bind( wxEVT_CHAR, &HK_PROMPT_DIALOG::OnChar, this );
panel->Bind( wxEVT_CHAR_HOOK, &HK_PROMPT_DIALOG::OnCharHook, this );
SetInitialFocus( panel );
}
/**
@ -482,8 +483,14 @@ void WIDGET_HOTKEY_LIST::ResetAllHotkeys( bool aResetToDefault )
UpdateFromClientData();
GetDataView()->GetColumn( 0 )->SetWidth( wxCOL_WIDTH_AUTOSIZE );
GetDataView()->GetColumn( 1 )->SetWidth( wxCOL_WIDTH_AUTOSIZE );
wxDataViewColumn* col = GetDataView()->GetColumn( 0 );
col->SetWidth( wxCOL_WIDTH_AUTOSIZE );
col->SetWidth( col->GetWidth() );
col = GetDataView()->GetColumn( 1 );
col->SetWidth( wxCOL_WIDTH_AUTOSIZE );
col->SetWidth( col->GetWidth() );
Thaw();
}
@ -491,6 +498,15 @@ void WIDGET_HOTKEY_LIST::ResetAllHotkeys( bool aResetToDefault )
bool WIDGET_HOTKEY_LIST::TransferDataToControl()
{
updateShownItems( "" );
wxDataViewColumn* col = GetDataView()->GetColumn( 0 );
col->SetWidth( wxCOL_WIDTH_AUTOSIZE );
col->SetWidth( col->GetWidth() );
col = GetDataView()->GetColumn( 1 );
col->SetWidth( wxCOL_WIDTH_AUTOSIZE );
col->SetWidth( col->GetWidth() );
return true;
}
@ -520,9 +536,6 @@ void WIDGET_HOTKEY_LIST::updateShownItems( const wxString& aFilterStr )
}
UpdateFromClientData();
GetDataView()->GetColumn( 0 )->SetWidth( wxCOL_WIDTH_AUTOSIZE );
GetDataView()->GetColumn( 1 )->SetWidth( wxCOL_WIDTH_AUTOSIZE );
Thaw();
}