Commit 1f7ce541 authored by Maciej Suminski's avatar Maciej Suminski

Next/previous footprint toolbar buttons are handled in the Module Viewer using GAL canvas.

parent 553996e7
...@@ -356,6 +356,15 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList() ...@@ -356,6 +356,15 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList()
} }
void FOOTPRINT_VIEWER_FRAME::UseGalCanvas( bool aEnable )
{
EDA_DRAW_FRAME::UseGalCanvas( aEnable );
if( aEnable )
GetGalCanvas()->StartDrawing();
}
void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList() void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList()
{ {
m_footprintList->Clear(); m_footprintList->Clear();
...@@ -455,15 +464,7 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event ) ...@@ -455,15 +464,7 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event )
UpdateTitle(); UpdateTitle();
if( IsGalCanvasActive() ) if( IsGalCanvasActive() )
{ redrawGal();
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( m_Pcb );
// Autozoom
m_Pcb->ComputeBoundingBox( false );
EDA_RECT boardBbox = m_Pcb->GetBoundingBox();
GetGalCanvas()->GetView()->SetViewport( BOX2D( boardBbox.GetOrigin(),
boardBbox.GetSize() ) );
}
Zoom_Automatique( false ); Zoom_Automatique( false );
m_canvas->Refresh(); m_canvas->Refresh();
...@@ -846,8 +847,12 @@ void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode ) ...@@ -846,8 +847,12 @@ void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode )
GetBoard()->Add( footprint, ADD_APPEND ); GetBoard()->Add( footprint, ADD_APPEND );
Update3D_Frame(); Update3D_Frame();
if( IsGalCanvasActive() )
redrawGal();
} }
UpdateTitle(); UpdateTitle();
Zoom_Automatique( false ); Zoom_Automatique( false );
m_canvas->Refresh(); m_canvas->Refresh();
...@@ -873,10 +878,12 @@ void FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -873,10 +878,12 @@ void FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
void FOOTPRINT_VIEWER_FRAME::UseGalCanvas( bool aEnable ) void FOOTPRINT_VIEWER_FRAME::redrawGal()
{ {
EDA_DRAW_FRAME::UseGalCanvas( aEnable ); static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( m_Pcb );
if( aEnable ) // Autozoom
GetGalCanvas()->StartDrawing(); m_Pcb->ComputeBoundingBox( false );
EDA_RECT boardBbox = m_Pcb->GetBoundingBox();
GetGalCanvas()->GetView()->SetViewport( BOX2D( boardBbox.GetOrigin(), boardBbox.GetSize() ) );
} }
...@@ -69,6 +69,8 @@ public: ...@@ -69,6 +69,8 @@ public:
*/ */
void ReCreateLibraryList(); void ReCreateLibraryList();
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
virtual void UseGalCanvas( bool aEnable );
private: private:
...@@ -170,8 +172,7 @@ private: ...@@ -170,8 +172,7 @@ private:
void SaveCopyInUndoList( BOARD_ITEM*, UNDO_REDO_T, const wxPoint& ) {} void SaveCopyInUndoList( BOARD_ITEM*, UNDO_REDO_T, const wxPoint& ) {}
void SaveCopyInUndoList( const PICKED_ITEMS_LIST&, UNDO_REDO_T, const wxPoint &) {} void SaveCopyInUndoList( const PICKED_ITEMS_LIST&, UNDO_REDO_T, const wxPoint &) {}
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas() void redrawGal();
virtual void UseGalCanvas( bool aEnable );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment