diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index b7bec2f898..86410c3796 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -58,18 +58,21 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent Center(); } + void DIALOG_FIND::OnInitDialog( wxInitDialogEvent& event ) { m_SearchTextCtrl->SetFocus(); m_SearchTextCtrl->SetSelection( -1, -1 ); } + void DIALOG_FIND::EnableWarp( bool aEnabled ) { m_NoMouseWarpCheckBox->SetValue( !aEnabled ); warpMouse = aEnabled; } + void DIALOG_FIND::onButtonCloseClick( wxCommandEvent& aEvent ) { Close( true ); @@ -81,13 +84,14 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent ) PCB_SCREEN* screen = parent->GetScreen(); wxPoint pos; - foundItem = NULL; wxString searchString = m_SearchTextCtrl->GetValue(); if( !searchString.IsSameAs( prevSearchString, false ) ) { itemCount = 0; + foundItem = NULL; } + prevSearchString = searchString; parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y ); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index a59347e5c1..47c827d206 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1220,7 +1220,6 @@ void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) int SELECTION_TOOL::find( const TOOL_EVENT& aEvent ) { DIALOG_FIND dlg( m_frame ); - dlg.EnableWarp( false ); dlg.SetCallback( std::bind( &SELECTION_TOOL::findCallback, this, _1 ) ); dlg.ShowModal();