From 88cdce8d6275cdd899dc5e26b3b211d787553bee Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 15 Sep 2018 09:00:13 +0200 Subject: [PATCH] Make SYMBOL_PREVIEW_WIDGET working, and using the canvas type of the caller. Fix an issue with F3 zoom key in libedit. --- common/gal/opengl/opengl_gal.cpp | 46 +-- common/legacy_gal/eda_draw_frame.cpp | 8 +- eeschema/dialogs/dialog_choose_component.cpp | 3 +- eeschema/dialogs/dialog_rescue_each.cpp | 37 ++- eeschema/dialogs/dialog_rescue_each_base.cpp | 22 +- eeschema/dialogs/dialog_rescue_each_base.fbp | 280 +++++++------------ eeschema/dialogs/dialog_rescue_each_base.h | 10 +- eeschema/sch_base_frame.cpp | 12 +- eeschema/sch_painter.cpp | 4 +- eeschema/widgets/symbol_preview_widget.cpp | 31 +- eeschema/widgets/symbol_preview_widget.h | 6 +- 11 files changed, 206 insertions(+), 253 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 161a114d12..34f18b5891 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -655,29 +655,6 @@ void OPENGL_GAL::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, double a Save(); currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 ); - if( isStrokeEnabled ) - { - currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a ); - - VECTOR2D p( cos( aStartAngle ) * aRadius, sin( aStartAngle ) * aRadius ); - double alpha; - - for( alpha = aStartAngle + alphaIncrement; alpha <= aEndAngle; alpha += alphaIncrement ) - { - VECTOR2D p_next( cos( alpha ) * aRadius, sin( alpha ) * aRadius ); - DrawLine( p, p_next ); - - p = p_next; - } - - // Draw the last missing part - if( alpha != aEndAngle ) - { - VECTOR2D p_last( cos( aEndAngle ) * aRadius, sin( aEndAngle ) * aRadius ); - DrawLine( p, p_last ); - } - } - if( isFillEnabled ) { double alpha; @@ -703,6 +680,29 @@ void OPENGL_GAL::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, double a currentManager->Vertex( endPoint.x, endPoint.y, 0.0 ); } + if( isStrokeEnabled ) + { + currentManager->Color( strokeColor.r, strokeColor.g, strokeColor.b, strokeColor.a ); + + VECTOR2D p( cos( aStartAngle ) * aRadius, sin( aStartAngle ) * aRadius ); + double alpha; + + for( alpha = aStartAngle + alphaIncrement; alpha <= aEndAngle; alpha += alphaIncrement ) + { + VECTOR2D p_next( cos( alpha ) * aRadius, sin( alpha ) * aRadius ); + DrawLine( p, p_next ); + + p = p_next; + } + + // Draw the last missing part + if( alpha != aEndAngle ) + { + VECTOR2D p_last( cos( aEndAngle ) * aRadius, sin( aEndAngle ) * aRadius ); + DrawLine( p, p_last ); + } + } + Restore(); } diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index 9d8718c52c..2a39567a7a 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -1468,14 +1468,11 @@ void EDA_DRAW_FRAME::SetNextZoomAndRedraw( const wxPoint& aCenterPoint, bool aWa if( idx >= (int)zoomList.size() ) return; - VECTOR2D cpos = GetGalCanvas()->GetViewControls()->GetCursorPosition(); - wxPoint center( (int)cpos.x, (int)cpos.y ); - if( m_zoomSelectBox ) m_zoomSelectBox->SetSelection( idx ); if( GetScreen()->SetZoom( GetScreen()->m_ZoomList[idx] ) ) - RedrawScreen( aCenterPoint, true ); + RedrawScreen( aCenterPoint, aWarpPointer ); } @@ -1497,9 +1494,6 @@ void EDA_DRAW_FRAME::SetPreviousZoomAndRedraw( const wxPoint& aCenterPoint, bool if( idx < 0 ) return; - VECTOR2D cpos = GetGalCanvas()->GetViewControls()->GetCursorPosition(); - wxPoint center( (int)cpos.x, (int)cpos.y ); - if( m_zoomSelectBox ) m_zoomSelectBox->SetSelection( idx ); diff --git a/eeschema/dialogs/dialog_choose_component.cpp b/eeschema/dialogs/dialog_choose_component.cpp index 9ef0ad8241..ff4fb81f71 100644 --- a/eeschema/dialogs/dialog_choose_component.cpp +++ b/eeschema/dialogs/dialog_choose_component.cpp @@ -207,7 +207,8 @@ wxPanel* DIALOG_CHOOSE_COMPONENT::ConstructRightPanel( wxWindow* aParent ) auto panel = new wxPanel( aParent ); auto sizer = new wxBoxSizer( wxVERTICAL ); - m_symbol_preview = new SYMBOL_PREVIEW_WIDGET( panel, Kiway() ); + m_symbol_preview = new SYMBOL_PREVIEW_WIDGET( panel, Kiway(), + m_parent->GetGalCanvas()->GetBackend() ); m_symbol_preview->SetLayoutDirection( wxLayout_LeftToRight ); if( m_show_footprints ) diff --git a/eeschema/dialogs/dialog_rescue_each.cpp b/eeschema/dialogs/dialog_rescue_each.cpp index 48bde00547..099a7c98f0 100644 --- a/eeschema/dialogs/dialog_rescue_each.cpp +++ b/eeschema/dialogs/dialog_rescue_each.cpp @@ -52,6 +52,8 @@ public: private: SCH_EDIT_FRAME* m_Parent; + SYMBOL_PREVIEW_WIDGET* m_previewNewWidget; + SYMBOL_PREVIEW_WIDGET* m_previewOldWidget; wxConfigBase* m_Config; RESCUER* m_Rescuer; bool m_AskShowAgain; @@ -63,6 +65,10 @@ private: void OnConflictSelect( wxDataViewEvent& aEvent ) override; void OnNeverShowClick( wxCommandEvent& aEvent ) override; void OnCancelClick( wxCommandEvent& aEvent ) override; + + // Display the 2 items (old in cache and new in library) corresponding to the + // selected conflict in m_ListOfConflicts + void displayItemsInConflict(); }; @@ -73,6 +79,12 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( SCH_EDIT_FRAME* aParent, RESCUER& aRescu m_Rescuer( &aRescuer ), m_AskShowAgain( aAskShowAgain ) { + m_previewOldWidget = new SYMBOL_PREVIEW_WIDGET( m_previewOldPanel, Kiway(), m_Parent->GetGalCanvas()->GetBackend() ); + m_SizerOldPanel->Add( m_previewOldWidget, 1, wxEXPAND | wxALL, 5 ); + + m_previewNewWidget = new SYMBOL_PREVIEW_WIDGET( m_previewNewPanel, Kiway(), m_Parent->GetGalCanvas()->GetBackend() ); + m_SizerNewPanel->Add( m_previewNewWidget, 1, wxEXPAND | wxALL, 5 ); + m_Config = Kiface().KifaceSettings(); m_stdButtonsOK->SetDefault(); @@ -172,6 +184,8 @@ void DIALOG_RESCUE_EACH::PopulateConflictList() { // Select the first choice m_ListOfConflicts->SelectRow( 0 ); + // Ensure this choice is displayed: + displayItemsInConflict(); } } @@ -209,16 +223,8 @@ void DIALOG_RESCUE_EACH::PopulateInstanceList() } -void DIALOG_RESCUE_EACH::OnConflictSelect( wxDataViewEvent& aEvent ) +void DIALOG_RESCUE_EACH::displayItemsInConflict() { - // wxformbuilder connects this event to the _dialog_, not the data view. - // Make sure the correct item triggered it, otherwise we trigger recursively - // and get a stack overflow. - if( aEvent.GetEventObject() != m_ListOfConflicts ) - return; - - PopulateInstanceList(); - int row = m_ListOfConflicts->GetSelectedRow(); if( row < 0 ) @@ -235,6 +241,19 @@ void DIALOG_RESCUE_EACH::OnConflictSelect( wxDataViewEvent& aEvent ) } +void DIALOG_RESCUE_EACH::OnConflictSelect( wxDataViewEvent& aEvent ) +{ + // wxformbuilder connects this event to the _dialog_, not the data view. + // Make sure the correct item triggered it, otherwise we trigger recursively + // and get a stack overflow. + if( aEvent.GetEventObject() != m_ListOfConflicts ) + return; + + PopulateInstanceList(); + displayItemsInConflict(); +} + + bool DIALOG_RESCUE_EACH::TransferDataFromWindow() { if( !wxDialog::TransferDataFromWindow() ) diff --git a/eeschema/dialogs/dialog_rescue_each_base.cpp b/eeschema/dialogs/dialog_rescue_each_base.cpp index 336523c803..dfc87bf5a5 100644 --- a/eeschema/dialogs/dialog_rescue_each_base.cpp +++ b/eeschema/dialogs/dialog_rescue_each_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 11 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -53,16 +53,12 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i bSizerLeftPreview->Add( m_previewOldLabel, 0, 0, 5 ); m_previewOldPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizerOldPanel; - bSizerOldPanel = new wxBoxSizer( wxVERTICAL ); - - m_previewOldWidget = new SYMBOL_PREVIEW_WIDGET( m_previewOldPanel, Kiway() ); - bSizerOldPanel->Add( m_previewOldWidget, 1, wxEXPAND, 5 ); + m_SizerOldPanel = new wxBoxSizer( wxVERTICAL ); - m_previewOldPanel->SetSizer( bSizerOldPanel ); + m_previewOldPanel->SetSizer( m_SizerOldPanel ); m_previewOldPanel->Layout(); - bSizerOldPanel->Fit( m_previewOldPanel ); + m_SizerOldPanel->Fit( m_previewOldPanel ); bSizerLeftPreview->Add( m_previewOldPanel, 1, wxEXPAND | wxALL, 5 ); @@ -78,16 +74,12 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i bSizerRightPreview->Add( m_previewNewLabel, 0, 0, 5 ); m_previewNewPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizerNewPanel; - bSizerNewPanel = new wxBoxSizer( wxVERTICAL ); - - m_previewNewWidget = new SYMBOL_PREVIEW_WIDGET( m_previewNewPanel, Kiway() ); - bSizerNewPanel->Add( m_previewNewWidget, 1, wxEXPAND, 5 ); + m_SizerNewPanel = new wxBoxSizer( wxVERTICAL ); - m_previewNewPanel->SetSizer( bSizerNewPanel ); + m_previewNewPanel->SetSizer( m_SizerNewPanel ); m_previewNewPanel->Layout(); - bSizerNewPanel->Fit( m_previewNewPanel ); + m_SizerNewPanel->Fit( m_previewNewPanel ); bSizerRightPreview->Add( m_previewNewPanel, 1, wxEXPAND | wxALL, 5 ); diff --git a/eeschema/dialogs/dialog_rescue_each_base.fbp b/eeschema/dialogs/dialog_rescue_each_base.fbp index 8b032182db..086b3a75b7 100644 --- a/eeschema/dialogs/dialog_rescue_each_base.fbp +++ b/eeschema/dialogs/dialog_rescue_each_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_rescue_each_base 1000 none + 1 dialog_rescue_each_base @@ -54,13 +55,20 @@ - + + + + + + + + @@ -75,17 +83,23 @@ + + + + + + OnDialogResize @@ -130,7 +144,7 @@ 0 - -1,50 + -1,80 1 m_htmlPrompt 1 @@ -149,7 +163,14 @@ + + + + + + + @@ -210,6 +231,7 @@ 0 wxID_ANY Symbols to update: + 0 0 @@ -235,7 +257,14 @@ -1 + + + + + + + @@ -285,7 +314,14 @@ + + + + + + + @@ -361,6 +397,7 @@ 0 wxID_ANY Instances of this symbol: + 0 0 @@ -386,7 +423,14 @@ -1 + + + + + + + @@ -436,7 +480,14 @@ + + + + + + + @@ -530,6 +581,7 @@ 0 wxID_ANY Cached Symbol: + 0 0 @@ -555,7 +607,14 @@ -1 + + + + + + + @@ -635,7 +694,14 @@ wxTAB_TRAVERSAL + + + + + + + @@ -660,94 +726,9 @@ - bSizerOldPanel + m_SizerOldPanel wxVERTICAL - none - - 5 - wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - SYMBOL_PREVIEW_WIDGET - 1 - m_previewOldWidget = new SYMBOL_PREVIEW_WIDGET( m_previewOldPanel, Kiway() ); - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - #include <symbol_preview_widget.h> - - 0 - - - 0 - - 1 - m_previewOldWidget - 1 - - - protected - 1 - - Resizable - - 1 - - ; forward_declare - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + protected @@ -795,6 +776,7 @@ 0 wxID_ANY Library Symbol: + 0 0 @@ -820,7 +802,14 @@ -1 + + + + + + + @@ -900,7 +889,14 @@ wxTAB_TRAVERSAL + + + + + + + @@ -925,94 +921,9 @@ - bSizerNewPanel + m_SizerNewPanel wxVERTICAL - none - - 5 - wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - SYMBOL_PREVIEW_WIDGET - 1 - m_previewNewWidget = new SYMBOL_PREVIEW_WIDGET( m_previewNewPanel, Kiway() ); - - 1 - - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - #include <symbol_preview_widget.h> - - 0 - - - 0 - - 1 - m_previewNewWidget - 1 - - - protected - 1 - - Resizable - - 1 - - ; forward_declare - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + protected @@ -1044,25 +955,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Never Show Again + + 0 0 @@ -1077,6 +994,8 @@ protected 1 + + Resizable 1 @@ -1091,8 +1010,15 @@ + + + + + + OnNeverShowClick + diff --git a/eeschema/dialogs/dialog_rescue_each_base.h b/eeschema/dialogs/dialog_rescue_each_base.h index f6bc920b92..47f61ce271 100644 --- a/eeschema/dialogs/dialog_rescue_each_base.h +++ b/eeschema/dialogs/dialog_rescue_each_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 11 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -20,9 +20,11 @@ #include #include #include -#include #include #include +#include +#include +#include #include #include @@ -44,10 +46,10 @@ class DIALOG_RESCUE_EACH_BASE : public DIALOG_SHIM wxDataViewListCtrl* m_ListOfInstances; wxStaticText* m_previewOldLabel; wxPanel* m_previewOldPanel; - SYMBOL_PREVIEW_WIDGET* m_previewOldWidget; + wxBoxSizer* m_SizerOldPanel; wxStaticText* m_previewNewLabel; wxPanel* m_previewNewPanel; - SYMBOL_PREVIEW_WIDGET* m_previewNewWidget; + wxBoxSizer* m_SizerNewPanel; wxButton* m_btnNeverShowAgain; wxStdDialogButtonSizer* m_stdButtons; wxButton* m_stdButtonsOK; diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 3a71df32b7..86a63fbf43 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -496,7 +496,7 @@ void SCH_BASE_FRAME::CenterScreen( const wxPoint& aCenterPoint, bool aWarpPointe void SCH_BASE_FRAME::HardRedraw() { - GetCanvas()->DisplaySheet( GetScreen() ); + // Currently: just refresh the screen GetCanvas()->Refresh(); } @@ -598,15 +598,15 @@ bool SCH_BASE_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a void SCH_BASE_FRAME::createCanvas() { - EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = LoadCanvasTypeSetting(); + m_canvasType = LoadCanvasTypeSetting(); // Allows only a CAIRO or OPENGL canvas: - if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL && - canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) - canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; + if( m_canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL && + m_canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) + m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; m_canvas = new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize, - GetGalDisplayOptions(), canvasType ); + GetGalDisplayOptions(), m_canvasType ); m_useSingleCanvasPane = true; diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 5dfd7e4c8d..875f8d00a6 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -424,8 +424,8 @@ void SCH_PAINTER::draw( LIB_POLYLINE *aLine, int aLayer ) for( auto p : aLine->GetPolyPoints() ) vtx.push_back ( mapCoords( p ) ); - if( aLine->GetFillMode() == FILLED_WITH_BG_BODYCOLOR || aLine->GetFillMode() == FILLED_SHAPE ) - vtx.push_back( vtx[0] ); +// if( aLine->GetFillMode() == FILLED_WITH_BG_BODYCOLOR || aLine->GetFillMode() == FILLED_SHAPE ) +// vtx.push_back( vtx[0] ); m_gal->DrawPolygon( vtx ); } diff --git a/eeschema/widgets/symbol_preview_widget.cpp b/eeschema/widgets/symbol_preview_widget.cpp index 7364a3d544..43741ef885 100644 --- a/eeschema/widgets/symbol_preview_widget.cpp +++ b/eeschema/widgets/symbol_preview_widget.cpp @@ -29,7 +29,8 @@ #include #include -SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway ) : +SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway, + EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) : wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ), m_kiway( aKiway ), m_preview( nullptr ), @@ -40,8 +41,15 @@ SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway ) wxConfigBase* eeschemaConfig = GetNewConfig( wxString::FromUTF8( "eeschema" ) ); m_galDisplayOptions.ReadConfig( eeschemaConfig, GAL_DISPLAY_OPTIONS_KEY ); + EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = aCanvasType; + + // Allows only a CAIRO or OPENGL canvas: + if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL && + canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) + canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; + m_preview = new SCH_PREVIEW_PANEL( aParent, wxID_ANY, wxDefaultPosition, wxSize( -1, -1 ), - m_galDisplayOptions, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ); + m_galDisplayOptions, canvasType ); m_preview->SetStealsFocus( false ); SetBackgroundColour( *wxWHITE ); @@ -117,15 +125,20 @@ void SYMBOL_PREVIEW_WIDGET::DisplaySymbol( const LIB_ID& aSymbolID, int aUnit ) view->Add( alias ); m_previewItem = alias; - // Zoom to fit + // Calculate the draw scale to fit the drawing area + + // First, get the symbole size, in internal units BOX2I bBox = alias->GetPart()->GetUnitBoundingBox( aUnit, 0 ); - VECTOR2D clientSize = m_preview->GetClientSize(); + // Now calculate the drawing area size, in internal units, for a scaling factor = 1.0 + view->SetScale( 1.0 ); + VECTOR2D clientSize = view->ToWorld( m_preview->GetClientSize(), false ); double scale = std::min( fabs( clientSize.x / bBox.GetWidth() ), fabs( clientSize.y / bBox.GetHeight() ) ); // Above calculation will yield an exact fit; add a bit of whitespace around symbol scale /= 1.2; + // Now fix the best scale view->SetScale( scale ); view->SetCenter( bBox.Centre() ); } @@ -157,15 +170,19 @@ void SYMBOL_PREVIEW_WIDGET::DisplayPart( LIB_PART* aPart, int aUnit ) view->Add( aPart ); m_previewItem = aPart; - // Zoom to fit + // Calculate the draw scale to fit the drawing area + + // First, get the symbole size, in internal units BOX2I bBox = aPart->GetUnitBoundingBox( aUnit, 0 ); - VECTOR2D clientSize = m_preview->GetClientSize(); + // Now calculate the drawing area size, in internal units, for a scaling factor = 1.0 + view->SetScale( 1.0 ); + VECTOR2D clientSize = view->ToWorld( m_preview->GetClientSize(), false ); double scale = std::min( fabs( clientSize.x / bBox.GetWidth() ), fabs( clientSize.y / bBox.GetHeight() ) ); - // Above calculation will yield an exact fit; add a bit of whitespace around symbol scale /= 1.2; + // Now fix the best scale view->SetScale( scale ); view->SetCenter( bBox.Centre() ); } diff --git a/eeschema/widgets/symbol_preview_widget.h b/eeschema/widgets/symbol_preview_widget.h index b0944f476e..c817b1fe46 100644 --- a/eeschema/widgets/symbol_preview_widget.h +++ b/eeschema/widgets/symbol_preview_widget.h @@ -23,13 +23,13 @@ #include #include #include +#include class EDA_ITEM; class LIB_ID; class LIB_ALIAS; class LIB_PART; -class EDA_DRAW_PANEL_GAL; class wxStaticText; class wxSizer; @@ -43,8 +43,10 @@ public: * * @param aParent - parent window * @param aKiway - an active Kiway instance + * @param aCanvasType = the type of canvas (GAL_TYPE_OPENGL or GAL_TYPE_CAIRO only) */ - SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway ); + SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway, + EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ); ~SYMBOL_PREVIEW_WIDGET() override;