Minor fix in fp editor and fp viewer: display the fp info instead of the useless board info.
board info makes sense only in board editor, not in fp editor and fp viewer.
This commit is contained in:
parent
2bab30d9ac
commit
6e5131be5a
|
@ -956,6 +956,7 @@ void C3D_RENDER_OGL_LEGACY::load_3D_models( REPORTER *aStatusTextReporter )
|
|||
}
|
||||
|
||||
// Check if the model is not present in our cache map
|
||||
// (Not already loaded in memory)
|
||||
if( m_3dmodel_map.find( sM->m_Filename ) == m_3dmodel_map.end() )
|
||||
{
|
||||
// It is not present, try get it from cache
|
||||
|
|
|
@ -392,10 +392,10 @@ bool SHAPE_LINE_CHAIN::PointOnEdge( const VECTOR2I& aP ) const
|
|||
|
||||
bool SHAPE_LINE_CHAIN::CheckClearance( const VECTOR2I& aP, const int aDist) const
|
||||
{
|
||||
if( !PointCount() )
|
||||
return false;
|
||||
if( !PointCount() )
|
||||
return false;
|
||||
|
||||
else if( PointCount() == 1 )
|
||||
else if( PointCount() == 1 )
|
||||
return m_points[0] == aP;
|
||||
|
||||
for( int i = 0; i < SegmentCount(); i++ )
|
||||
|
|
|
@ -979,3 +979,23 @@ int FOOTPRINT_EDIT_FRAME::GetIconScale()
|
|||
}
|
||||
|
||||
|
||||
void FOOTPRINT_EDIT_FRAME::UpdateMsgPanel()
|
||||
{
|
||||
// If a item is currently selected, displays the item info.
|
||||
// If nothing selected, display the current footprint info
|
||||
BOARD_ITEM* item = GetScreen()->GetCurItem();
|
||||
|
||||
if( !item )
|
||||
item = GetBoard()->m_Modules;
|
||||
|
||||
MSG_PANEL_ITEMS items;
|
||||
|
||||
if( item )
|
||||
{
|
||||
item->GetMsgPanelInfo( items );
|
||||
SetMsgPanel( items );
|
||||
}
|
||||
else
|
||||
ClearMsgPanel();
|
||||
}
|
||||
|
||||
|
|
|
@ -479,6 +479,15 @@ public:
|
|||
|
||||
int GetIconScale() override;
|
||||
|
||||
/**
|
||||
* redraws the message panel.
|
||||
* If a item is currently selected, displays the item info.
|
||||
* If nothing selected, display the current footprint info, or
|
||||
* clear the message panel if nothing is edited
|
||||
*/
|
||||
void UpdateMsgPanel() override;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
|
|
|
@ -885,14 +885,25 @@ void FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
|||
m_canvas->DrawBackGround( DC );
|
||||
GetBoard()->Draw( m_canvas, DC, GR_COPY );
|
||||
|
||||
MODULE* module = GetBoard()->m_Modules;
|
||||
|
||||
m_canvas->DrawCrossHair( DC );
|
||||
|
||||
ClearMsgPanel();
|
||||
UpdateMsgPanel();
|
||||
}
|
||||
|
||||
if( module )
|
||||
SetMsgPanel( module );
|
||||
|
||||
void FOOTPRINT_VIEWER_FRAME::UpdateMsgPanel()
|
||||
{
|
||||
BOARD_ITEM* footprint = GetBoard()->m_Modules;
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
MSG_PANEL_ITEMS items;
|
||||
|
||||
footprint->GetMsgPanelInfo( items );
|
||||
SetMsgPanel( items );
|
||||
}
|
||||
else
|
||||
ClearMsgPanel();
|
||||
}
|
||||
|
||||
|
||||
|
@ -905,6 +916,7 @@ void FOOTPRINT_VIEWER_FRAME::updateView()
|
|||
dp->DisplayBoard( GetBoard() );
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||
UpdateMsgPanel();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,13 @@ public:
|
|||
|
||||
virtual COLOR4D GetGridColor() override;
|
||||
|
||||
/**
|
||||
* redraws the message panel.
|
||||
* display the current footprint info, or
|
||||
* clear the message panel if nothing is loaded
|
||||
*/
|
||||
void UpdateMsgPanel() override;
|
||||
|
||||
/**
|
||||
* Function ReCreateLibraryList
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue