From 6d1417bafa012a035df9ed064a4f56552d563d6c Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 13:50:27 +0200 Subject: [PATCH] SELECTION_TOOL in edit module mode does not try to select MODULEs. --- pcbnew/collectors.cpp | 11 ++++++++++- pcbnew/collectors.h | 8 +++++++- pcbnew/controle.cpp | 4 ++-- pcbnew/tools/selection_tool.cpp | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index a2e1d845f8..cb99353899 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -86,7 +86,7 @@ const KICAD_T GENERAL_COLLECTOR::AllButZones[] = { }; -const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = { +const KICAD_T GENERAL_COLLECTOR::Modules[] = { PCB_MODULE_T, EOT }; @@ -118,12 +118,21 @@ const KICAD_T GENERAL_COLLECTOR::ModulesAndTheirItems[] = { }; +const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = { + PCB_MODULE_TEXT_T, + PCB_MODULE_EDGE_T, + PCB_PAD_T, + EOT +}; + + const KICAD_T GENERAL_COLLECTOR::Tracks[] = { PCB_TRACE_T, PCB_VIA_T, EOT }; + const KICAD_T GENERAL_COLLECTOR::Zones[] = { PCB_ZONE_AREA_T, EOT diff --git a/pcbnew/collectors.h b/pcbnew/collectors.h index 267ec20034..4d2520c06d 100644 --- a/pcbnew/collectors.h +++ b/pcbnew/collectors.h @@ -262,7 +262,7 @@ public: /** * A scan list for only MODULEs */ - static const KICAD_T ModuleItems[]; + static const KICAD_T Modules[]; /** @@ -282,6 +282,12 @@ public: static const KICAD_T ModulesAndTheirItems[]; + /** + * A scan list for primary module items. + */ + static const KICAD_T ModuleItems[]; + + /** * A scan list for only TRACKS */ diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index c5f1d00f9f..911a473dda 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -119,7 +119,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) else if( GetToolId() == ID_NO_TOOL_SELECTED ) { if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) ) - scanList = GENERAL_COLLECTOR::ModuleItems; + scanList = GENERAL_COLLECTOR::Modules; else scanList = (DisplayOpt.DisplayZonesMode == 0) ? GENERAL_COLLECTOR::AllBoardItems : @@ -138,7 +138,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) break; case ID_PCB_MODULE_BUTT: - scanList = GENERAL_COLLECTOR::ModuleItems; + scanList = GENERAL_COLLECTOR::Modules; break; case ID_PCB_ZONES_BUTT: diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index ef6d9d0446..ac9f1aa51c 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -234,7 +234,7 @@ bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambigua const KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, PCB_LINE_T, EOT }; // preferred types if( m_editModules ) - collector.Collect( getModel(), GENERAL_COLLECTOR::ModulesAndTheirItems, + collector.Collect( getModel(), GENERAL_COLLECTOR::ModuleItems, wxPoint( aWhere.x, aWhere.y ), guide ); else collector.Collect( getModel(), GENERAL_COLLECTOR::AllBoardItems,