Browse Source

Make Pcbnew search about zone names, fixes #6951

I put zones in "other text items" category of searching as I thought it
would be the appropriate one.

Fixes https://gitlab.com/kicad/code/kicad/issues/6951
6.0.7
RigoLigoRLC 5 years ago
committed by Jeff Young
parent
commit
dd328d230b
  1. 9
      pcbnew/dialogs/dialog_find.cpp
  2. 5
      pcbnew/zone.h

9
pcbnew/dialogs/dialog_find.cpp

@ -257,6 +257,15 @@ void DIALOG_FIND::search( bool aDirection )
m_hitList.push_back( textItem );
}
}
for( BOARD_ITEM* item : m_frame->GetBoard()->Zones() )
{
ZONE* zoneItem = dynamic_cast<ZONE*>( item );
if( zoneItem && zoneItem->Matches( m_frame->GetFindReplaceData(), nullptr ) )
{
m_hitList.push_back( zoneItem );
}
}
}
}

5
pcbnew/zone.h

@ -131,6 +131,11 @@ public:
wxString GetZoneName() const { return m_zoneName; }
void SetZoneName( const wxString& aName ) { m_zoneName = aName; }
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData ) override
{
return BOARD_ITEM::Matches( GetZoneName(), aSearchData );
}
/**
* Function GetBoundingBox (virtual)
* @return an EDA_RECT that is the bounding box of the zone outline

Loading…
Cancel
Save