KiCad PCB EDA Suite
FOOTPRINT_PREVIEW_PANEL_BASE Class Referenceabstract

Base class for the actual viewer panel. More...

#include <footprint_preview_widget.h>

Inheritance diagram for FOOTPRINT_PREVIEW_PANEL_BASE:
FOOTPRINT_PREVIEW_PANEL

Public Member Functions

virtual ~FOOTPRINT_PREVIEW_PANEL_BASE ()
 
virtual bool DisplayFootprint (LIB_ID const &aFPID)=0
 Set the currently displayed footprint. More...
 
virtual wxWindow * GetWindow ()=0
 Get the underlying wxWindow. More...
 
virtual const KIGFX::COLOR4DGetBackgroundColor ()=0
 Get the colors to use in a preview widget to match the preview panel. More...
 
virtual const KIGFX::COLOR4DGetForegroundColor ()=0
 

Static Public Member Functions

static FOOTPRINT_PREVIEW_PANEL_BASECreate (wxWindow *aParent, KIWAY &aKiway)
 Return a footprint preview panel instance via Kiface. More...
 

Detailed Description

Base class for the actual viewer panel.

The implementation is in pcbnew/footprint_preview_panel.cpp, accessed via kiface.

Definition at line 89 of file footprint_preview_widget.h.

Constructor & Destructor Documentation

◆ ~FOOTPRINT_PREVIEW_PANEL_BASE()

virtual FOOTPRINT_PREVIEW_PANEL_BASE::~FOOTPRINT_PREVIEW_PANEL_BASE ( )
inlinevirtual

Definition at line 92 of file footprint_preview_widget.h.

92 {}

Member Function Documentation

◆ Create()

FOOTPRINT_PREVIEW_PANEL_BASE * FOOTPRINT_PREVIEW_PANEL_BASE::Create ( wxWindow *  aParent,
KIWAY aKiway 
)
static

Return a footprint preview panel instance via Kiface.

May return null if Kiway is not available or there is any error on load.

Definition at line 109 of file footprint_preview_widget.cpp.

111 {
112  FOOTPRINT_PREVIEW_PANEL_BASE* panel = nullptr;
113 
114  try
115  {
116  KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB );
117  wxWindow* window = kiface->CreateWindow( aParent, FRAME_FOOTPRINT_PREVIEW, &aKiway );
118 
119  panel = dynamic_cast<FOOTPRINT_PREVIEW_PANEL_BASE*>( window );
120 
121  if( window && !panel )
122  delete window;
123  }
124  catch( ... )
125  {
126  }
127 
128  return panel;
129 }
BITMAP2CMP_SETTINGS kiface
pcbnew DSO
Definition: kiway.h:269
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
Definition: kiway.cpp:196
Base class for the actual viewer panel.
Implement a participant in the KIWAY alchemy.
Definition: kiway.h:148

References KIWAY::FACE_PCB, FRAME_FOOTPRINT_PREVIEW, kiface, and KIWAY::KiFACE().

Referenced by FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET().

◆ DisplayFootprint()

virtual bool FOOTPRINT_PREVIEW_PANEL_BASE::DisplayFootprint ( LIB_ID const &  aFPID)
pure virtual

Set the currently displayed footprint.

Any footprint passed in here must have been passed to CacheFootprint before.

Implemented in FOOTPRINT_PREVIEW_PANEL.

Referenced by FOOTPRINT_PREVIEW_WIDGET::DisplayFootprint().

◆ GetBackgroundColor()

virtual const KIGFX::COLOR4D& FOOTPRINT_PREVIEW_PANEL_BASE::GetBackgroundColor ( )
pure virtual

Get the colors to use in a preview widget to match the preview panel.

Implemented in FOOTPRINT_PREVIEW_PANEL.

Referenced by FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET().

◆ GetForegroundColor()

virtual const KIGFX::COLOR4D& FOOTPRINT_PREVIEW_PANEL_BASE::GetForegroundColor ( )
pure virtual

◆ GetWindow()

virtual wxWindow* FOOTPRINT_PREVIEW_PANEL_BASE::GetWindow ( )
pure virtual

The documentation for this class was generated from the following files: