pcbnew: Fix crash in find dialog
Tool manager is not exposed to the dialogs, we need to reference it through the parent frame. Fixes: lp:1830942 * https://bugs.launchpad.net/kicad/+bug/1830942
This commit is contained in:
parent
48899a4c96
commit
218bea9ace
|
@ -85,7 +85,8 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
|
||||||
PCB_SCREEN* screen = parent->GetScreen();
|
PCB_SCREEN* screen = parent->GetScreen();
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
|
|
||||||
GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
|
||||||
|
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||||
wxString searchString = m_SearchTextCtrl->GetValue();
|
wxString searchString = m_SearchTextCtrl->GetValue();
|
||||||
|
|
||||||
if( !searchString.IsSameAs( prevSearchString, false ) )
|
if( !searchString.IsSameAs( prevSearchString, false ) )
|
||||||
|
@ -133,7 +134,7 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
|
||||||
|
|
||||||
if( foundItem )
|
if( foundItem )
|
||||||
{
|
{
|
||||||
GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, foundItem );
|
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, foundItem );
|
||||||
parent->FocusOnLocation( pos, !m_NoMouseWarpCheckBox->IsChecked(), true );
|
parent->FocusOnLocation( pos, !m_NoMouseWarpCheckBox->IsChecked(), true );
|
||||||
msg.Printf( _( "\"%s\" found" ), GetChars( searchString ) );
|
msg.Printf( _( "\"%s\" found" ), GetChars( searchString ) );
|
||||||
parent->SetStatusText( msg );
|
parent->SetStatusText( msg );
|
||||||
|
@ -157,7 +158,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
foundItem = NULL;
|
foundItem = NULL;
|
||||||
|
|
||||||
GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||||
parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
|
parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
|
||||||
|
|
||||||
MARKER_PCB* marker = parent->GetBoard()->GetMARKER( markerCount++ );
|
MARKER_PCB* marker = parent->GetBoard()->GetMARKER( markerCount++ );
|
||||||
|
@ -171,7 +172,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
|
||||||
wxString msg;
|
wxString msg;
|
||||||
if( foundItem )
|
if( foundItem )
|
||||||
{
|
{
|
||||||
GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, foundItem );
|
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, foundItem );
|
||||||
parent->FocusOnLocation( pos, !m_NoMouseWarpCheckBox->IsChecked() );
|
parent->FocusOnLocation( pos, !m_NoMouseWarpCheckBox->IsChecked() );
|
||||||
msg = _( "Marker found" );
|
msg = _( "Marker found" );
|
||||||
parent->SetStatusText( msg );
|
parent->SetStatusText( msg );
|
||||||
|
|
Loading…
Reference in New Issue