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 void CacheFootprint (LIB_ID const &aFPID)=0
 Preload a footprint into the cache. More...
 
virtual void DisplayFootprint (LIB_ID const &aFPID)=0
 Set the currently displayed footprint. More...
 
virtual void SetStatusHandler (FOOTPRINT_STATUS_HANDLER aHandler)=0
 Set the callback to receive status updates. More...
 
virtual wxWindow * GetWindow ()=0
 Get the underlying wxWindow. More...
 

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 104 of file footprint_preview_widget.h.

Constructor & Destructor Documentation

virtual FOOTPRINT_PREVIEW_PANEL_BASE::~FOOTPRINT_PREVIEW_PANEL_BASE ( )
inlinevirtual

Definition at line 107 of file footprint_preview_widget.h.

107 {}

Member Function Documentation

virtual void FOOTPRINT_PREVIEW_PANEL_BASE::CacheFootprint ( LIB_ID const &  aFPID)
pure virtual

Preload a footprint into the cache.

This must be called prior to DisplayFootprint, and may be called early.

Implemented in FOOTPRINT_PREVIEW_PANEL.

Referenced by FOOTPRINT_PREVIEW_WIDGET::CacheFootprint().

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 111 of file footprint_preview_widget.cpp.

References KIFACE::CreateWindow(), KIWAY::FACE_PCB, FRAME_PCB_FOOTPRINT_PREVIEW, kiface, and KIWAY::KiFACE().

Referenced by FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET().

113 {
114  FOOTPRINT_PREVIEW_PANEL_BASE* panel = nullptr;
115 
116  try {
117  KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB );
118 
119  auto window = kiface->CreateWindow( aParent, FRAME_PCB_FOOTPRINT_PREVIEW, &aKiway );
120 
121  panel = dynamic_cast<FOOTPRINT_PREVIEW_PANEL_BASE*>( window );
122 
123  if( window && !panel )
124  delete window;
125  } catch( ... )
126  {}
127 
128  return panel;
129 }
VTBL_ENTRY wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0
Function CreateWindow creates a wxWindow for the current project.
pcbnew DSO
Definition: kiway.h:266
VTBL_ENTRY KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Function KiFACE returns the KIFACE* given a FACE_T.
Definition: kiway.cpp:150
Base class for the actual viewer panel.
Class KIFACE is used by a participant in the KIWAY alchemy.
Definition: kiway.h:150
return & kiface
Definition: pcbnew.cpp:207
virtual void 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().

virtual wxWindow* FOOTPRINT_PREVIEW_PANEL_BASE::GetWindow ( )
pure virtual
virtual void FOOTPRINT_PREVIEW_PANEL_BASE::SetStatusHandler ( FOOTPRINT_STATUS_HANDLER  aHandler)
pure virtual

Set the callback to receive status updates.

Implemented in FOOTPRINT_PREVIEW_PANEL.

Referenced by FOOTPRINT_PREVIEW_WIDGET::FOOTPRINT_PREVIEW_WIDGET().


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