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)
 

Public Attributes

struct EDA_HOTKEY_CONFIGm_hotkeys
 

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 48 of file sel_layer.cpp.

Constructor & Destructor Documentation

PCB_LAYER_SELECTOR::PCB_LAYER_SELECTOR ( PCB_BASE_FRAME aFrame)
inline

Definition at line 51 of file sel_layer.cpp.

References m_frame.

51  :
53  {
54  m_frame = aFrame;
55  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:58

Member Function Documentation

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

Definition at line 48 of file layer_box_selector.cpp.

References KIGFX::COLOR4D::WithAlpha().

Referenced by GRID_CELL_LAYER_RENDERER::Draw(), GBR_LAYER_BOX_SELECTOR::Resync(), PCB_LAYER_BOX_SELECTOR::Resync(), and LAYER_BOX_SELECTOR::ResyncBitmapOnly().

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

Implements LAYER_SELECTOR.

Definition at line 68 of file sel_layer.cpp.

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

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

69  {
70  return m_frame->Settings().Colors().GetLayerColor( aLayer );
71  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:58
PCB_GENERAL_SETTINGS & Settings()
COLORS_DESIGN_SETTINGS & Colors()
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
wxString PCB_LAYER_SELECTOR::GetLayerName ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 74 of file sel_layer.cpp.

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

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

75  {
76  return m_frame->GetBoard()->GetLayerName( ToLAYER_ID( aLayer ) );
77  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:58
BOARD * GetBoard() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:810
bool PCB_LAYER_SELECTOR::IsLayerEnabled ( LAYER_NUM  aLayer) const
inlineoverrideprotectedvirtual

Implements LAYER_SELECTOR.

Definition at line 61 of file sel_layer.cpp.

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

62  {
63  return m_frame->GetBoard()->IsLayerEnabled( PCB_LAYER_ID( aLayer ) );
64  }
PCB_BASE_FRAME * m_frame
Definition: sel_layer.cpp:58
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:445
BOARD * GetBoard() const
PCB_LAYER_ID
A quick note on layer IDs:

Member Data Documentation

PCB_BASE_FRAME* PCB_LAYER_SELECTOR::m_frame
protected

Definition at line 58 of file sel_layer.cpp.

Referenced by PCB_LAYER_SELECTOR().

struct EDA_HOTKEY_CONFIG* LAYER_SELECTOR::m_hotkeys
inherited

Definition at line 46 of file layer_box_selector.h.

Referenced by LAYER_SELECTOR::LAYER_SELECTOR().

bool LAYER_SELECTOR::m_layerhotkeys
protectedinherited

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