KiCad PCB EDA Suite
LAYER_WIDGET Class Referenceabstract

Manage a list of layers with the notion of a "current" layer, and layer specific visibility control. More...

#include <layer_widget.h>

Inheritance diagram for LAYER_WIDGET:
GERBER_LAYER_WIDGET

Classes

struct  ROW
 Provide all the data needed to add a row to a LAYER_WIDGET. More...
 

Public Member Functions

 LAYER_WIDGET (wxWindow *aParent, wxWindow *aFocusOwner, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
 
virtual ~LAYER_WIDGET ()
 
void SetSmallestLayerString (const wxString &aString)
 Set the string that is used for determining the smallest string displayed in the layer's tab. More...
 
wxSize GetBestSize () const
 Return the preferred minimum size, taking into consideration the dynamic content. More...
 
int GetLayerRowCount () const
 Return the number of rows in the layer tab. More...
 
int GetRenderRowCount () const
 Return the number of rows in the render tab. More...
 
void AppendLayerRow (const ROW &aRow)
 Append a new row in the layer portion of the widget. More...
 
void AppendLayerRows (const ROW *aRowsArray, int aRowCount)
 Append new rows in the layer portion of the widget. More...
 
void ClearLayerRows ()
 Empty out the layer rows. More...
 
void AppendRenderRow (const ROW &aRow)
 Append a new row in the render portion of the widget. More...
 
void AppendRenderRows (const ROW *aRowsArray, int aRowCount)
 Append new rows in the render portion of the widget. More...
 
void ClearRenderRows ()
 Empty out the render rows. More...
 
void SelectLayerRow (int aRow)
 Change the row selection in the layer list to the given row. More...
 
void SelectLayer (LAYER_NUM aLayer)
 Change the row selection in the layer list to aLayer provided. More...
 
LAYER_NUM GetSelectedLayer ()
 Return the selected layer or -1 if none. More...
 
void SetLayerVisible (LAYER_NUM aLayer, bool isVisible)
 Set aLayer visible or not. More...
 
bool IsLayerVisible (LAYER_NUM aLayer)
 Return the visible state of the layer ROW associated with aLayer id. More...
 
void SetLayerColor (LAYER_NUM aLayer, const COLOR4D &aColor)
 Change the color of aLayer. More...
 
COLOR4D GetLayerColor (LAYER_NUM aLayer) const
 Return the color of the layer ROW associated with aLayer id. More...
 
void SetRenderState (int aId, bool isSet)
 Set the state of the checkbox associated with aId within the Render tab group of the widget. More...
 
bool GetRenderState (int aId)
 Return the state of the checkbox associated with aId. More...
 
void UpdateLayouts ()
 
void UpdateLayerIcons ()
 Update all layer manager icons (layers only). More...
 
virtual void OnLayerColorChange (int aLayer, const COLOR4D &aColor)=0
 Notify client code about a layer color change. More...
 
virtual bool OnLayerSelect (int aLayer)=0
 Notify client code whenever the user selects a different layer. More...
 
virtual void OnLayerVisible (LAYER_NUM aLayer, bool isVisible, bool isFinal=true)=0
 Notify client code about a layer visibility change. More...
 
virtual void OnLayerRightClick (wxMenu &aMenu)=0
 Notify client code about a layer being right-clicked. More...
 
virtual void OnRenderColorChange (int aId, const COLOR4D &aColor)=0
 Notify client code whenever the user changes a rendering color. More...
 
virtual void OnRenderEnable (int aId, bool isEnabled)=0
 Notify client code whenever the user changes an rendering enable in one of the rendering checkboxes. More...
 

Static Public Attributes

static const wxEventType EVT_LAYER_COLOR_CHANGE = wxNewEventType()
 

Protected Types

enum  POPUP_ID { ID_CHANGE_LAYER_COLOR = wxID_HIGHEST, ID_CHANGE_RENDER_COLOR, ID_LAST_VALUE }
 

Protected Member Functions

virtual bool useAlternateBitmap (int aRow)
 
virtual COLOR4D getBackgroundLayerColor ()
 Subclasses can override this to provide accurate representation of transparent color swatches. More...
 
void OnLeftDownLayers (wxMouseEvent &event)
 
void OnRightDownLayer (wxMouseEvent &event, COLOR_SWATCH *aColorSwatch, const wxString &aLayerName)
 Called when user right-clicks a layer. More...
 
void OnLayerSwatchChanged (wxCommandEvent &aEvent)
 Called when a user changes a swatch color. More...
 
void OnLayerCheckBox (wxCommandEvent &event)
 Handle the "is layer visible" checkbox and propagates the event to the client's notification function. More...
 
void OnRightDownRender (wxMouseEvent &aEvent, COLOR_SWATCH *aColorSwatch, const wxString &aRenderName)
 Notify when user right-clicks a render option. More...
 
void OnRenderSwatchChanged (wxCommandEvent &aEvent)
 Called when user has changed the swatch color of a render entry. More...
 
void OnRenderCheckBox (wxCommandEvent &event)
 
void OnTabChange (wxNotebookEvent &event)
 
wxWindow * getLayerComp (int aRow, int aColumn) const
 Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters are out of range. More...
 
wxWindow * getRenderComp (int aRow, int aColumn) const
 
int findLayerRow (LAYER_NUM aLayer) const
 Return the row index that aLayer resides in, or -1 if not found. More...
 
int findRenderRow (int aId) const
 
void insertLayerRow (int aRow, const ROW &aSpec)
 Append or insert a new row in the layer portion of the widget. More...
 
void insertRenderRow (int aRow, const ROW &aSpec)
 
void setLayerCheckbox (LAYER_NUM aLayer, bool isVisible)
 
void updateLayerRow (int aRow, const wxString &aName)
 
void passOnFocus ()
 Give away the keyboard focus up to the main parent window. More...
 

Static Protected Member Functions

static int encodeId (int aColumn, int aId)
 Allow saving a layer index within a control as its wxControl id. More...
 
static LAYER_NUM getDecodedId (int aControlId)
 Decode aControlId to original un-encoded value. More...
 

Protected Attributes

wxAuiNotebook * m_notebook
 
wxPanel * m_LayerPanel
 
wxScrolledWindow * m_LayerScrolledWindow
 
wxFlexGridSizer * m_LayersFlexGridSizer
 
wxPanel * m_RenderingPanel
 
wxScrolledWindow * m_RenderScrolledWindow
 
wxFlexGridSizer * m_RenderFlexGridSizer
 
wxWindow * m_FocusOwner
 
int m_CurrentRow
 selected row of layer list More...
 
int m_PointSize
 
ROW_ICON_PROVIDERm_IconProvider
 
wxString m_smallestLayerString
 

Detailed Description

Manage a list of layers with the notion of a "current" layer, and layer specific visibility control.

You must derive from it to use it so you can implement the abstract functions which receive the events. Each layer is given its own color, and that color can be changed within the UI provided here. This widget knows nothing of the client code, meaning it has no knowledge of a BOARD or anything. To use it you must derive from this class and implement the abstract functions:

void OnLayerColorChange( int aLayer, int aColor );

bool OnLayerSelect( int aLayer );

void OnLayerVisible( int aLayer, bool isVisible );

void OnRenderColorChange( int id, int aColor );

void OnRenderEnable( int id, bool isEnabled );

Note
Even if designed toward layers, it is used to contain other stuff, too (the second page in pcbnew contains render items, for example).

Definition at line 77 of file layer_widget.h.

Member Enumeration Documentation

◆ POPUP_ID

enum LAYER_WIDGET::POPUP_ID
protected
Enumerator
ID_CHANGE_LAYER_COLOR 
ID_CHANGE_RENDER_COLOR 
ID_LAST_VALUE 

Definition at line 453 of file layer_widget.h.

Constructor & Destructor Documentation

◆ LAYER_WIDGET()

LAYER_WIDGET::LAYER_WIDGET ( wxWindow *  aParent,
wxWindow *  aFocusOwner,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL 
)
Parameters
aParentis the parent window.
aFocusOwneris the window that should be sent the focus after.
idis the wxWindow id ( default = wxID_ANY).
posis the window position.
sizeis the window size.
styleis the window style.

Definition at line 490 of file layer_widget.cpp.

491  :
492  wxPanel( aParent, id, pos, size, style ),
493  m_smallestLayerString( "M...M" )
494 {
495  int indicatorSize = ConvertDialogToPixels( wxSize( 6, 6 ) ).x;
496  m_IconProvider = new ROW_ICON_PROVIDER( indicatorSize );
497 
498  int pointSize = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetPointSize();
499  int screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
500 
501  if( screenHeight <= 900 && pointSize >= indicatorSize )
502  pointSize = pointSize * 8 / 10;
503 
504  m_PointSize = pointSize;
505 
506  wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
507 
508  m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
509  wxAUI_NB_TOP );
510 
511  wxFont font = m_notebook->GetFont();
512 
513  // change the font size on the notebook's tabs to match aPointSize
514  font.SetPointSize( pointSize );
515  m_notebook->SetFont( font );
516  m_notebook->SetNormalFont( font );
517  m_notebook->SetSelectedFont( font );
518  m_notebook->SetMeasuringFont( font );
519 
520  m_LayerPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize,
521  wxTAB_TRAVERSAL );
522 
523  wxBoxSizer* layerPanelSizer;
524  layerPanelSizer = new wxBoxSizer( wxVERTICAL );
525 
526  m_LayerScrolledWindow = new wxScrolledWindow( m_LayerPanel, wxID_ANY, wxDefaultPosition,
527  wxDefaultSize, wxNO_BORDER );
528  m_LayerScrolledWindow->SetScrollRate( 5, 5 );
529  m_LayersFlexGridSizer = new wxFlexGridSizer( 0, LYR_COLUMN_COUNT, 0, 1 );
530  m_LayersFlexGridSizer->SetFlexibleDirection( wxHORIZONTAL );
531  m_LayersFlexGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
532 
533  // Make column 3 growable/stretchable
534  m_LayersFlexGridSizer->AddGrowableCol( 3, 1 );
535 
537  m_LayerScrolledWindow->Layout();
539  layerPanelSizer->Add( m_LayerScrolledWindow, 1, wxBOTTOM | wxEXPAND | wxLEFT | wxTOP, 2 );
540 
541  m_LayerPanel->SetSizer( layerPanelSizer );
542  m_LayerPanel->Layout();
543  layerPanelSizer->Fit( m_LayerPanel );
544  m_notebook->AddPage( m_LayerPanel, _( "Layers" ), true );
545  m_RenderingPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize,
546  wxTAB_TRAVERSAL );
547 
548  wxBoxSizer* renderPanelSizer;
549  renderPanelSizer = new wxBoxSizer( wxVERTICAL );
550 
551  m_RenderScrolledWindow = new wxScrolledWindow( m_RenderingPanel, wxID_ANY, wxDefaultPosition,
552  wxDefaultSize, wxNO_BORDER );
553  m_RenderScrolledWindow->SetScrollRate( 5, 5 );
554  m_RenderFlexGridSizer = new wxFlexGridSizer( 0, RND_COLUMN_COUNT, 0, 1 );
555  m_RenderFlexGridSizer->SetFlexibleDirection( wxHORIZONTAL );
556  m_RenderFlexGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
557 
559  m_RenderScrolledWindow->Layout();
561  renderPanelSizer->Add( m_RenderScrolledWindow, 1, wxALL | wxEXPAND, 5 );
562 
563  m_RenderingPanel->SetSizer( renderPanelSizer );
564  m_RenderingPanel->Layout();
565  renderPanelSizer->Fit( m_RenderingPanel );
566  m_notebook->AddPage( m_RenderingPanel, _( "Items" ), false );
567 
568  mainSizer->Add( m_notebook, 1, wxEXPAND, 5 );
569 
570  SetSizer( mainSizer );
571 
572  m_FocusOwner = aFocusOwner;
573 
574  m_CurrentRow = -1; // hide the arrow initially
575 
576  // trap the tab changes so that we can call passOnFocus().
577  m_notebook->Bind( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, &LAYER_WIDGET::OnTabChange, this );
578 
579  Layout();
580 }
wxAuiNotebook * m_notebook
Definition: layer_widget.h:460
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48
int m_CurrentRow
selected row of layer list
Definition: layer_widget.h:469
Icon provider for the "standard" row indicators, for example in layer selection lists.
wxString m_smallestLayerString
Definition: layer_widget.h:474
void OnTabChange(wxNotebookEvent &event)
wxScrolledWindow * m_RenderScrolledWindow
Definition: layer_widget.h:465
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463
#define RND_COLUMN_COUNT
Rendering tab column count.
Definition: layer_widget.h:49
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466
wxPanel * m_RenderingPanel
Definition: layer_widget.h:464
wxScrolledWindow * m_LayerScrolledWindow
Definition: layer_widget.h:462
#define _(s)
wxWindow * m_FocusOwner
Definition: layer_widget.h:468
ROW_ICON_PROVIDER * m_IconProvider
Definition: layer_widget.h:472
wxPanel * m_LayerPanel
Definition: layer_widget.h:461

References _, LYR_COLUMN_COUNT, m_CurrentRow, m_FocusOwner, m_IconProvider, m_LayerPanel, m_LayerScrolledWindow, m_LayersFlexGridSizer, m_notebook, m_PointSize, m_RenderFlexGridSizer, m_RenderingPanel, m_RenderScrolledWindow, OnTabChange(), and RND_COLUMN_COUNT.

◆ ~LAYER_WIDGET()

LAYER_WIDGET::~LAYER_WIDGET ( )
virtual

Definition at line 583 of file layer_widget.cpp.

584 {
585  delete m_IconProvider;
586 }
ROW_ICON_PROVIDER * m_IconProvider
Definition: layer_widget.h:472

References m_IconProvider.

Member Function Documentation

◆ AppendLayerRow()

void LAYER_WIDGET::AppendLayerRow ( const ROW aRow)

Append a new row in the layer portion of the widget.

The user must ensure that ROW::id is unique for all existing rows on Windows.

Definition at line 655 of file layer_widget.cpp.

656 {
657  int nextRow = GetLayerRowCount();
658  insertLayerRow( nextRow, aRow );
659 }
int GetLayerRowCount() const
Return the number of rows in the layer tab.
void insertLayerRow(int aRow, const ROW &aSpec)
Append or insert a new row in the layer portion of the widget.

References GetLayerRowCount(), and insertLayerRow().

Referenced by AppendLayerRows(), and GERBER_LAYER_WIDGET::ReFill().

◆ AppendLayerRows()

void LAYER_WIDGET::AppendLayerRows ( const ROW aRowsArray,
int  aRowCount 
)
inline

Append new rows in the layer portion of the widget.

The user must ensure that ROW::id is unique for all existing rows on Windows.

Definition at line 175 of file layer_widget.h.

176  {
177  for( int row=0; row<aRowCount; ++row )
178  AppendLayerRow( aRowsArray[row] );
179 
180  UpdateLayouts();
181  }
void UpdateLayouts()
void AppendLayerRow(const ROW &aRow)
Append a new row in the layer portion of the widget.

References AppendLayerRow(), and UpdateLayouts().

◆ AppendRenderRow()

void LAYER_WIDGET::AppendRenderRow ( const ROW aRow)

Append a new row in the render portion of the widget.

The user must ensure that ROW::id is unique for all existing rows on Windows.

Definition at line 668 of file layer_widget.cpp.

669 {
670  int nextRow = GetRenderRowCount();
671  insertRenderRow( nextRow, aRow );
672 }
void insertRenderRow(int aRow, const ROW &aSpec)
int GetRenderRowCount() const
Return the number of rows in the render tab.

References GetRenderRowCount(), and insertRenderRow().

Referenced by AppendRenderRows().

◆ AppendRenderRows()

void LAYER_WIDGET::AppendRenderRows ( const ROW aRowsArray,
int  aRowCount 
)
inline

Append new rows in the render portion of the widget.

The user must ensure that ROW::id is unique for all existing rows on Windows.

Definition at line 200 of file layer_widget.h.

201  {
202  for( int row=0; row<aRowCount; ++row )
203  AppendRenderRow( aRowsArray[row] );
204 
205  UpdateLayouts();
206  }
void UpdateLayouts()
void AppendRenderRow(const ROW &aRow)
Append a new row in the render portion of the widget.

References AppendRenderRow(), and UpdateLayouts().

Referenced by GERBER_LAYER_WIDGET::ReFillRender().

◆ ClearLayerRows()

void LAYER_WIDGET::ClearLayerRows ( )

Empty out the layer rows.

Definition at line 662 of file layer_widget.cpp.

663 {
664  m_LayersFlexGridSizer->Clear( true );
665 }
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463

References m_LayersFlexGridSizer.

◆ ClearRenderRows()

void LAYER_WIDGET::ClearRenderRows ( )

Empty out the render rows.

Definition at line 675 of file layer_widget.cpp.

676 {
677  m_RenderFlexGridSizer->Clear( true );
678 }
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466

References m_RenderFlexGridSizer.

Referenced by GERBER_LAYER_WIDGET::ReFillRender().

◆ encodeId()

int LAYER_WIDGET::encodeId ( int  aColumn,
int  aId 
)
staticprotected

Allow saving a layer index within a control as its wxControl id.

To do so in a way that all child wxControl ids within a wxWindow are unique, since this is required by Windows.

See also
getDecodedId()

Definition at line 62 of file layer_widget.cpp.

63 {
64  int id = aId * LYR_COLUMN_COUNT + aColumn;
65  return id;
66 }
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48

References LYR_COLUMN_COUNT.

Referenced by insertLayerRow(), and insertRenderRow().

◆ findLayerRow()

int LAYER_WIDGET::findLayerRow ( LAYER_NUM  aLayer) const
protected

Return the row index that aLayer resides in, or -1 if not found.

Definition at line 274 of file layer_widget.cpp.

275 {
276  int count = GetLayerRowCount();
277 
278  for( int row = 0; row < count; ++row )
279  {
280  // column 0 in the layer scroll window has a wxStaticBitmap, get its ID.
281  wxWindow* w = getLayerComp( row, 0 );
282  wxASSERT( w );
283 
284  if( aLayer == getDecodedId( w->GetId() ) )
285  return row;
286  }
287 
288  return -1;
289 }
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
int GetLayerRowCount() const
Return the number of rows in the layer tab.

References getDecodedId(), getLayerComp(), and GetLayerRowCount().

Referenced by GetLayerColor(), IsLayerVisible(), OnLeftDownLayers(), GERBER_LAYER_WIDGET::ReFill(), SelectLayer(), setLayerCheckbox(), and SetLayerColor().

◆ findRenderRow()

int LAYER_WIDGET::findRenderRow ( int  aId) const
protected

Definition at line 303 of file layer_widget.cpp.

304 {
305  int count = GetRenderRowCount();
306 
307  for( int row = 0; row < count; ++row )
308  {
309  // column 0 in the layer scroll window has a wxStaticBitmap, get its ID.
310  wxWindow* w = getRenderComp( row, 0 );
311  wxASSERT( w );
312 
313  if( aId == getDecodedId( w->GetId() ) )
314  return row;
315  }
316 
317  return -1;
318 }
wxWindow * getRenderComp(int aRow, int aColumn) const
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
int GetRenderRowCount() const
Return the number of rows in the render tab.

References getDecodedId(), getRenderComp(), and GetRenderRowCount().

Referenced by GetRenderState(), and SetRenderState().

◆ getBackgroundLayerColor()

virtual COLOR4D LAYER_WIDGET::getBackgroundLayerColor ( )
inlineprotectedvirtual

Subclasses can override this to provide accurate representation of transparent color swatches.

Definition at line 364 of file layer_widget.h.

364 { return COLOR4D::BLACK; }
Definition: color4d.h:44

References BLACK.

Referenced by insertLayerRow(), and insertRenderRow().

◆ GetBestSize()

wxSize LAYER_WIDGET::GetBestSize ( ) const

Return the preferred minimum size, taking into consideration the dynamic content.

Nothing in wxWidgets was reliable enough so this overrides one of their functions.

Definition at line 589 of file layer_widget.cpp.

590 {
591  // size of m_LayerScrolledWindow --------------
592  wxArrayInt widths = m_LayersFlexGridSizer->GetColWidths();
593  int totWidth = 0;
594 
595  if( widths.GetCount() )
596  {
597  for( int i = 0; i < LYR_COLUMN_COUNT; ++i )
598  {
599  totWidth += widths[i] + m_LayersFlexGridSizer->GetHGap();
600  }
601  }
602 
603  // Account for the parent's frame:
604  totWidth += 15;
605 
606  /* The minimum height is a small size to properly force computation
607  * of the panel's scrollbars (otherwise it will assume it *has* all
608  * this space) */
609  unsigned totHeight = 32;
610 
611  wxSize layerz( totWidth, totHeight );
612 
613  layerz += m_LayerPanel->GetWindowBorderSize();
614 
615  // size of m_RenderScrolledWindow --------------
616  widths = m_RenderFlexGridSizer->GetColWidths();
617  totWidth = 0;
618 
619  if( widths.GetCount() )
620  {
621  for( int i = 0; i < RND_COLUMN_COUNT; ++i )
622  {
623  totWidth += widths[i] + m_RenderFlexGridSizer->GetHGap();
624  }
625  }
626 
627  // account for the parent's frame, this one has void space of 10 PLUS a border:
628  totWidth += 15;
629 
630  // For totHeight re-use the previous small one
631  wxSize renderz( totWidth, totHeight );
632 
633  renderz += m_RenderingPanel->GetWindowBorderSize();
634 
635  wxSize clientz( std::max(renderz.x,layerz.x), std::max(renderz.y,layerz.y) );
636 
637  return clientz;
638 }
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463
#define RND_COLUMN_COUNT
Rendering tab column count.
Definition: layer_widget.h:49
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466
wxPanel * m_RenderingPanel
Definition: layer_widget.h:464
wxPanel * m_LayerPanel
Definition: layer_widget.h:461

References LYR_COLUMN_COUNT, m_LayerPanel, m_LayersFlexGridSizer, m_RenderFlexGridSizer, m_RenderingPanel, and RND_COLUMN_COUNT.

Referenced by GERBVIEW_FRAME::GERBVIEW_FRAME(), and GERBVIEW_FRAME::ReFillLayerWidget().

◆ getDecodedId()

LAYER_NUM LAYER_WIDGET::getDecodedId ( int  aControlId)
staticprotected

Decode aControlId to original un-encoded value.

This holds if encodedId was called with a LAYER_NUM (this box is used for other things than layers, too).

Definition at line 69 of file layer_widget.cpp.

70 {
71  int id = aControlId / LYR_COLUMN_COUNT; // rounding is OK.
72  return id;
73 }
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48

References LYR_COLUMN_COUNT.

Referenced by findLayerRow(), findRenderRow(), GetSelectedLayer(), OnLayerCheckBox(), OnLayerSwatchChanged(), OnLeftDownLayers(), GERBER_LAYER_WIDGET::onPopupSelection(), OnRenderCheckBox(), and OnRenderSwatchChanged().

◆ GetLayerColor()

COLOR4D LAYER_WIDGET::GetLayerColor ( LAYER_NUM  aLayer) const

Return the color of the layer ROW associated with aLayer id.

Definition at line 785 of file layer_widget.cpp.

786 {
787  int row = findLayerRow( aLayer );
788 
789  if( row >= 0 )
790  {
791  int col = 1; // bitmap button is column 1
792  auto swatch = static_cast<COLOR_SWATCH*>( getLayerComp( row, col ) );
793  wxASSERT( swatch );
794 
795  return swatch->GetSwatchColor();
796  }
797 
798  return COLOR4D::UNSPECIFIED; // it's caller fault, gave me a bad layer
799 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...

References findLayerRow(), and getLayerComp().

◆ getLayerComp()

wxWindow * LAYER_WIDGET::getLayerComp ( int  aRow,
int  aColumn 
) const
protected

Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters are out of range.

Parameters
aRowis the row index
aColumnis the column
Returns
the component installed within the sizer at given grid coordinate.

Definition at line 263 of file layer_widget.cpp.

264 {
265  unsigned ndx = aRow * LYR_COLUMN_COUNT + aColumn;
266 
267  if( ndx < m_LayersFlexGridSizer->GetChildren().GetCount() )
268  return m_LayersFlexGridSizer->GetChildren()[ndx]->GetWindow();
269 
270  return nullptr;
271 }
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463

References LYR_COLUMN_COUNT, and m_LayersFlexGridSizer.

Referenced by findLayerRow(), GetLayerColor(), GetSelectedLayer(), IsLayerVisible(), OnLeftDownLayers(), GERBER_LAYER_WIDGET::onPopupSelection(), OnRenderSwatchChanged(), SelectLayerRow(), setLayerCheckbox(), SetLayerColor(), UpdateLayerIcons(), and updateLayerRow().

◆ GetLayerRowCount()

int LAYER_WIDGET::GetLayerRowCount ( ) const

Return the number of rows in the layer tab.

Definition at line 641 of file layer_widget.cpp.

642 {
643  int controlCount = m_LayersFlexGridSizer->GetChildren().GetCount();
644  return controlCount / LYR_COLUMN_COUNT;
645 }
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463

References LYR_COLUMN_COUNT, and m_LayersFlexGridSizer.

Referenced by AppendLayerRow(), findLayerRow(), OnLeftDownLayers(), GERBER_LAYER_WIDGET::onPopupSelection(), OnRenderSwatchChanged(), and UpdateLayerIcons().

◆ getRenderComp()

wxWindow * LAYER_WIDGET::getRenderComp ( int  aRow,
int  aColumn 
) const
protected

Definition at line 292 of file layer_widget.cpp.

293 {
294  int ndx = aRow * RND_COLUMN_COUNT + aColumn;
295 
296  if( (unsigned) ndx < m_RenderFlexGridSizer->GetChildren().GetCount() )
297  return m_RenderFlexGridSizer->GetChildren()[ndx]->GetWindow();
298 
299  return nullptr;
300 }
#define RND_COLUMN_COUNT
Rendering tab column count.
Definition: layer_widget.h:49
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466

References m_RenderFlexGridSizer, and RND_COLUMN_COUNT.

Referenced by findRenderRow(), GetRenderState(), OnRenderSwatchChanged(), and SetRenderState().

◆ GetRenderRowCount()

int LAYER_WIDGET::GetRenderRowCount ( ) const

Return the number of rows in the render tab.

Definition at line 648 of file layer_widget.cpp.

649 {
650  int controlCount = m_RenderFlexGridSizer->GetChildren().GetCount();
651  return controlCount / RND_COLUMN_COUNT;
652 }
#define RND_COLUMN_COUNT
Rendering tab column count.
Definition: layer_widget.h:49
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466

References m_RenderFlexGridSizer, and RND_COLUMN_COUNT.

Referenced by AppendRenderRow(), findRenderRow(), and OnRenderSwatchChanged().

◆ GetRenderState()

bool LAYER_WIDGET::GetRenderState ( int  aId)

Return the state of the checkbox associated with aId.

Returns
true if checked, else false.

Definition at line 816 of file layer_widget.cpp.

817 {
818  int row = findRenderRow( aId );
819 
820  if( row >= 0 )
821  {
822  int col = 1; // checkbox is column 1
823  wxCheckBox* cb = (wxCheckBox*) getRenderComp( row, col );
824  wxASSERT( cb );
825  return cb->GetValue();
826  }
827 
828  return false; // the value of a non-existent row
829 }
int findRenderRow(int aId) const
wxWindow * getRenderComp(int aRow, int aColumn) const

References findRenderRow(), and getRenderComp().

◆ GetSelectedLayer()

LAYER_NUM LAYER_WIDGET::GetSelectedLayer ( )

Return the selected layer or -1 if none.

Definition at line 724 of file layer_widget.cpp.

725 {
726  wxWindow* w = getLayerComp( m_CurrentRow, 0 );
727 
728  if( w )
729  return getDecodedId( w->GetId() );
730 
731  return UNDEFINED_LAYER;
732 }
int m_CurrentRow
selected row of layer list
Definition: layer_widget.h:469
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.

References getDecodedId(), getLayerComp(), m_CurrentRow, and UNDEFINED_LAYER.

◆ insertLayerRow()

void LAYER_WIDGET::insertLayerRow ( int  aRow,
const ROW aSpec 
)
protected

Append or insert a new row in the layer portion of the widget.

Definition at line 321 of file layer_widget.cpp.

322 {
323  wxASSERT( aRow >= 0 );
324 
325  int col;
326  int index = aRow * LYR_COLUMN_COUNT;
327  const int flags = wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT;
328 
329  // column 0
330  col = COLUMN_ICON_ACTIVE;
332  ROW_ICON_PROVIDER::STATE::OFF, encodeId( col, aSpec.id ) );
333  sbm->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
334  m_LayersFlexGridSizer->wxSizer::Insert( index+col, sbm, 0, flags );
335 
336  // column 1 (COLUMN_COLORBM)
337  col = COLUMN_COLORBM;
338 
339  auto bmb = new COLOR_SWATCH( m_LayerScrolledWindow, aSpec.color, encodeId( col, aSpec.id ),
340  getBackgroundLayerColor(), aSpec.defaultColor, SWATCH_SMALL );
341  bmb->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
342  bmb->Bind( COLOR_SWATCH_CHANGED, &LAYER_WIDGET::OnLayerSwatchChanged, this );
343  bmb->SetToolTip( _("Left double click or middle click for color change, right click for "
344  "menu" ) );
345  m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags );
346 
347  // column 2 (COLUMN_COLOR_LYR_CB)
348  col = COLUMN_COLOR_LYR_CB;
349  wxCheckBox* cb = new wxCheckBox( m_LayerScrolledWindow, encodeId( col, aSpec.id ),
350  wxEmptyString );
351  cb->SetValue( aSpec.state );
352  cb->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, &LAYER_WIDGET::OnLayerCheckBox, this );
353  cb->SetToolTip( _( "Enable this for visibility" ) );
354  m_LayersFlexGridSizer->wxSizer::Insert( index+col, cb, 0, flags );
355 
356  // column 3 (COLUMN_COLOR_LYRNAME)
357  col = COLUMN_COLOR_LYRNAME;
359  encodeId( col, aSpec.id ),
360  aSpec.rowName, wxDefaultPosition,
361  wxDefaultSize,
362  wxST_ELLIPSIZE_MIDDLE );
363  shrinkFont( st, m_PointSize );
364  st->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
365  st->SetToolTip( aSpec.tooltip );
367  m_LayersFlexGridSizer->wxSizer::Insert( index+col, st, 0, flags | wxEXPAND );
368 
369  // column 4 (COLUMN_ALPHA_INDICATOR)
372  ROW_ICON_PROVIDER::STATE::OFF, wxID_ANY );
373  m_LayersFlexGridSizer->wxSizer::Insert( index+col, sbm, 0, flags );
374 
375  // Bind right click eventhandler to all columns
376  wxString layerName( aSpec.rowName );
377 
378  sbm->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt )
379  {
380  OnRightDownLayer( aEvt, bmb, layerName );
381  } );
382  bmb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt )
383  {
384  OnRightDownLayer( aEvt, bmb, layerName );
385  } );
386  cb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt )
387  {
388  OnRightDownLayer( aEvt, bmb, layerName );
389  } );
390  st->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt )
391  {
392  OnRightDownLayer( aEvt, bmb, layerName );
393  } );
394 }
#define COLUMN_COLOR_LYRNAME
Definition: layer_widget.h:54
void OnLeftDownLayers(wxMouseEvent &event)
#define LYR_COLUMN_COUNT
Layer tab column count.
Definition: layer_widget.h:48
wxString m_smallestLayerString
Definition: layer_widget.h:474
#define COLUMN_ALPHA_INDICATOR
Definition: layer_widget.h:55
void SetMinimumStringLength(const wxString &aString)
Set the string that is used for determining the requested size of the control.
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463
static void shrinkFont(wxWindow *aControl, int aPointSize)
Reduce the size of the wxFont associated with aControl.
void OnLayerCheckBox(wxCommandEvent &event)
Handle the "is layer visible" checkbox and propagates the event to the client's notification function...
static int encodeId(int aColumn, int aId)
Allow saving a layer index within a control as its wxControl id.
representing a row indicator icon for use in places like the layer widget
#define COLUMN_ICON_ACTIVE
Definition: layer_widget.h:51
#define COLUMN_COLORBM
Definition: layer_widget.h:52
wxScrolledWindow * m_LayerScrolledWindow
Definition: layer_widget.h:462
#define _(s)
A version of a wxStaticText control that will request a smaller size than the full string.
void OnRightDownLayer(wxMouseEvent &event, COLOR_SWATCH *aColorSwatch, const wxString &aLayerName)
Called when user right-clicks a layer.
#define COLUMN_COLOR_LYR_CB
Definition: layer_widget.h:53
virtual COLOR4D getBackgroundLayerColor()
Subclasses can override this to provide accurate representation of transparent color swatches.
Definition: layer_widget.h:364
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56
void OnLayerSwatchChanged(wxCommandEvent &aEvent)
Called when a user changes a swatch color.
ROW_ICON_PROVIDER * m_IconProvider
Definition: layer_widget.h:472

References _, LAYER_WIDGET::ROW::color, COLUMN_ALPHA_INDICATOR, COLUMN_COLOR_LYR_CB, COLUMN_COLOR_LYRNAME, COLUMN_COLORBM, COLUMN_ICON_ACTIVE, LAYER_WIDGET::ROW::defaultColor, encodeId(), getBackgroundLayerColor(), LAYER_WIDGET::ROW::id, LYR_COLUMN_COUNT, m_IconProvider, m_LayerScrolledWindow, m_LayersFlexGridSizer, m_PointSize, m_smallestLayerString, OnLayerCheckBox(), OnLayerSwatchChanged(), OnLeftDownLayers(), OnRightDownLayer(), LAYER_WIDGET::ROW::rowName, WX_ELLIPSIZED_STATIC_TEXT::SetMinimumStringLength(), shrinkFont(), LAYER_WIDGET::ROW::state, SWATCH_SMALL, and LAYER_WIDGET::ROW::tooltip.

Referenced by AppendLayerRow().

◆ insertRenderRow()

void LAYER_WIDGET::insertRenderRow ( int  aRow,
const ROW aSpec 
)
protected

Definition at line 418 of file layer_widget.cpp.

419 {
420  wxASSERT( aRow >= 0 );
421 
422  int col;
423  int index = aRow * RND_COLUMN_COUNT;
424  const int flags = wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT;
425 
426  wxString renderName( aSpec.rowName );
427  wxCheckBox* cb = nullptr;
428 
429  // column 1
430  if( !aSpec.spacer )
431  {
432  col = 1;
433  cb = new wxCheckBox( m_RenderScrolledWindow, encodeId( col, aSpec.id ),
434  aSpec.rowName, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
435  shrinkFont( cb, m_PointSize );
436  cb->SetValue( aSpec.state );
437  cb->Enable( aSpec.changeable );
438  cb->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, &LAYER_WIDGET::OnRenderCheckBox, this );
439  cb->SetToolTip( aSpec.tooltip );
440  }
441 
442  // column 0
443  col = 0;
444 
445  if( aSpec.color != COLOR4D::UNSPECIFIED )
446  {
447  auto bmb = new COLOR_SWATCH( m_RenderScrolledWindow, aSpec.color, encodeId( col, aSpec.id ),
448  getBackgroundLayerColor(), aSpec.defaultColor, SWATCH_SMALL );
449  bmb->Bind( COLOR_SWATCH_CHANGED, &LAYER_WIDGET::OnRenderSwatchChanged, this );
450  bmb->SetToolTip( _( "Left double click or middle click for color change" ) );
451  m_RenderFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags );
452 
453  bmb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, renderName] ( wxMouseEvent& aEvt ) {
454  OnRightDownRender( aEvt, bmb, renderName );
455  } );
456  cb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, renderName] ( wxMouseEvent& aEvt ) {
457  OnRightDownRender( aEvt, bmb, renderName );
458  } );
459 
460  // could add a left click handler on the color button that toggles checkbox.
461  }
462  else // == -1, no color selection wanted
463  {
464  // need a place holder within the sizer to keep grid full.
465  wxPanel* invisible = new wxPanel( m_RenderScrolledWindow, encodeId( col, aSpec.id ) );
466  m_RenderFlexGridSizer->wxSizer::Insert( index+col, invisible, 0, flags );
467  }
468 
469  // Items have to be inserted in order
470  col = 1;
471 
472  if( aSpec.spacer )
473  {
474  wxPanel* invisible = new wxPanel( m_RenderScrolledWindow, wxID_ANY );
475  m_RenderFlexGridSizer->wxSizer::Insert( index+col, invisible, 0, flags );
476  }
477  else
478  {
479  m_RenderFlexGridSizer->wxSizer::Insert( index+col, cb, 0, flags );
480  }
481 }
wxScrolledWindow * m_RenderScrolledWindow
Definition: layer_widget.h:465
static void shrinkFont(wxWindow *aControl, int aPointSize)
Reduce the size of the wxFont associated with aControl.
#define RND_COLUMN_COUNT
Rendering tab column count.
Definition: layer_widget.h:49
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466
void OnRenderCheckBox(wxCommandEvent &event)
static int encodeId(int aColumn, int aId)
Allow saving a layer index within a control as its wxControl id.
void OnRightDownRender(wxMouseEvent &aEvent, COLOR_SWATCH *aColorSwatch, const wxString &aRenderName)
Notify when user right-clicks a render option.
#define _(s)
void OnRenderSwatchChanged(wxCommandEvent &aEvent)
Called when user has changed the swatch color of a render entry.
virtual COLOR4D getBackgroundLayerColor()
Subclasses can override this to provide accurate representation of transparent color swatches.
Definition: layer_widget.h:364
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56

References _, LAYER_WIDGET::ROW::changeable, LAYER_WIDGET::ROW::color, LAYER_WIDGET::ROW::defaultColor, encodeId(), getBackgroundLayerColor(), LAYER_WIDGET::ROW::id, m_PointSize, m_RenderFlexGridSizer, m_RenderScrolledWindow, OnRenderCheckBox(), OnRenderSwatchChanged(), OnRightDownRender(), RND_COLUMN_COUNT, LAYER_WIDGET::ROW::rowName, shrinkFont(), LAYER_WIDGET::ROW::spacer, LAYER_WIDGET::ROW::state, SWATCH_SMALL, and LAYER_WIDGET::ROW::tooltip.

Referenced by AppendRenderRow().

◆ IsLayerVisible()

bool LAYER_WIDGET::IsLayerVisible ( LAYER_NUM  aLayer)

Return the visible state of the layer ROW associated with aLayer id.

Definition at line 755 of file layer_widget.cpp.

756 {
757  int row = findLayerRow( aLayer );
758 
759  if( row >= 0 )
760  {
761  wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
762  wxASSERT( cb );
763  return cb->GetValue();
764  }
765 
766  return false;
767 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
#define COLUMN_COLOR_LYR_CB
Definition: layer_widget.h:53

References COLUMN_COLOR_LYR_CB, findLayerRow(), and getLayerComp().

Referenced by GERBVIEW_FRAME::IsLayerVisible().

◆ OnLayerCheckBox()

void LAYER_WIDGET::OnLayerCheckBox ( wxCommandEvent &  event)
protected

Handle the "is layer visible" checkbox and propagates the event to the client's notification function.

Definition at line 170 of file layer_widget.cpp.

171 {
172  wxCheckBox* eventSource = (wxCheckBox*) event.GetEventObject();
173  LAYER_NUM layer = getDecodedId( eventSource->GetId() );
174  OnLayerVisible( layer, eventSource->IsChecked() );
175  passOnFocus();
176 }
virtual void OnLayerVisible(LAYER_NUM aLayer, bool isVisible, bool isFinal=true)=0
Notify client code about a layer visibility change.
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:40
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
void passOnFocus()
Give away the keyboard focus up to the main parent window.

References getDecodedId(), OnLayerVisible(), and passOnFocus().

Referenced by insertLayerRow().

◆ OnLayerColorChange()

virtual void LAYER_WIDGET::OnLayerColorChange ( int  aLayer,
const COLOR4D aColor 
)
pure virtual

Notify client code about a layer color change.

Derived objects will handle this accordingly.

Parameters
aLayeris the board layer to change.
aColoris the new color.

Implemented in GERBER_LAYER_WIDGET.

Referenced by OnLayerSwatchChanged().

◆ OnLayerRightClick()

virtual void LAYER_WIDGET::OnLayerRightClick ( wxMenu &  aMenu)
pure virtual

Notify client code about a layer being right-clicked.

Parameters
aMenuis the right-click menu containing layer-scoped options.

Implemented in GERBER_LAYER_WIDGET.

Referenced by OnRightDownLayer().

◆ OnLayerSelect()

virtual bool LAYER_WIDGET::OnLayerSelect ( int  aLayer)
pure virtual

Notify client code whenever the user selects a different layer.

Derived classes will handle this accordingly, and can deny the change by returning false.

Parameters
aLayeris the board layer to select.

Implemented in GERBER_LAYER_WIDGET.

Referenced by OnLeftDownLayers().

◆ OnLayerSwatchChanged()

void LAYER_WIDGET::OnLayerSwatchChanged ( wxCommandEvent &  aEvent)
protected

Called when a user changes a swatch color.

Definition at line 153 of file layer_widget.cpp.

154 {
155  COLOR_SWATCH* eventSource = static_cast<COLOR_SWATCH*>( aEvent.GetEventObject() );
156  COLOR4D newColor = eventSource->GetSwatchColor();
157  LAYER_NUM layer = getDecodedId( eventSource->GetId() );
158 
159  // tell the client code.
160  OnLayerColorChange( layer, newColor );
161 
162  // notify others
163  wxCommandEvent event( EVT_LAYER_COLOR_CHANGE );
164  wxPostEvent( this, event );
165 
166  passOnFocus();
167 }
virtual void OnLayerColorChange(int aLayer, const COLOR4D &aColor)=0
Notify client code about a layer color change.
KIGFX::COLOR4D GetSwatchColor() const
static const wxEventType EVT_LAYER_COLOR_CHANGE
Definition: layer_widget.h:120
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:40
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
void passOnFocus()
Give away the keyboard focus up to the main parent window.
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References EVT_LAYER_COLOR_CHANGE, getDecodedId(), COLOR_SWATCH::GetSwatchColor(), OnLayerColorChange(), and passOnFocus().

Referenced by insertLayerRow().

◆ OnLayerVisible()

virtual void LAYER_WIDGET::OnLayerVisible ( LAYER_NUM  aLayer,
bool  isVisible,
bool  isFinal = true 
)
pure virtual

Notify client code about a layer visibility change.

Parameters
aLayeris the board layer to select.
isVisibleis the new visible state.
isFinalis true when this is the last of potentially several such calls, and can be used to decide when to update the screen only one time instead of several times in the midst of a multiple layer change.

Implemented in GERBER_LAYER_WIDGET.

Referenced by OnLayerCheckBox(), and SetLayerVisible().

◆ OnLeftDownLayers()

void LAYER_WIDGET::OnLeftDownLayers ( wxMouseEvent &  event)
protected

Definition at line 76 of file layer_widget.cpp.

77 {
78  int row;
79  LAYER_NUM layer;
80 
81  wxWindow* eventSource = (wxWindow*) event.GetEventObject();
82 
83  // if mouse event is coming from the m_LayerScrolledWindow and not one
84  // of its children, we have to find the row manually based on y coord.
85  if( eventSource == m_LayerScrolledWindow )
86  {
87  int y = event.GetY();
88 
89  wxArrayInt heights = m_LayersFlexGridSizer->GetRowHeights();
90 
91  int height = 0;
92 
93  int rowCount = GetLayerRowCount();
94 
95  for( row = 0; row<rowCount; ++row )
96  {
97  if( y < height + heights[row] )
98  break;
99 
100  height += heights[row];
101  }
102 
103  if( row >= rowCount )
104  row = rowCount - 1;
105 
106  layer = getDecodedId( getLayerComp( row, 0 )->GetId() );
107  }
108  else
109  {
110  // all nested controls on a given row will have their ID encoded with
111  // encodeId(), and the corresponding decoding is getDecodedId()
112  int id = eventSource->GetId();
113  layer = getDecodedId( id );
114  row = findLayerRow( layer );
115  }
116 
117  if( OnLayerSelect( layer ) ) // if client allows this change.
118  SelectLayerRow( row );
119 
120  passOnFocus();
121 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:40
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
wxScrolledWindow * m_LayerScrolledWindow
Definition: layer_widget.h:462
void SelectLayerRow(int aRow)
Change the row selection in the layer list to the given row.
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
int GetLayerRowCount() const
Return the number of rows in the layer tab.
void passOnFocus()
Give away the keyboard focus up to the main parent window.
virtual bool OnLayerSelect(int aLayer)=0
Notify client code whenever the user selects a different layer.

References findLayerRow(), getDecodedId(), getLayerComp(), GetLayerRowCount(), m_LayerScrolledWindow, m_LayersFlexGridSizer, OnLayerSelect(), passOnFocus(), and SelectLayerRow().

Referenced by insertLayerRow().

◆ OnRenderCheckBox()

void LAYER_WIDGET::OnRenderCheckBox ( wxCommandEvent &  event)
protected

Definition at line 244 of file layer_widget.cpp.

245 {
246  wxCheckBox* eventSource = (wxCheckBox*) event.GetEventObject();
247  LAYER_NUM id = getDecodedId( eventSource->GetId() );
248  OnRenderEnable( id, eventSource->IsChecked() );
249  passOnFocus();
250 }
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:40
virtual void OnRenderEnable(int aId, bool isEnabled)=0
Notify client code whenever the user changes an rendering enable in one of the rendering checkboxes.
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
void passOnFocus()
Give away the keyboard focus up to the main parent window.

References getDecodedId(), OnRenderEnable(), and passOnFocus().

Referenced by insertRenderRow().

◆ OnRenderColorChange()

virtual void LAYER_WIDGET::OnRenderColorChange ( int  aId,
const COLOR4D aColor 
)
pure virtual

Notify client code whenever the user changes a rendering color.

Parameters
aIdis the same id that was established in a Rendering row via the AddRenderRow() function.
aColoris the new color.

Implemented in GERBER_LAYER_WIDGET.

Referenced by OnRenderSwatchChanged().

◆ OnRenderEnable()

virtual void LAYER_WIDGET::OnRenderEnable ( int  aId,
bool  isEnabled 
)
pure virtual

Notify client code whenever the user changes an rendering enable in one of the rendering checkboxes.

Parameters
aIdis the same id that was established in a Rendering row via the AddRenderRow() function.
isEnabledis the state of the checkbox, true if checked.

Implemented in GERBER_LAYER_WIDGET.

Referenced by OnRenderCheckBox().

◆ OnRenderSwatchChanged()

void LAYER_WIDGET::OnRenderSwatchChanged ( wxCommandEvent &  aEvent)
protected

Called when user has changed the swatch color of a render entry.

Definition at line 202 of file layer_widget.cpp.

203 {
204  auto eventSource = static_cast<COLOR_SWATCH*>( aEvent.GetEventObject() );
205 
206  COLOR4D newColor = eventSource->GetSwatchColor();
207 
208  LAYER_NUM id = getDecodedId( eventSource->GetId() );
209 
210  if( id == LAYER_PCB_BACKGROUND )
211  {
212  // Update all swatch backgrounds
213  int count = GetLayerRowCount();
214  int row;
215  int col = 1; // bitmap button is column 1 in layers tab
216 
217  for( row = 0; row < count; ++row )
218  {
219  COLOR_SWATCH* swatch = dynamic_cast<COLOR_SWATCH*>( getLayerComp( row, col ) );
220 
221  if( swatch )
222  swatch->SetSwatchBackground( newColor );
223  }
224 
225  count = GetRenderRowCount();
226  col = 0; // bitmap button is column 0 in render tab
227 
228  for( row = 0; row < count; ++row )
229  {
230  COLOR_SWATCH* swatch = dynamic_cast<COLOR_SWATCH*>( getRenderComp( row, col ) );
231 
232  if( swatch )
233  swatch->SetSwatchBackground( newColor );
234  }
235  }
236 
237  // tell the client code.
238  OnRenderColorChange( id, newColor );
239 
240  passOnFocus();
241 }
int LAYER_NUM
This can be replaced with int and removed.
Definition: layer_ids.h:40
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
virtual void OnRenderColorChange(int aId, const COLOR4D &aColor)=0
Notify client code whenever the user changes a rendering color.
wxWindow * getRenderComp(int aRow, int aColumn) const
static LAYER_NUM getDecodedId(int aControlId)
Decode aControlId to original un-encoded value.
int GetLayerRowCount() const
Return the number of rows in the layer tab.
void passOnFocus()
Give away the keyboard focus up to the main parent window.
A simple color swatch of the kind used to set layer colors.
Definition: color_swatch.h:56
PCB background color.
Definition: layer_ids.h:215
int GetRenderRowCount() const
Return the number of rows in the render tab.
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References getDecodedId(), getLayerComp(), GetLayerRowCount(), getRenderComp(), GetRenderRowCount(), LAYER_PCB_BACKGROUND, OnRenderColorChange(), passOnFocus(), and COLOR_SWATCH::SetSwatchBackground().

Referenced by insertRenderRow().

◆ OnRightDownLayer()

void LAYER_WIDGET::OnRightDownLayer ( wxMouseEvent &  event,
COLOR_SWATCH aColorSwatch,
const wxString &  aLayerName 
)
protected

Called when user right-clicks a layer.

Definition at line 124 of file layer_widget.cpp.

126 {
127  wxMenu menu;
128 
130  _( "Change Layer Color for" ) + wxS( " " ) + aLayerName,
132  menu.AppendSeparator();
133 
134  OnLayerRightClick( menu );
135 
136  menu.Bind( wxEVT_COMMAND_MENU_SELECTED, [aColorSwatch]( wxCommandEvent& event )
137  {
138  if( event.GetId() == ID_CHANGE_LAYER_COLOR )
139  {
140  aColorSwatch->GetNewSwatchColor();
141  }
142  else
143  {
144  event.Skip();
145  }
146  } );
147 
148  PopupMenu( &menu );
149  passOnFocus();
150 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
Definition: bitmap.cpp:254
#define _(s)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
void passOnFocus()
Give away the keyboard focus up to the main parent window.
virtual void OnLayerRightClick(wxMenu &aMenu)=0
Notify client code about a layer being right-clicked.
void GetNewSwatchColor()
Prompt for a new colour, using the colour picker dialog.

References _, AddMenuItem(), color_materials, COLOR_SWATCH::GetNewSwatchColor(), ID_CHANGE_LAYER_COLOR, KiBitmap(), OnLayerRightClick(), and passOnFocus().

Referenced by insertLayerRow().

◆ OnRightDownRender()

void LAYER_WIDGET::OnRightDownRender ( wxMouseEvent &  aEvent,
COLOR_SWATCH aColorSwatch,
const wxString &  aRenderName 
)
protected

Notify when user right-clicks a render option.

Definition at line 179 of file layer_widget.cpp.

181 {
182  wxMenu menu;
183 
185  _( "Change Render Color for" ) + wxS( " " )+ aRenderName,
187 
188  menu.Bind( wxEVT_COMMAND_MENU_SELECTED,
189  [aColorSwatch]( wxCommandEvent& event )
190  {
191  if( event.GetId() == ID_CHANGE_RENDER_COLOR )
192  aColorSwatch->GetNewSwatchColor();
193  else
194  event.Skip();
195  } );
196 
197  PopupMenu( &menu );
198  passOnFocus();
199 }
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Create and insert a menu item with an icon into aMenu.
Definition: bitmap.cpp:254
#define _(s)
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
void passOnFocus()
Give away the keyboard focus up to the main parent window.
void GetNewSwatchColor()
Prompt for a new colour, using the colour picker dialog.

References _, AddMenuItem(), color_materials, COLOR_SWATCH::GetNewSwatchColor(), ID_CHANGE_RENDER_COLOR, KiBitmap(), and passOnFocus().

Referenced by insertRenderRow().

◆ OnTabChange()

void LAYER_WIDGET::OnTabChange ( wxNotebookEvent &  event)
protected

Definition at line 253 of file layer_widget.cpp.

254 {
255 // wxFocusEvent event( wxEVT_SET_FOCUS );
256 // m_FocusOwner->AddPendingEvent( event );
257 
258  // Does not work in this context, probably because we have receive control here too early.
259  passOnFocus();
260 }
void passOnFocus()
Give away the keyboard focus up to the main parent window.

References passOnFocus().

Referenced by LAYER_WIDGET().

◆ passOnFocus()

void LAYER_WIDGET::passOnFocus ( )
protected

Give away the keyboard focus up to the main parent window.

Definition at line 484 of file layer_widget.cpp.

485 {
486  m_FocusOwner->SetFocus();
487 }
wxWindow * m_FocusOwner
Definition: layer_widget.h:468

References m_FocusOwner.

Referenced by OnLayerCheckBox(), OnLayerSwatchChanged(), OnLeftDownLayers(), OnRenderCheckBox(), OnRenderSwatchChanged(), OnRightDownLayer(), GERBER_LAYER_WIDGET::onRightDownLayers(), OnRightDownRender(), OnTabChange(), and SelectLayerRow().

◆ SelectLayer()

void LAYER_WIDGET::SelectLayer ( LAYER_NUM  aLayer)

Change the row selection in the layer list to aLayer provided.

Definition at line 717 of file layer_widget.cpp.

718 {
719  int row = findLayerRow( aLayer );
720  SelectLayerRow( row );
721 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
void SelectLayerRow(int aRow)
Change the row selection in the layer list to the given row.

References findLayerRow(), and SelectLayerRow().

Referenced by GERBVIEW_FRAME::SetActiveLayer(), and GERBVIEW_FRAME::syncLayerWidget().

◆ SelectLayerRow()

void LAYER_WIDGET::SelectLayerRow ( int  aRow)

Change the row selection in the layer list to the given row.

Definition at line 681 of file layer_widget.cpp.

682 {
683  // enable the layer tab at index 0
684  m_notebook->SetSelection( 0 );
685 
686  INDICATOR_ICON* oldIndicator = (INDICATOR_ICON*) getLayerComp( m_CurrentRow, 0 );
687 
688  if( oldIndicator )
689  {
691  oldIndicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::DIMMED );
692  else
693  oldIndicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::OFF );
694  }
695 
696  INDICATOR_ICON* newIndicator = (INDICATOR_ICON*) getLayerComp( aRow, 0 );
697 
698  if( newIndicator )
699  {
701 
702  // Make sure the desired layer row is visible.
703  // It seems that as of 2.8.2, setting the focus does this.
704  // I don't expect the scrolling to be needed at all because
705  // the minimum window size may end up being established so that the
706  // scroll bars will not be visible.
707  getLayerComp( aRow, 1 )->SetFocus();
708  }
709 
710  m_CurrentRow = aRow;
711 
712  // give the focus back to the app.
713  passOnFocus();
714 }
void SetIndicatorState(ICON_ID aIconId)
Set the row indicator to the given state.
wxAuiNotebook * m_notebook
Definition: layer_widget.h:460
int m_CurrentRow
selected row of layer list
Definition: layer_widget.h:469
#define ON
virtual bool useAlternateBitmap(int aRow)
Definition: layer_widget.h:358
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
representing a row indicator icon for use in places like the layer widget
void passOnFocus()
Give away the keyboard focus up to the main parent window.

References getLayerComp(), m_CurrentRow, m_notebook, ON, passOnFocus(), INDICATOR_ICON::SetIndicatorState(), and useAlternateBitmap().

Referenced by OnLeftDownLayers(), and SelectLayer().

◆ setLayerCheckbox()

void LAYER_WIDGET::setLayerCheckbox ( LAYER_NUM  aLayer,
bool  isVisible 
)
protected

Definition at line 742 of file layer_widget.cpp.

743 {
744  int row = findLayerRow( aLayer );
745 
746  if( row >= 0 )
747  {
748  wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
749  wxASSERT( cb );
750  cb->SetValue( isVisible ); // does not fire an event
751  }
752 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
#define COLUMN_COLOR_LYR_CB
Definition: layer_widget.h:53

References COLUMN_COLOR_LYR_CB, findLayerRow(), and getLayerComp().

Referenced by SetLayerVisible().

◆ SetLayerColor()

void LAYER_WIDGET::SetLayerColor ( LAYER_NUM  aLayer,
const COLOR4D aColor 
)

Change the color of aLayer.

Definition at line 770 of file layer_widget.cpp.

771 {
772  int row = findLayerRow( aLayer );
773 
774  if( row >= 0 )
775  {
776  int col = 1; // bitmap button is column 1
777  auto swatch = static_cast<COLOR_SWATCH*>( getLayerComp( row, col ) );
778  wxASSERT( swatch );
779 
780  swatch->SetSwatchColor( aColor, false );
781  }
782 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...

References findLayerRow(), and getLayerComp().

◆ SetLayerVisible()

void LAYER_WIDGET::SetLayerVisible ( LAYER_NUM  aLayer,
bool  isVisible 
)

Set aLayer visible or not.

This does not invoke OnLayerVisible().

Definition at line 735 of file layer_widget.cpp.

736 {
737  setLayerCheckbox( aLayer, isVisible );
738  OnLayerVisible( aLayer, isVisible );
739 }
virtual void OnLayerVisible(LAYER_NUM aLayer, bool isVisible, bool isFinal=true)=0
Notify client code about a layer visibility change.
void setLayerCheckbox(LAYER_NUM aLayer, bool isVisible)

References OnLayerVisible(), and setLayerCheckbox().

Referenced by GERBER_LAYER_WIDGET::ReFill().

◆ SetRenderState()

void LAYER_WIDGET::SetRenderState ( int  aId,
bool  isSet 
)

Set the state of the checkbox associated with aId within the Render tab group of the widget.

This does not fire an event, i.e. does not invoke OnRenderEnable().

Parameters
aIdis the same unique id used when adding a ROW to the Render tab.
isSetis the new checkbox state.

Definition at line 802 of file layer_widget.cpp.

803 {
804  int row = findRenderRow( aId );
805 
806  if( row >= 0 )
807  {
808  int col = 1; // checkbox is column 1
809  wxCheckBox* cb = (wxCheckBox*) getRenderComp( row, col );
810  wxASSERT( cb );
811  cb->SetValue( isSet ); // does not fire an event
812  }
813 }
int findRenderRow(int aId) const
wxWindow * getRenderComp(int aRow, int aColumn) const

References findRenderRow(), and getRenderComp().

Referenced by GERBVIEW_FRAME::SetElementVisibility(), and GERBVIEW_FRAME::SetGridVisibility().

◆ SetSmallestLayerString()

void LAYER_WIDGET::SetSmallestLayerString ( const wxString &  aString)
inline

Set the string that is used for determining the smallest string displayed in the layer's tab.

Definition at line 141 of file layer_widget.h.

142  {
143  m_smallestLayerString = aString;
144  }
wxString m_smallestLayerString
Definition: layer_widget.h:474

References m_smallestLayerString.

Referenced by GERBVIEW_FRAME::GERBVIEW_FRAME().

◆ UpdateLayerIcons()

void LAYER_WIDGET::UpdateLayerIcons ( )

Update all layer manager icons (layers only).

Useful when loading a file or clearing a layer because they change, and the indicator arrow icon needs to be updated

Definition at line 842 of file layer_widget.cpp.

843 {
844  int rowCount = GetLayerRowCount();
845 
846  for( int row = 0; row < rowCount ; row++ )
847  {
849 
850  if( indicator )
851  {
853 
854  if( row == m_CurrentRow )
856  else if( useAlternateBitmap( row ) )
857  state = ROW_ICON_PROVIDER::STATE::DIMMED;
858  else
859  state = ROW_ICON_PROVIDER::STATE::OFF;
860 
861  indicator->SetIndicatorState( state );
862  }
863  }
864 }
void SetIndicatorState(ICON_ID aIconId)
Set the row indicator to the given state.
int m_CurrentRow
selected row of layer list
Definition: layer_widget.h:469
#define ON
virtual bool useAlternateBitmap(int aRow)
Definition: layer_widget.h:358
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
representing a row indicator icon for use in places like the layer widget
#define COLUMN_ICON_ACTIVE
Definition: layer_widget.h:51
int GetLayerRowCount() const
Return the number of rows in the layer tab.
STATE
< State constants to select the right icons

References COLUMN_ICON_ACTIVE, getLayerComp(), GetLayerRowCount(), m_CurrentRow, ON, INDICATOR_ICON::SetIndicatorState(), and useAlternateBitmap().

Referenced by GERBVIEW_FRAME::LoadExcellonFiles(), GERBVIEW_FRAME::LoadListOfGerberAndDrillFiles(), and GERBVIEW_FRAME::LoadZipArchiveFile().

◆ updateLayerRow()

void LAYER_WIDGET::updateLayerRow ( int  aRow,
const wxString &  aName 
)
protected

Definition at line 397 of file layer_widget.cpp.

398 {
399  wxStaticText* label = dynamic_cast<wxStaticText*>( getLayerComp( aRow, COLUMN_COLOR_LYRNAME ) );
400 
401  if( label )
402  label->SetLabel( aName );
403 
404  INDICATOR_ICON* indicator = (INDICATOR_ICON*) getLayerComp( aRow, 0 );
405 
406  if( indicator )
407  {
408  if( aRow == m_CurrentRow )
410  if( useAlternateBitmap( aRow ) )
411  indicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::DIMMED );
412  else
413  indicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::OFF );
414  }
415 }
#define COLUMN_COLOR_LYRNAME
Definition: layer_widget.h:54
void SetIndicatorState(ICON_ID aIconId)
Set the row indicator to the given state.
int m_CurrentRow
selected row of layer list
Definition: layer_widget.h:469
#define ON
virtual bool useAlternateBitmap(int aRow)
Definition: layer_widget.h:358
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
representing a row indicator icon for use in places like the layer widget

References COLUMN_COLOR_LYRNAME, getLayerComp(), m_CurrentRow, ON, INDICATOR_ICON::SetIndicatorState(), and useAlternateBitmap().

Referenced by GERBER_LAYER_WIDGET::ReFill().

◆ UpdateLayouts()

void LAYER_WIDGET::UpdateLayouts ( )

Definition at line 832 of file layer_widget.cpp.

833 {
834  m_LayersFlexGridSizer->Layout();
835  m_RenderFlexGridSizer->Layout();
836  m_LayerPanel->Layout();
837  m_RenderingPanel->Layout();
838  FitInside();
839 }
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466
wxPanel * m_RenderingPanel
Definition: layer_widget.h:464
wxPanel * m_LayerPanel
Definition: layer_widget.h:461

References m_LayerPanel, m_LayersFlexGridSizer, m_RenderFlexGridSizer, and m_RenderingPanel.

Referenced by AppendLayerRows(), AppendRenderRows(), and GERBER_LAYER_WIDGET::ReFill().

◆ useAlternateBitmap()

virtual bool LAYER_WIDGET::useAlternateBitmap ( int  aRow)
inlineprotectedvirtual
Returns
true if bitmaps shown in Render layer list are alternate bitmaps, or false if they are "normal" bitmaps This is a virtual function because Pcbnew uses normal bitmaps but GerbView uses both bitmaps (alternate bitmaps to show layers in use, normal for others)

Reimplemented in GERBER_LAYER_WIDGET.

Definition at line 358 of file layer_widget.h.

358 { return false; }

Referenced by SelectLayerRow(), UpdateLayerIcons(), and updateLayerRow().

Member Data Documentation

◆ EVT_LAYER_COLOR_CHANGE

const wxEventType LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE = wxNewEventType()
static

Definition at line 120 of file layer_widget.h.

Referenced by OnLayerSwatchChanged().

◆ m_CurrentRow

int LAYER_WIDGET::m_CurrentRow
protected

selected row of layer list

Definition at line 469 of file layer_widget.h.

Referenced by GetSelectedLayer(), LAYER_WIDGET(), SelectLayerRow(), UpdateLayerIcons(), and updateLayerRow().

◆ m_FocusOwner

wxWindow* LAYER_WIDGET::m_FocusOwner
protected

Definition at line 468 of file layer_widget.h.

Referenced by LAYER_WIDGET(), and passOnFocus().

◆ m_IconProvider

ROW_ICON_PROVIDER* LAYER_WIDGET::m_IconProvider
protected

Definition at line 472 of file layer_widget.h.

Referenced by insertLayerRow(), LAYER_WIDGET(), and ~LAYER_WIDGET().

◆ m_LayerPanel

wxPanel* LAYER_WIDGET::m_LayerPanel
protected

Definition at line 461 of file layer_widget.h.

Referenced by GetBestSize(), LAYER_WIDGET(), and UpdateLayouts().

◆ m_LayerScrolledWindow

wxScrolledWindow* LAYER_WIDGET::m_LayerScrolledWindow
protected

◆ m_LayersFlexGridSizer

wxFlexGridSizer* LAYER_WIDGET::m_LayersFlexGridSizer
protected

◆ m_notebook

wxAuiNotebook* LAYER_WIDGET::m_notebook
protected

◆ m_PointSize

int LAYER_WIDGET::m_PointSize
protected

Definition at line 470 of file layer_widget.h.

Referenced by insertLayerRow(), insertRenderRow(), and LAYER_WIDGET().

◆ m_RenderFlexGridSizer

wxFlexGridSizer* LAYER_WIDGET::m_RenderFlexGridSizer
protected

◆ m_RenderingPanel

wxPanel* LAYER_WIDGET::m_RenderingPanel
protected

Definition at line 464 of file layer_widget.h.

Referenced by GetBestSize(), LAYER_WIDGET(), and UpdateLayouts().

◆ m_RenderScrolledWindow

wxScrolledWindow* LAYER_WIDGET::m_RenderScrolledWindow
protected

Definition at line 465 of file layer_widget.h.

Referenced by insertRenderRow(), and LAYER_WIDGET().

◆ m_smallestLayerString

wxString LAYER_WIDGET::m_smallestLayerString
protected

Definition at line 474 of file layer_widget.h.

Referenced by insertLayerRow(), and SetSmallestLayerString().


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