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:
parent
02eb1d2c62
commit
0821f1ac11
|
@ -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() &&
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue