Correctly filter copyable objects for copy hotkey (Fixes lp:1571316)

This commit is contained in:
Jon Evans 2017-02-11 13:29:22 -05:00 committed by Wayne Stambaugh
parent 19fef1e9ba
commit 92a2b2b684
3 changed files with 16 additions and 1 deletions

View File

@ -575,7 +575,7 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
if( aItem == NULL ) if( aItem == NULL )
{ {
aItem = LocateAndShowItem( aPosition, SCH_COLLECTOR::MovableItems ); aItem = LocateAndShowItem( aPosition, SCH_COLLECTOR::CopyableItems );
if( aItem == NULL ) if( aItem == NULL )
break; break;

View File

@ -199,6 +199,16 @@ const KICAD_T SCH_COLLECTOR::OrientableItems[] = {
}; };
const KICAD_T SCH_COLLECTOR::CopyableItems[] = {
SCH_TEXT_T,
SCH_LABEL_T,
SCH_GLOBAL_LABEL_T,
SCH_HIERARCHICAL_LABEL_T,
SCH_COMPONENT_T,
EOT
};
SEARCH_RESULT SCH_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) SEARCH_RESULT SCH_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
{ {
if( aItem->Type() != LIB_PIN_T && !aItem->HitTest( m_RefPos ) ) if( aItem->Type() != LIB_PIN_T && !aItem->HitTest( m_RefPos ) )

View File

@ -112,6 +112,11 @@ public:
*/ */
static const KICAD_T OrientableItems[]; static const KICAD_T OrientableItems[];
/**
* A scan list for schematic items that can be copied/duplicated.
*/
static const KICAD_T CopyableItems[];
/** /**
* Constructor SCH_COLLECTOR * Constructor SCH_COLLECTOR
*/ */