From 7377cb541f141de5db755b6b4eb0da89a6646aae Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Mon, 5 Aug 2013 15:47:34 -0500 Subject: [PATCH] formatting and fix selection clarification bug in pcbnew, could not move reference text when hidden under another footprint --- pcbnew/collectors.cpp | 38 ++++++++++++++++----------------- pcbnew/controle.cpp | 11 ++++++++++ pcbnew/hotkeys_board_editor.cpp | 16 +++++++------- 3 files changed, 38 insertions(+), 27 deletions(-) diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index 5970de7ef7..4aee57a556 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -158,14 +158,14 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa switch( item->Type() ) { case PCB_PAD_T: - { - MODULE* m = (MODULE*) item->GetParent(); - - if( m->GetReference() == wxT( "Y2" ) ) { - breakhere++; + MODULE* m = (MODULE*) item->GetParent(); + + if( m->GetReference() == wxT( "Y2" ) ) + { + breakhere++; + } } - } break; case PCB_VIA_T: @@ -193,25 +193,25 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa break; case PCB_MODULE_TEXT_T: - { - TEXTE_MODULE* tm = (TEXTE_MODULE*) item; - - if( tm->GetText() == wxT( "10uH" ) ) { - breakhere++; + TEXTE_MODULE* tm = (TEXTE_MODULE*) item; + + if( tm->GetText() == wxT( "10uH" ) ) + { + breakhere++; + } } - } break; case PCB_MODULE_T: - { - MODULE* m = (MODULE*) item; - - if( m->GetReference() == wxT( "C98" ) ) { - breakhere++; + MODULE* m = (MODULE*) item; + + if( m->GetReference() == wxT( "C98" ) ) + { + breakhere++; + } } - } break; case PCB_MARKER_T: @@ -324,7 +324,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa // Pads are not sensitive to the layer visibility controls. // They all have their own separate visibility controls // skip them if not visible - if ( pad ) + if( pad ) { if( m_Guide->IgnorePads() ) goto exit; diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index 05b6ef9523..d6f8a79583 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -54,8 +54,19 @@ extern bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, */ static BOARD_ITEM* AllAreModulesAndReturnSmallestIfSo( GENERAL_COLLECTOR* aCollector ) { +#if 0 // Dick: this is not consistent with name of this function, and does not + // work correctly using 'M' (move hotkey) when another module's (2nd module) reference + // is under a module (first module) and you want to move the reference. + // Another way to fix this would be to + // treat module text as copper layer content, and put the module text into + // the primary list. I like the coded behavior best. If it breaks something + // perhaps you need a different test before calling this function, which should + // do what its name says it does. int count = aCollector->GetPrimaryCount(); // try to use preferred layer if( 0 == count ) count = aCollector->GetCount(); +#else + int count = aCollector->GetCount(); +#endif for( int i = 0; iType() ) { @@ -788,14 +788,14 @@ bool PCB_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand ) break; case PCB_MODULE_T: - { - if( aIdCommand == HK_MOVE_ITEM ) - evt_type = ID_POPUP_PCB_MOVE_MODULE_REQUEST; + { + if( aIdCommand == HK_MOVE_ITEM ) + evt_type = ID_POPUP_PCB_MOVE_MODULE_REQUEST; - if( aIdCommand == HK_DRAG_ITEM ) - evt_type = ID_POPUP_PCB_DRAG_MODULE_REQUEST; - } - break; + if( aIdCommand == HK_DRAG_ITEM ) + evt_type = ID_POPUP_PCB_DRAG_MODULE_REQUEST; + } + break; case PCB_PAD_T: // Post MODULE_REQUEST events here to prevent pads