KiCad PCB EDA Suite
LAYER_SELECTOR Class Referenceabstract

Base class to build a layer list. More...

#include <layer_box_selector.h>

Inheritance diagram for LAYER_SELECTOR:
LAYER_BOX_SELECTOR PCB_LAYER_SELECTOR GBR_LAYER_BOX_SELECTOR PCB_LAYER_BOX_SELECTOR PCB_ONE_LAYER_SELECTOR SELECT_COPPER_LAYERS_PAIR_DIALOG

Public Member Functions

 LAYER_SELECTOR ()
 
virtual ~LAYER_SELECTOR ()
 
bool SetLayersHotkeys (bool value)
 

Static Public Member Functions

static void DrawColorSwatch (wxBitmap &aLayerbmp, const COLOR4D &aBackground, const COLOR4D &aColor)
 

Protected Member Functions

virtual COLOR4D getLayerColor (LAYER_NUM aLayer) const =0
 
virtual wxString getLayerName (LAYER_NUM aLayer) const =0
 
virtual bool isLayerEnabled (LAYER_NUM aLayer) const =0
 

Protected Attributes

bool m_layerhotkeys
 

Detailed Description

Base class to build a layer list.

Definition at line 37 of file layer_box_selector.h.

Constructor & Destructor Documentation

◆ LAYER_SELECTOR()

LAYER_SELECTOR::LAYER_SELECTOR ( )

Definition at line 35 of file layer_box_selector.cpp.

36 {
37  m_layerhotkeys = true;
38 }

References m_layerhotkeys.

◆ ~LAYER_SELECTOR()

virtual LAYER_SELECTOR::~LAYER_SELECTOR ( )
inlinevirtual

Definition at line 42 of file layer_box_selector.h.

43  {
44  }

Member Function Documentation

◆ DrawColorSwatch()

void LAYER_SELECTOR::DrawColorSwatch ( wxBitmap &  aLayerbmp,
const COLOR4D aBackground,
const COLOR4D aColor 
)
static

Definition at line 48 of file layer_box_selector.cpp.

50 {
51  wxMemoryDC bmpDC;
52  wxBrush brush;
53 
54  // Prepare Bitmap
55  bmpDC.SelectObject( aLayerbmp );
56 
57  brush.SetStyle( wxBRUSHSTYLE_SOLID );
58 
59  if( aBackground != COLOR4D::UNSPECIFIED )
60  {
61  brush.SetColour( aBackground.WithAlpha( 1.0 ).ToColour() );
62  bmpDC.SetBrush( brush );
63  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
64  }
65 
66  brush.SetColour( aColor.ToColour() );
67  bmpDC.SetBrush( brush );
68  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
69 
70  bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
71  bmpDC.SetPen( *wxBLACK_PEN );
72  bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
73 }
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:305

References KIGFX::COLOR4D::WithAlpha().

Referenced by PANEL_SETUP_BOARD_STACKUP::createBmComboBox(), GRID_CELL_LAYER_RENDERER::Draw(), PANEL_SETUP_BOARD_STACKUP::onColorSelected(), GBR_LAYER_BOX_SELECTOR::Resync(), PCB_LAYER_BOX_SELECTOR::Resync(), LAYER_BOX_SELECTOR::ResyncBitmapOnly(), and PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard().

◆ getLayerColor()

virtual COLOR4D LAYER_SELECTOR::getLayerColor ( LAYER_NUM  aLayer) const
protectedpure virtual

◆ getLayerName()

virtual wxString LAYER_SELECTOR::getLayerName ( LAYER_NUM  aLayer) const
protectedpure virtual

◆ isLayerEnabled()

virtual bool LAYER_SELECTOR::isLayerEnabled ( LAYER_NUM  aLayer) const
protectedpure virtual

◆ SetLayersHotkeys()

Member Data Documentation

◆ m_layerhotkeys

bool LAYER_SELECTOR::m_layerhotkeys
protected

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