Show more than 9 items in disambiguation menu.

(But only the first 9 get hotkeys.)

Fixes https://gitlab.com/kicad/code/kicad/issues/11966
This commit is contained in:
Jeff Young 2022-07-10 20:10:43 -06:00
parent b759d860c0
commit 4685dc49cc
1 changed files with 16 additions and 4 deletions

View File

@ -1674,16 +1674,28 @@ bool EE_SELECTION_TOOL::doSelectionMenu( EE_COLLECTOR* aCollector )
expandSelection = false;
int limit = std::min( 9, aCollector->GetCount() );
int limit = std::min( 100, aCollector->GetCount() );
ACTION_MENU menu( true );
for( int i = 0; i < limit; ++i )
{
wxString text;
EDA_ITEM* item = ( *aCollector )[i];
text = item->GetSelectMenuText( m_frame->GetUserUnits() );
wxString text = item->GetSelectMenuText( m_frame->GetUserUnits() );
wxString menuText;
if( i < 9 )
{
#ifdef __WXMAC__
menuText = wxString::Format( "%s\t%d", text, i + 1 );
#else
menuText = wxString::Format( "&%d %s\t%d", i + 1, text, i + 1 );
#endif
}
else
{
menuText = text;
}
wxString menuText = wxString::Format( "&%d. %s\t%d", i + 1, text, i + 1 );
menu.Add( menuText, i + 1, item->GetMenuImage() );
}