35#include <wx/fdrepdlg.h>
42 GetSizer()->SetSizeHints(
this );
50 m_frame->GetFindHistoryList().pop_back();
75 wxString hotkeyHint = wxString::Format( wxT(
" (%s)" ),
KeyNameFromKeyCode( hotkey ) );
90 m_board->RemoveListener(
this );
98 if( !aFindString.IsEmpty() )
126 bool special =
false;
127 std::optional<TOOL_EVENT> evt =
m_frame->GetToolDispatcher()->GetToolEvent( &aEvent, &special );
129 if( evt && evt->IsKeyPressed() && evt->KeyCode() )
132 int hotkey = evt->Modifier() | evt->KeyCode();
136 if( hotkey == action->GetHotKey() || hotkey == action->GetHotKeyAlt() )
175 wxString searchString;
176 bool endIsReached =
false;
177 bool isFirstSearch =
false;
181 if( searchString.IsEmpty() )
190 if(
index == wxNOT_FOUND )
195 m_frame->GetFindHistoryList().Insert( searchString, 0 );
199 m_frame->GetFindHistoryList().pop_back();
203 else if(
index != 0 )
210 if(
m_frame->GetFindHistoryList().Index( searchString ) )
211 m_frame->GetFindHistoryList().Remove( searchString );
213 m_frame->GetFindHistoryList().Insert( searchString, 0 );
239 m_status->SetLabel(
_(
"Searching..." ) );
251 if( !found &&
m_includeValues->GetValue() && fp->Value().Matches( frd,
nullptr ) )
256 for(
BOARD_ITEM* item : fp->GraphicalItems() )
262 if(
text->Matches( frd,
nullptr ) )
273 for(
PCB_FIELD* field : fp->GetFields() )
275 wxCHECK2( field,
continue );
277 if( field->Matches( frd,
nullptr ) )
297 if(
text &&
text->Matches( frd,
nullptr ) )
304 ZONE* zone =
static_cast<ZONE*
>( item );
306 if( zone->
Matches( frd,
nullptr ) )
316 if( marker->Matches( frd,
nullptr ) )
325 if( net && net->Matches( frd,
nullptr ) )
331 isFirstSearch =
true;
344 m_frame->SetStatusText( wxEmptyString );
384 m_frame->SetStatusText( wxEmptyString );
385 msg.Printf(
_(
"'%s' not found" ), searchString );
386 m_frame->ShowInfoBarMsg( msg );
392 m_frame->SetStatusText( wxEmptyString );
393 m_frame->ShowInfoBarMsg(
_(
"No more items to show" ) );
402 msg.Printf(
_(
"'%s' found" ), searchString );
405 msg.Printf(
_(
"Hit(s): %d / %zu" ),
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION findPrevious
static TOOL_ACTION findNext
static TOOL_ACTION showSearch
static TOOL_ACTION selectionClear
Clear the current selection.
VECTOR2I m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
const ZONES & Zones() const
const MARKERS & Markers() const
const FOOTPRINTS & Footprints() const
const DRAWINGS & Drawings() const
wxCheckBox * m_checkAllFields
wxCheckBox * m_includeTexts
wxCheckBox * m_includeValues
wxHyperlinkCtrl * m_searchPanelLink
wxComboBox * m_searchCombo
wxCheckBox * m_includeReferences
wxCheckBox * m_matchWords
wxCheckBox * m_includeNets
wxCheckBox * m_includeMarkers
DIALOG_FIND_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE)
void onTextEnter(wxCommandEvent &event) override
DIALOG_FIND(PCB_EDIT_FRAME *aParent)
bool Show(bool show=true) override
The Show method is overridden to make the search combobox focused by default.
std::deque< BOARD_ITEM * >::iterator m_it
void Preload(const wxString &aFindString)
void onFindNextClick(wxCommandEvent &event) override
void search(bool direction)
void onSearchAgainClick(wxCommandEvent &event) override
BOARD_ITEM * GetItem() const
Return the currently found item or nullptr in the case of no items found.
void onShowSearchPanel(wxHyperlinkEvent &event) override
void onFindPreviousClick(wxCommandEvent &event) override
void OnCharHook(wxKeyEvent &aEvent) override
std::function< void(BOARD_ITEM *)> m_highlightCallback
void FindNext(bool reverse)
Finds the next item.
std::deque< BOARD_ITEM * > m_hitList
void OnBoardChanged(wxCommandEvent &event)
bool Show(bool show) override
void OptOut(wxWindow *aWindow)
Opt out of control state saving.
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
virtual void OnCharHook(wxKeyEvent &aEvt)
A base class for most all the KiCad significant classes used in schematics and boards.
Handle the data for a net.
The main frame for Pcbnew.
Handle a list of polygons defining a copper zone.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
#define PCB_EDIT_FRAME_NAME
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
EDA_SEARCH_MATCH_MODE matchMode
@ PCB_TEXT_T
class PCB_TEXT, text on a layer