Update msg panel on create/modify graphic items

This clears the msg panel when not editing an item and updates the
position information when moving
This commit is contained in:
Seth Hillbrand 2018-04-12 09:33:18 -07:00
parent 0f3fc4b6eb
commit 1663627135
3 changed files with 18 additions and 7 deletions

View File

@ -454,7 +454,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
}
}
frame()->SetMsgPanel( nullptr );
frame()->SetMsgPanel( board() );
frame()->SetNoToolSelected();
return 0;
@ -631,7 +631,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
delete dimension;
m_view->Remove( &preview );
frame()->SetMsgPanel( nullptr );
frame()->SetMsgPanel( board() );
m_frame->SetNoToolSelected();
return 0;
@ -1072,7 +1072,11 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
m_view->Update( &preview );
if( started )
frame()->SetMsgPanel( aGraphic );
else
frame()->SetMsgPanel( board() );
}
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
{
@ -1100,7 +1104,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
m_frame->GetScreen()->m_O_Curseur = wxPoint( 0, 0 );
m_view->Remove( &preview );
frame()->SetMsgPanel( nullptr );
frame()->SetMsgPanel( board() );
m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false );
@ -1202,6 +1206,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic )
m_lineWidth += WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
m_view->Update( &preview );
frame()->SetMsgPanel( aGraphic );
}
else if( evt->IsAction( &PCB_ACTIONS::decWidth ) && m_lineWidth > WIDTH_STEP )
{
@ -1224,14 +1229,18 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic )
updateArcFromConstructionMgr( arcManager, *aGraphic );
m_view->Update( &preview );
m_view->Update( &arcAsst );
if(firstPoint)
frame()->SetMsgPanel( aGraphic );
else
frame()->SetMsgPanel( board() );
}
}
preview.Remove( aGraphic );
m_view->Remove( &arcAsst );
m_view->Remove( &preview );
frame()->SetMsgPanel( nullptr );
frame()->SetMsgPanel( board() );
m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false );

View File

@ -438,6 +438,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
{
static_cast<BOARD_ITEM*>( item )->Move( movement );
}
frame()->UpdateMsgPanel();
}
else if( !m_dragging ) // Prepare to start dragging
{

View File

@ -391,7 +391,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
m_editPoints.reset();
}
frame()->SetMsgPanel( nullptr );
frame()->SetMsgPanel( board() );
return 0;
}