From 548936bb2286618d99595a4f38b77f20738d3faa Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 2 Mar 2022 16:32:04 -0800 Subject: [PATCH] Fix broken unit select context menu The fix for https://gitlab.com/kicad/code/kicad/issues/10529 kicked the subsequent IDs for unit selection off the maximum ID value for popup menus. This increases the maximum popup number (integers are free) (cherry picked from commit 79b6991d7b16c4ccb880145e9b756af88fa29e7f) --- eeschema/tools/sch_edit_tool.cpp | 8 ++++---- include/id.h | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 6e9260415d..4b51c8f20a 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -98,8 +98,8 @@ private: if( !symbol ) { - Append( ID_POPUP_SCH_UNFOLD_BUS, _( "no symbol selected" ), wxEmptyString ); - Enable( ID_POPUP_SCH_UNFOLD_BUS, false ); + Append( ID_POPUP_SCH_SELECT_UNIT_CMP, _( "no symbol selected" ), wxEmptyString ); + Enable( ID_POPUP_SCH_SELECT_UNIT_CMP, false ); return; } @@ -107,8 +107,8 @@ private: if( !symbol->GetLibSymbolRef() || symbol->GetLibSymbolRef()->GetUnitCount() < 2 ) { - Append( ID_POPUP_SCH_UNFOLD_BUS, _( "symbol is not multi-unit" ), wxEmptyString ); - Enable( ID_POPUP_SCH_UNFOLD_BUS, false ); + Append( ID_POPUP_SCH_SELECT_UNIT_CMP, _( "symbol is not multi-unit" ), wxEmptyString ); + Enable( ID_POPUP_SCH_SELECT_UNIT_CMP, false ); return; } diff --git a/include/id.h b/include/id.h index 3630a8b0ff..33ae14463f 100644 --- a/include/id.h +++ b/include/id.h @@ -217,7 +217,9 @@ enum main_id // Reseve ID for popup menus, when we need to know a menu item is inside a popup menu ID_POPUP_MENU_START, - ID_POPUP_MENU_END = ID_POPUP_MENU_START + 1000, + // The extra here need to minimum be larger than MAX_BUS_UNFOLD_MENU_ITEMS + MAX_UNIT_COUNT_PER_PACKAGE + // These values are stored in eeschema_id.h + ID_POPUP_MENU_END = ID_POPUP_MENU_START + 2048, ID_END_LIST };