KiCad PCB EDA Suite
LAYER_SELECTOR Class Referenceabstract

#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 COLOR4D GetLayerColor (LAYER_NUM aLayer) const =0
 
virtual wxString GetLayerName (LAYER_NUM aLayer) const =0
 
virtual bool IsLayerEnabled (LAYER_NUM aLayer) const =0
 
bool SetLayersHotkeys (bool value)
 

Static Public Member Functions

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

Protected Attributes

bool m_layerhotkeys
 

Detailed Description

Definition at line 38 of file layer_box_selector.h.

Constructor & Destructor Documentation

◆ LAYER_SELECTOR()

LAYER_SELECTOR::LAYER_SELECTOR ( )

Definition at line 34 of file layer_box_selector.cpp.

35 {
36  m_layerhotkeys = true;
37 }

References m_layerhotkeys.

Member Function Documentation

◆ DrawColorSwatch()

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

Definition at line 47 of file layer_box_selector.cpp.

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

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
pure virtual

◆ GetLayerName()

virtual wxString LAYER_SELECTOR::GetLayerName ( LAYER_NUM  aLayer) const
pure virtual

◆ IsLayerEnabled()

virtual bool LAYER_SELECTOR::IsLayerEnabled ( LAYER_NUM  aLayer) const
pure virtual

◆ SetLayersHotkeys()

Member Data Documentation

◆ m_layerhotkeys

bool LAYER_SELECTOR::m_layerhotkeys
protected

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