Move crosshairs to found item; remove find highlighting when find dialog closed.

Fixes: lp:1837069
* https://bugs.launchpad.net/kicad/+bug/1837069
This commit is contained in:
Jeff Young 2019-07-19 18:40:26 -06:00
parent 02eb1d2c62
commit 0821f1ac11
6 changed files with 13 additions and 2 deletions

View File

@ -101,6 +101,13 @@ void DIALOG_SCH_FIND::OnClose( wxCloseEvent& aEvent )
}
void DIALOG_SCH_FIND::OnCancel( wxCommandEvent& aEvent )
{
wxCloseEvent dummy;
OnClose( dummy );
}
void DIALOG_SCH_FIND::OnUpdateReplaceUI( wxUpdateUIEvent& aEvent )
{
aEvent.Enable( HasFlag( wxFR_REPLACEDIALOG ) && !m_comboFind->GetValue().empty() &&

View File

@ -134,6 +134,7 @@ class DIALOG_SCH_FIND : public DIALOG_SCH_FIND_BASE
protected:
// Handlers for DIALOG_SCH_FIND_BASE events.
void OnClose( wxCloseEvent& aEvent ) override;
void OnCancel( wxCommandEvent& aEvent ) override;
void OnSearchForText( wxCommandEvent& aEvent ) override;
void OnTextEnter( wxCommandEvent& event ) override;
void OnOptions( wxCommandEvent& event ) override;

View File

@ -160,6 +160,7 @@ DIALOG_SCH_FIND_BASE::DIALOG_SCH_FIND_BASE( wxWindow* parent, wxWindowID id, con
m_buttonReplace->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SCH_FIND_BASE::OnUpdateReplaceUI ), NULL, this );
m_buttonReplaceAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_FIND_BASE::OnReplace ), NULL, this );
m_buttonReplaceAll->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SCH_FIND_BASE::OnUpdateReplaceAllUI ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_FIND_BASE::OnCancel ), NULL, this );
}
DIALOG_SCH_FIND_BASE::~DIALOG_SCH_FIND_BASE()
@ -182,5 +183,6 @@ DIALOG_SCH_FIND_BASE::~DIALOG_SCH_FIND_BASE()
m_buttonReplace->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SCH_FIND_BASE::OnUpdateReplaceUI ), NULL, this );
m_buttonReplaceAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_FIND_BASE::OnReplace ), NULL, this );
m_buttonReplaceAll->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_SCH_FIND_BASE::OnUpdateReplaceAllUI ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCH_FIND_BASE::OnCancel ), NULL, this );
}

View File

@ -1742,7 +1742,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnButtonClick">OnCancel</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>

View File

@ -66,6 +66,7 @@ class DIALOG_SCH_FIND_BASE : public DIALOG_SHIM
virtual void OnReplace( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUpdateReplaceUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnUpdateReplaceAllUI( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
public:

View File

@ -290,7 +290,7 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
if( item )
{
m_selectionTool->AddItemToSel( item );
getView()->SetCenter( item->GetBoundingBox().GetCenter() );
m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter(), true );
m_frame->GetCanvas()->Refresh();
}
else