KiCad PCB EDA Suite
PCB_LAYER_SELECTOR Class Reference
Inheritance diagram for PCB_LAYER_SELECTOR:
LAYER_SELECTOR PCB_ONE_LAYER_SELECTOR SELECT_COPPER_LAYERS_PAIR_DIALOG

Public Member Functions

 PCB_LAYER_SELECTOR (PCB_BASE_FRAME *aFrame)
 
bool SetLayersHotkeys (bool value)
 

Static Public Member Functions

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

Protected Member Functions

bool IsLayerEnabled (LAYER_NUM aLayer) const override
 
COLOR4D GetLayerColor (LAYER_NUM aLayer) const override
 
wxString GetLayerName (LAYER_NUM aLayer) const override
 

Protected Attributes

PCB_BASE_FRAMEm_frame
 
bool m_layerhotkeys
 

Detailed Description

Definition at line 44 of file sel_layer.cpp.

Constructor & Destructor Documentation

◆ PCB_LAYER_SELECTOR()

PCB_LAYER_SELECTOR::PCB_LAYER_SELECTOR ( PCB_BASE_FRAME aFrame)
inline

Definition at line 47 of file sel_layer.cpp.

47  :
49  {
50  m_frame = aFrame;
51  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:54

References m_frame.

Member Function Documentation

◆ DrawColorSwatch()

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

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()

COLOR4D PCB_LAYER_SELECTOR::GetLayerColor ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 64 of file sel_layer.cpp.

65  {
66  return m_frame->Settings().Colors().GetLayerColor( aLayer );
67  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:54
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
PCB_GENERAL_SETTINGS & Settings()
COLORS_DESIGN_SETTINGS & Colors()

References PCB_GENERAL_SETTINGS::Colors(), COLORS_DESIGN_SETTINGS::GetLayerColor(), m_frame, and PCB_BASE_FRAME::Settings().

Referenced by PCB_ONE_LAYER_SELECTOR::buildList(), and SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList().

◆ GetLayerName()

wxString PCB_LAYER_SELECTOR::GetLayerName ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 70 of file sel_layer.cpp.

71  {
72  return m_frame->GetBoard()->GetLayerName( ToLAYER_ID( aLayer ) );
73  }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:54
BOARD * GetBoard() const
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:823

References PCB_BASE_FRAME::GetBoard(), BOARD::GetLayerName(), m_frame, and ToLAYER_ID().

Referenced by PCB_ONE_LAYER_SELECTOR::buildList(), and SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList().

◆ IsLayerEnabled()

bool PCB_LAYER_SELECTOR::IsLayerEnabled ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 57 of file sel_layer.cpp.

58  {
59  return m_frame->GetBoard()->IsLayerEnabled( PCB_LAYER_ID( aLayer ) );
60  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:54
bool IsLayerEnabled(PCB_LAYER_ID aLayer) const
Function IsLayerEnabled is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:437
PCB_LAYER_ID
A quick note on layer IDs:
BOARD * GetBoard() const

References PCB_BASE_FRAME::GetBoard(), BOARD::IsLayerEnabled(), and m_frame.

◆ SetLayersHotkeys()

Member Data Documentation

◆ m_frame

PCB_BASE_FRAME* PCB_LAYER_SELECTOR::m_frame
protected

Definition at line 54 of file sel_layer.cpp.

Referenced by GetLayerColor(), GetLayerName(), IsLayerEnabled(), and PCB_LAYER_SELECTOR().

◆ m_layerhotkeys

bool LAYER_SELECTOR::m_layerhotkeys
protectedinherited

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