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
This commit is contained in:
RigoLigoRLC 2021-01-07 02:53:55 +08:00 committed by Jeff Young
parent 1eee72ec65
commit dd328d230b
2 changed files with 14 additions and 0 deletions

View File

@ -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 );
}
}
}
}

View File

@ -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