From 01c9f09833ff6d8d5b84dd5b14e1c5f15993d694 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 18 May 2015 13:48:13 +0200 Subject: [PATCH] wxWidgets under OS X require wxMenuItem ids to be >0. --- pcbnew/tools/selection_tool.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index bea16d8906..a450bafc12 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -726,7 +726,7 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) wxString text; BOARD_ITEM* item = ( *aCollector )[i]; text = item->GetSelectMenuText(); - menu.Add( text, i ); + menu.Add( text, i + 1 ); } menu.SetTitle( _( "Clarify selection" ) ); @@ -742,9 +742,9 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) int id = *evt->GetCommandId(); // User has pointed an item, so show it in a different way - if( id >= 0 && id < limit ) + if( id > 0 && id <= limit ) { - current = ( *aCollector )[id]; + current = ( *aCollector )[id - 1]; current->SetBrightened(); } else @@ -757,8 +757,8 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector ) boost::optional id = evt->GetCommandId(); // User has selected an item, so this one will be returned - if( id && ( *id >= 0 ) ) - current = ( *aCollector )[*id]; + if( id && ( *id > 0 ) ) + current = ( *aCollector )[*id - 1]; break; }