From 79b6991d7b16c4ccb880145e9b756af88fa29e7f 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) --- 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 134c439d84..b138827a20 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -97,8 +97,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; } @@ -106,8 +106,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 d9591bb3dd..631d72f29d 100644 --- a/include/id.h +++ b/include/id.h @@ -216,7 +216,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 };