KiCad PCB EDA Suite
GERBER_LAYER_WIDGET Class Reference

Abstract functions of LAYER_WIDGET so they may be tied into the GERBVIEW_FRAME's data and we can add a popup menu which is specific to Pcbnew's needs. More...

#include <gerbview_layer_widget.h>

Inheritance diagram for GERBER_LAYER_WIDGET:
LAYER_WIDGET

Public Member Functions

 GERBER_LAYER_WIDGET (GERBVIEW_FRAME *aParent, wxWindow *aFocusOwner)
 
void ReFill ()
 Rebuild Render for instance after the config is read. More...
 
void ReFillRender ()
 Rebuild Render for instance after the config is read. More...
 
void OnLayerRightClick (wxMenu &aMenu) override
 Notify client code about a layer being right-clicked. More...
 
void OnLayerColorChange (int aLayer, const COLOR4D &aColor) override
 Notify client code about a layer color change. More...
 
bool OnLayerSelect (int aLayer) override
 Notify client code whenever the user selects a different layer. More...
 
void OnLayerVisible (int aLayer, bool isVisible, bool isFinal) override
 Notify client code about a layer visibility change. More...
 
void OnRenderColorChange (int aId, const COLOR4D &aColor) override
 Notify client code whenever the user changes a rendering color. More...
 
void OnRenderEnable (int aId, bool isEnabled) override
 Notify client code whenever the user changes an rendering enable in one of the rendering checkboxes. More...
 
void SetLayersManagerTabsText ()
 Update the layer manager tabs labels. More...
 
bool OnLayerSelected ()
 Ensure the active layer is visible, and other layers not visible when m_alwaysShowActiveLayer is true. More...
 
void AddRightClickMenuItems (wxMenu *aMenu)
 Add menu items to a menu that should be shown when right-clicking the Gerber layer widget. More...
 
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...
 

Static Public Attributes

static const wxEventType EVT_LAYER_COLOR_CHANGE = wxNewEventType()
 

Protected Types

enum  LAYER_MANAGER {
  ID_LAYER_MANAGER_START = LAYER_WIDGET::ID_LAST_VALUE, ID_SHOW_ALL_LAYERS = ID_LAYER_MANAGER_START, ID_SHOW_NO_LAYERS, ID_SHOW_NO_LAYERS_BUT_ACTIVE,
  ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE, ID_SORT_GBR_LAYERS, ID_LAYER_MANAGER_END = ID_SORT_GBR_LAYERS
}
 
enum  POPUP_ID { ID_CHANGE_LAYER_COLOR = wxID_HIGHEST, ID_CHANGE_RENDER_COLOR, ID_LAST_VALUE }
 

Protected Member Functions

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

wxNotebook * 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
 

Private Member Functions

void onRightDownLayers (wxMouseEvent &event)
 Put up a popup menu for the layer panel. More...
 
void onPopupSelection (wxCommandEvent &event)
 
void installRightLayerClickHandler ()
 this is for the popup menu, the right click handler has to be installed on every child control within the layer panel. More...
 
virtual bool useAlternateBitmap (int aRow) override
 
GERBER_FILE_IMAGE_LISTGetImagesList ()
 

Private Attributes

GERBVIEW_FRAMEm_frame
 
bool m_alwaysShowActiveLayer
 

Detailed Description

Abstract functions of LAYER_WIDGET so they may be tied into the GERBVIEW_FRAME's data and we can add a popup menu which is specific to Pcbnew's needs.

Definition at line 36 of file gerbview_layer_widget.h.

Member Enumeration Documentation

◆ LAYER_MANAGER

◆ POPUP_ID

enum LAYER_WIDGET::POPUP_ID
protectedinherited
Enumerator
ID_CHANGE_LAYER_COLOR 
ID_CHANGE_RENDER_COLOR 
ID_LAST_VALUE 

Definition at line 453 of file layer_widget.h.

Constructor & Destructor Documentation

◆ GERBER_LAYER_WIDGET()

GERBER_LAYER_WIDGET::GERBER_LAYER_WIDGET ( GERBVIEW_FRAME aParent,
wxWindow *  aFocusOwner 
)
Parameters
aParentis the parent frame.
aFocusOwneris the window that has the keyboard focus.

Definition at line 46 of file gerbview_layer_widget.cpp.

46  :
47  LAYER_WIDGET( aParent, aFocusOwner ),
48  m_frame( aParent )
49 {
51 
52  ReFillRender();
53 
54  // Update default tabs labels for GerbView
56 
57  // handle the popup menu over the layer window.
58  m_LayerScrolledWindow->Connect( wxEVT_RIGHT_DOWN,
59  wxMouseEventHandler( GERBER_LAYER_WIDGET::onRightDownLayers ),
60  nullptr, this );
61 
62  // since Popupmenu() calls this->ProcessEvent() we must call this->Connect()
63  // and not m_LayerScrolledWindow->Connect()
64  Connect( ID_LAYER_MANAGER_START, ID_LAYER_MANAGER_END, wxEVT_COMMAND_MENU_SELECTED,
65  wxCommandEventHandler( GERBER_LAYER_WIDGET::onPopupSelection ), nullptr, this );
66 }
void onRightDownLayers(wxMouseEvent &event)
Put up a popup menu for the layer panel.
void SetLayersManagerTabsText()
Update the layer manager tabs labels.
wxScrolledWindow * m_LayerScrolledWindow
Definition: layer_widget.h:462
void onPopupSelection(wxCommandEvent &event)
LAYER_WIDGET(wxWindow *aParent, wxWindow *aFocusOwner, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void ReFillRender()
Rebuild Render for instance after the config is read.

References ID_LAYER_MANAGER_END, ID_LAYER_MANAGER_START, m_alwaysShowActiveLayer, LAYER_WIDGET::m_LayerScrolledWindow, onPopupSelection(), onRightDownLayers(), ReFillRender(), and SetLayersManagerTabsText().

Member Function Documentation

◆ AddRightClickMenuItems()

void GERBER_LAYER_WIDGET::AddRightClickMenuItems ( wxMenu *  aMenu)

Add menu items to a menu that should be shown when right-clicking the Gerber layer widget.

Parameters
aMenuis the menu to modify: menuitems will be added to aMenu.

Definition at line 119 of file gerbview_layer_widget.cpp.

120 {
121  // Remember: menu text is capitalized (see our rules_for_capitalization_in_Kicad_UI.txt)
122  AddMenuItem( aMenu, ID_SHOW_ALL_LAYERS, _( "Show All Layers" ),
124 
126  _( "Hide All Layers But Active" ),
128 
130  _( "Always Hide All Layers But Active" ),
132 
133  AddMenuItem( aMenu, ID_SHOW_NO_LAYERS, _( "Hide All Layers" ),
135 
136  aMenu->AppendSeparator();
137  AddMenuItem( aMenu, ID_SORT_GBR_LAYERS, _( "Sort Layers if X2 Mode" ),
139 }
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:257
#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

References _, AddMenuItem(), ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE, ID_SHOW_ALL_LAYERS, ID_SHOW_NO_LAYERS, ID_SHOW_NO_LAYERS_BUT_ACTIVE, ID_SORT_GBR_LAYERS, KiBitmap(), reload, select_w_layer, show_all_layers, and show_no_layers.

Referenced by OnLayerRightClick(), and onRightDownLayers().

◆ AppendLayerRow()

void LAYER_WIDGET::AppendLayerRow ( const ROW aRow)
inherited

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 651 of file layer_widget.cpp.

652 {
653  int nextRow = GetLayerRowCount();
654  insertLayerRow( nextRow, aRow );
655 }
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 LAYER_WIDGET::GetLayerRowCount(), and LAYER_WIDGET::insertLayerRow().

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

◆ AppendLayerRows()

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

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 LAYER_WIDGET::AppendLayerRow(), and LAYER_WIDGET::UpdateLayouts().

◆ AppendRenderRow()

void LAYER_WIDGET::AppendRenderRow ( const ROW aRow)
inherited

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 664 of file layer_widget.cpp.

665 {
666  int nextRow = GetRenderRowCount();
667  insertRenderRow( nextRow, aRow );
668 }
void insertRenderRow(int aRow, const ROW &aSpec)
int GetRenderRowCount() const
Return the number of rows in the render tab.

References LAYER_WIDGET::GetRenderRowCount(), and LAYER_WIDGET::insertRenderRow().

Referenced by LAYER_WIDGET::AppendRenderRows().

◆ AppendRenderRows()

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

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 LAYER_WIDGET::AppendRenderRow(), and LAYER_WIDGET::UpdateLayouts().

Referenced by ReFillRender().

◆ ClearLayerRows()

void LAYER_WIDGET::ClearLayerRows ( )
inherited

Empty out the layer rows.

Definition at line 658 of file layer_widget.cpp.

659 {
660  m_LayersFlexGridSizer->Clear( true );
661 }
wxFlexGridSizer * m_LayersFlexGridSizer
Definition: layer_widget.h:463

References LAYER_WIDGET::m_LayersFlexGridSizer.

◆ ClearRenderRows()

void LAYER_WIDGET::ClearRenderRows ( )
inherited

Empty out the render rows.

Definition at line 671 of file layer_widget.cpp.

672 {
673  m_RenderFlexGridSizer->Clear( true );
674 }
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466

References LAYER_WIDGET::m_RenderFlexGridSizer.

Referenced by ReFillRender().

◆ encodeId()

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

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 LAYER_WIDGET::insertLayerRow(), and LAYER_WIDGET::insertRenderRow().

◆ findLayerRow()

int LAYER_WIDGET::findLayerRow ( LAYER_NUM  aLayer) const
protectedinherited

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 LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::getLayerComp(), and LAYER_WIDGET::GetLayerRowCount().

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

◆ findRenderRow()

int LAYER_WIDGET::findRenderRow ( int  aId) const
protectedinherited

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 LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::getRenderComp(), and LAYER_WIDGET::GetRenderRowCount().

Referenced by LAYER_WIDGET::GetRenderState(), and LAYER_WIDGET::SetRenderState().

◆ getBackgroundLayerColor()

virtual COLOR4D LAYER_WIDGET::getBackgroundLayerColor ( )
inlineprotectedvirtualinherited

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 LAYER_WIDGET::insertLayerRow(), and LAYER_WIDGET::insertRenderRow().

◆ GetBestSize()

wxSize LAYER_WIDGET::GetBestSize ( ) const
inherited

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 585 of file layer_widget.cpp.

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

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

◆ getDecodedId()

LAYER_NUM LAYER_WIDGET::getDecodedId ( int  aControlId)
staticprotectedinherited

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 LAYER_WIDGET::findLayerRow(), LAYER_WIDGET::findRenderRow(), LAYER_WIDGET::GetSelectedLayer(), LAYER_WIDGET::OnLayerCheckBox(), LAYER_WIDGET::OnLayerSwatchChanged(), LAYER_WIDGET::OnLeftDownLayers(), onPopupSelection(), LAYER_WIDGET::OnRenderCheckBox(), and LAYER_WIDGET::OnRenderSwatchChanged().

◆ GetImagesList()

GERBER_FILE_IMAGE_LIST * GERBER_LAYER_WIDGET::GetImagesList ( )
private

Definition at line 69 of file gerbview_layer_widget.cpp.

70 {
72 }
static GERBER_FILE_IMAGE_LIST & GetImagesList()

References GERBER_FILE_IMAGE_LIST::GetImagesList().

Referenced by ReFill(), and useAlternateBitmap().

◆ GetLayerColor()

COLOR4D LAYER_WIDGET::GetLayerColor ( LAYER_NUM  aLayer) const
inherited

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

Definition at line 781 of file layer_widget.cpp.

782 {
783  int row = findLayerRow( aLayer );
784 
785  if( row >= 0 )
786  {
787  int col = 1; // bitmap button is column 1
788  auto swatch = static_cast<COLOR_SWATCH*>( getLayerComp( row, col ) );
789  wxASSERT( swatch );
790 
791  return swatch->GetSwatchColor();
792  }
793 
794  return COLOR4D::UNSPECIFIED; // it's caller fault, gave me a bad layer
795 }
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 LAYER_WIDGET::findLayerRow(), and LAYER_WIDGET::getLayerComp().

◆ getLayerComp()

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

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 LAYER_WIDGET::m_LayersFlexGridSizer.

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

◆ GetLayerRowCount()

int LAYER_WIDGET::GetLayerRowCount ( ) const
inherited

Return the number of rows in the layer tab.

Definition at line 637 of file layer_widget.cpp.

638 {
639  int controlCount = m_LayersFlexGridSizer->GetChildren().GetCount();
640  return controlCount / LYR_COLUMN_COUNT;
641 }
#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 LAYER_WIDGET::m_LayersFlexGridSizer.

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

◆ getRenderComp()

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

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 LAYER_WIDGET::m_RenderFlexGridSizer, and RND_COLUMN_COUNT.

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

◆ GetRenderRowCount()

int LAYER_WIDGET::GetRenderRowCount ( ) const
inherited

Return the number of rows in the render tab.

Definition at line 644 of file layer_widget.cpp.

645 {
646  int controlCount = m_RenderFlexGridSizer->GetChildren().GetCount();
647  return controlCount / RND_COLUMN_COUNT;
648 }
#define RND_COLUMN_COUNT
Rendering tab column count.
Definition: layer_widget.h:49
wxFlexGridSizer * m_RenderFlexGridSizer
Definition: layer_widget.h:466

References LAYER_WIDGET::m_RenderFlexGridSizer, and RND_COLUMN_COUNT.

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

◆ GetRenderState()

bool LAYER_WIDGET::GetRenderState ( int  aId)
inherited

Return the state of the checkbox associated with aId.

Returns
true if checked, else false.

Definition at line 812 of file layer_widget.cpp.

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

References LAYER_WIDGET::findRenderRow(), and LAYER_WIDGET::getRenderComp().

◆ GetSelectedLayer()

LAYER_NUM LAYER_WIDGET::GetSelectedLayer ( )
inherited

Return the selected layer or -1 if none.

Definition at line 720 of file layer_widget.cpp.

721 {
722  wxWindow* w = getLayerComp( m_CurrentRow, 0 );
723 
724  if( w )
725  return getDecodedId( w->GetId() );
726 
727  return UNDEFINED_LAYER;
728 }
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 LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::m_CurrentRow, and UNDEFINED_LAYER.

◆ insertLayerRow()

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

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, LAYER_WIDGET::encodeId(), LAYER_WIDGET::getBackgroundLayerColor(), LAYER_WIDGET::ROW::id, LYR_COLUMN_COUNT, LAYER_WIDGET::m_IconProvider, LAYER_WIDGET::m_LayerScrolledWindow, LAYER_WIDGET::m_LayersFlexGridSizer, LAYER_WIDGET::m_PointSize, LAYER_WIDGET::m_smallestLayerString, LAYER_WIDGET::OnLayerCheckBox(), LAYER_WIDGET::OnLayerSwatchChanged(), LAYER_WIDGET::OnLeftDownLayers(), LAYER_WIDGET::OnRightDownLayer(), LAYER_WIDGET::ROW::rowName, WX_ELLIPSIZED_STATIC_TEXT::SetMinimumStringLength(), shrinkFont(), LAYER_WIDGET::ROW::state, SWATCH_SMALL, and LAYER_WIDGET::ROW::tooltip.

Referenced by LAYER_WIDGET::AppendLayerRow().

◆ insertRenderRow()

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

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, LAYER_WIDGET::encodeId(), LAYER_WIDGET::getBackgroundLayerColor(), LAYER_WIDGET::ROW::id, LAYER_WIDGET::m_PointSize, LAYER_WIDGET::m_RenderFlexGridSizer, LAYER_WIDGET::m_RenderScrolledWindow, LAYER_WIDGET::OnRenderCheckBox(), LAYER_WIDGET::OnRenderSwatchChanged(), LAYER_WIDGET::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 LAYER_WIDGET::AppendRenderRow().

◆ installRightLayerClickHandler()

void GERBER_LAYER_WIDGET::installRightLayerClickHandler ( )
private

this is for the popup menu, the right click handler has to be installed on every child control within the layer panel.

◆ IsLayerVisible()

bool LAYER_WIDGET::IsLayerVisible ( LAYER_NUM  aLayer)
inherited

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

Definition at line 751 of file layer_widget.cpp.

752 {
753  int row = findLayerRow( aLayer );
754 
755  if( row >= 0 )
756  {
757  wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
758  wxASSERT( cb );
759  return cb->GetValue();
760  }
761 
762  return false;
763 }
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, LAYER_WIDGET::findLayerRow(), and LAYER_WIDGET::getLayerComp().

Referenced by GERBVIEW_FRAME::IsLayerVisible().

◆ OnLayerCheckBox()

void LAYER_WIDGET::OnLayerCheckBox ( wxCommandEvent &  event)
protectedinherited

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:41
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 LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::OnLayerVisible(), and LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::insertLayerRow().

◆ OnLayerColorChange()

void GERBER_LAYER_WIDGET::OnLayerColorChange ( int  aLayer,
const COLOR4D aColor 
)
overridevirtual

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.

Implements LAYER_WIDGET.

Definition at line 249 of file gerbview_layer_widget.cpp.

250 {
251  // NOTE: Active layer in GerbView is stored as 0-indexed, but layer color is
252  // stored according to the GERBER_DRAW_LAYER() offset.
253  m_frame->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor );
255 
256  KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
257  auto settings = m_frame->GetSettingsManager()->GetColorSettings();
258  view->GetPainter()->GetSettings()->LoadColors( settings );
259  view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) );
260 
261  m_frame->GetCanvas()->Refresh();
262 }
void SetLayerColor(int aLayer, const COLOR4D &aColor)
SETTINGS_MANAGER * GetSettingsManager() const
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
GBR_LAYER_BOX_SELECTOR * m_SelLayerBox
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
#define GERBER_DRAW_LAYER(x)
Definition: layer_ids.h:398
void UpdateLayerColor(int aLayer)
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
Definition: view.cpp:745
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
virtual void LoadColors(const COLOR_SETTINGS *aSettings)

References GERBER_DRAW_LAYER, EDA_DRAW_FRAME::GetCanvas(), SETTINGS_MANAGER::GetColorSettings(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), EDA_BASE_FRAME::GetSettingsManager(), EDA_DRAW_PANEL_GAL::GetView(), KIGFX::RENDER_SETTINGS::LoadColors(), m_frame, GERBVIEW_FRAME::m_SelLayerBox, EDA_DRAW_PANEL_GAL::Refresh(), LAYER_BOX_SELECTOR::ResyncBitmapOnly(), GERBVIEW_FRAME::SetLayerColor(), and KIGFX::VIEW::UpdateLayerColor().

◆ OnLayerRightClick()

void GERBER_LAYER_WIDGET::OnLayerRightClick ( wxMenu &  aMenu)
overridevirtual

Notify client code about a layer being right-clicked.

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

Implements LAYER_WIDGET.

Definition at line 243 of file gerbview_layer_widget.cpp.

244 {
245  AddRightClickMenuItems( &aMenu );
246 }
void AddRightClickMenuItems(wxMenu *aMenu)
Add menu items to a menu that should be shown when right-clicking the Gerber layer widget.

References AddRightClickMenuItems().

◆ OnLayerSelect()

bool GERBER_LAYER_WIDGET::OnLayerSelect ( int  aLayer)
overridevirtual

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.

Implements LAYER_WIDGET.

Definition at line 265 of file gerbview_layer_widget.cpp.

266 {
267  // the layer change from the GERBER_LAYER_WIDGET can be denied by returning
268  // false from this function.
269  int layer = m_frame->GetActiveLayer();
270 
271  m_frame->SetActiveLayer( aLayer, false );
273 
274  if( layer != m_frame->GetActiveLayer() )
275  {
276  if( ! OnLayerSelected() )
277  {
278  auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>
279  ( m_frame->GetCanvas()->GetView()->GetPainter() )->GetSettings();
280  int dcodeSelected = m_frame->m_DCodeSelector->GetSelectedDCodeId();
281  settings->m_dcodeHighlightValue = dcodeSelected;
283  m_frame->GetCanvas()->Refresh();
284  }
285  }
286 
287  return true;
288 }
void syncLayerBox(bool aRebuildLayerBox=false)
Update the currently "selected" layer within m_SelLayerBox.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition: view.cpp:1424
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
Color has changed.
Definition: view_item.h:48
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
DCODE_SELECTION_BOX * m_DCodeSelector
int GetActiveLayer() const
Return the active layer.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool OnLayerSelected()
Ensure the active layer is visible, and other layers not visible when m_alwaysShowActiveLayer is true...

References KIGFX::COLOR, GERBVIEW_FRAME::GetActiveLayer(), EDA_DRAW_FRAME::GetCanvas(), KIGFX::VIEW::GetPainter(), DCODE_SELECTION_BOX::GetSelectedDCodeId(), EDA_DRAW_PANEL_GAL::GetView(), GERBVIEW_FRAME::m_DCodeSelector, m_frame, OnLayerSelected(), EDA_DRAW_PANEL_GAL::Refresh(), GERBVIEW_FRAME::SetActiveLayer(), GERBVIEW_FRAME::syncLayerBox(), and KIGFX::VIEW::UpdateAllItems().

◆ OnLayerSelected()

bool GERBER_LAYER_WIDGET::OnLayerSelected ( )

Ensure the active layer is visible, and other layers not visible when m_alwaysShowActiveLayer is true.

Returns
true m_alwaysShowActiveLayer is true and the canvas is refreshed else false if do nothing.

Definition at line 198 of file gerbview_layer_widget.cpp.

199 {
201  return false;
202 
203  // postprocess after active layer selection ensure active layer visible
204  wxCommandEvent event;
206  onPopupSelection( event );
207  return true;
208 }
void onPopupSelection(wxCommandEvent &event)

References ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE, m_alwaysShowActiveLayer, and onPopupSelection().

Referenced by OnLayerSelect().

◆ OnLayerSwatchChanged()

void LAYER_WIDGET::OnLayerSwatchChanged ( wxCommandEvent &  aEvent)
protectedinherited

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:41
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 LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE, LAYER_WIDGET::getDecodedId(), COLOR_SWATCH::GetSwatchColor(), LAYER_WIDGET::OnLayerColorChange(), and LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::insertLayerRow().

◆ OnLayerVisible()

void GERBER_LAYER_WIDGET::OnLayerVisible ( int  aLayer,
bool  isVisible,
bool  isFinal 
)
overridevirtual

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.

Implements LAYER_WIDGET.

Definition at line 291 of file gerbview_layer_widget.cpp.

292 {
293  LSET visibleLayers = m_frame->GetVisibleLayers();
294 
295  visibleLayers[ aLayer ] = isVisible;
296 
297  m_frame->SetVisibleLayers( visibleLayers );
298 
299  if( isFinal )
300  m_frame->GetCanvas()->Refresh();
301 }
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:504
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.

References EDA_DRAW_FRAME::GetCanvas(), GERBVIEW_FRAME::GetVisibleLayers(), m_frame, EDA_DRAW_PANEL_GAL::Refresh(), and GERBVIEW_FRAME::SetVisibleLayers().

◆ OnLeftDownLayers()

void LAYER_WIDGET::OnLeftDownLayers ( wxMouseEvent &  event)
protectedinherited

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:41
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 LAYER_WIDGET::findLayerRow(), LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::GetLayerRowCount(), LAYER_WIDGET::m_LayerScrolledWindow, LAYER_WIDGET::m_LayersFlexGridSizer, LAYER_WIDGET::OnLayerSelect(), LAYER_WIDGET::passOnFocus(), and LAYER_WIDGET::SelectLayerRow().

Referenced by LAYER_WIDGET::insertLayerRow().

◆ onPopupSelection()

void GERBER_LAYER_WIDGET::onPopupSelection ( wxCommandEvent &  event)
private

Definition at line 153 of file gerbview_layer_widget.cpp.

154 {
155  int rowCount;
156  int menuId = event.GetId();
157  bool visible = (menuId == ID_SHOW_ALL_LAYERS) ? true : false;
158  LSET visibleLayers;
159  bool force_active_layer_visible;
160 
161  switch( menuId )
162  {
163  case ID_SHOW_ALL_LAYERS:
164  case ID_SHOW_NO_LAYERS:
167  // Set the display layers options. Sorting layers has no effect to these options
169  force_active_layer_visible = ( menuId == ID_SHOW_NO_LAYERS_BUT_ACTIVE ||
171 
172  // Update icons and check boxes
173  rowCount = GetLayerRowCount();
174 
175  for( int row = 0; row < rowCount; ++row )
176  {
177  wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
178  int layer = getDecodedId( cb->GetId() );
179  bool loc_visible = visible;
180 
181  if( force_active_layer_visible && (layer == m_frame->GetActiveLayer() ) )
182  loc_visible = true;
183 
184  cb->SetValue( loc_visible );
185  visibleLayers[ row ] = loc_visible;
186  }
187 
188  m_frame->SetVisibleLayers( visibleLayers );
189  m_frame->GetCanvas()->Refresh();
190  break;
191 
192  case ID_SORT_GBR_LAYERS:
194  break;
195  }
196 }
void SortLayersByX2Attributes()
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
wxWindow * getLayerComp(int aRow, int aColumn) const
Return the component within the m_LayersFlexGridSizer at aRow and aCol or NULL if these parameters ar...
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:504
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.
int GetActiveLayer() const
Return the active layer.
#define COLUMN_COLOR_LYR_CB
Definition: layer_widget.h:53
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.

References COLUMN_COLOR_LYR_CB, GERBVIEW_FRAME::GetActiveLayer(), EDA_DRAW_FRAME::GetCanvas(), LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::GetLayerRowCount(), ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE, ID_SHOW_ALL_LAYERS, ID_SHOW_NO_LAYERS, ID_SHOW_NO_LAYERS_BUT_ACTIVE, ID_SORT_GBR_LAYERS, m_alwaysShowActiveLayer, m_frame, EDA_DRAW_PANEL_GAL::Refresh(), GERBVIEW_FRAME::SetVisibleLayers(), and GERBVIEW_FRAME::SortLayersByX2Attributes().

Referenced by GERBER_LAYER_WIDGET(), and OnLayerSelected().

◆ OnRenderCheckBox()

void LAYER_WIDGET::OnRenderCheckBox ( wxCommandEvent &  event)
protectedinherited

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:41
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 LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::OnRenderEnable(), and LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::insertRenderRow().

◆ OnRenderColorChange()

void GERBER_LAYER_WIDGET::OnRenderColorChange ( int  aId,
const COLOR4D aColor 
)
overridevirtual

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.

Implements LAYER_WIDGET.

Definition at line 304 of file gerbview_layer_widget.cpp.

305 {
306  m_frame->SetVisibleElementColor( aId, aColor );
307 
308  auto view = m_frame->GetCanvas()->GetView();
310 
311  view->GetPainter()->GetSettings()->LoadColors( settings );
312  view->UpdateLayerColor( aId );
313  view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
314  view->UpdateAllItems( KIGFX::COLOR );
315  m_frame->GetCanvas()->Refresh();
316 }
SETTINGS_MANAGER * GetSettingsManager() const
void SetVisibleElementColor(int aLayerID, const COLOR4D &aColor)
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Color has changed.
Definition: view_item.h:48
Auxiliary rendering target (noncached)
Definition: definitions.h:49
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Color settings are a bit different than most of the settings objects in that there can be more than o...

References KIGFX::COLOR, EDA_DRAW_FRAME::GetCanvas(), SETTINGS_MANAGER::GetColorSettings(), EDA_BASE_FRAME::GetSettingsManager(), EDA_DRAW_PANEL_GAL::GetView(), m_frame, EDA_DRAW_PANEL_GAL::Refresh(), GERBVIEW_FRAME::SetVisibleElementColor(), and KIGFX::TARGET_NONCACHED.

◆ OnRenderEnable()

void GERBER_LAYER_WIDGET::OnRenderEnable ( int  aId,
bool  isEnabled 
)
overridevirtual

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.

Implements LAYER_WIDGET.

Definition at line 319 of file gerbview_layer_widget.cpp.

320 {
321  m_frame->SetElementVisibility( aId, isEnabled );
322 
323  if( m_frame->GetCanvas() )
324  {
325  if( aId == LAYER_GERBVIEW_GRID )
326  {
329  }
330  else
331  {
332  m_frame->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled );
333  }
334  }
335 
336  m_frame->GetCanvas()->Refresh();
337 }
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Auxiliary rendering target (noncached)
Definition: definitions.h:49
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:609
bool IsGridVisible() const
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:388
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
void SetElementVisibility(int aLayerID, bool aNewState)
Change the visibility of an element category.

References EDA_DRAW_FRAME::GetCanvas(), EDA_DRAW_PANEL_GAL::GetGAL(), EDA_DRAW_PANEL_GAL::GetView(), EDA_DRAW_FRAME::IsGridVisible(), LAYER_GERBVIEW_GRID, m_frame, KIGFX::VIEW::MarkTargetDirty(), EDA_DRAW_PANEL_GAL::Refresh(), GERBVIEW_FRAME::SetElementVisibility(), KIGFX::GAL::SetGridVisibility(), KIGFX::VIEW::SetLayerVisible(), and KIGFX::TARGET_NONCACHED.

◆ OnRenderSwatchChanged()

void LAYER_WIDGET::OnRenderSwatchChanged ( wxCommandEvent &  aEvent)
protectedinherited

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:41
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:216
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 LAYER_WIDGET::getDecodedId(), LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::GetLayerRowCount(), LAYER_WIDGET::getRenderComp(), LAYER_WIDGET::GetRenderRowCount(), LAYER_PCB_BACKGROUND, LAYER_WIDGET::OnRenderColorChange(), LAYER_WIDGET::passOnFocus(), and COLOR_SWATCH::SetSwatchBackground().

Referenced by LAYER_WIDGET::insertRenderRow().

◆ OnRightDownLayer()

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

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:257
#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(), LAYER_WIDGET::ID_CHANGE_LAYER_COLOR, KiBitmap(), LAYER_WIDGET::OnLayerRightClick(), and LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::insertLayerRow().

◆ onRightDownLayers()

void GERBER_LAYER_WIDGET::onRightDownLayers ( wxMouseEvent &  event)
private

Put up a popup menu for the layer panel.

Definition at line 142 of file gerbview_layer_widget.cpp.

143 {
144  wxMenu menu;
145 
146  AddRightClickMenuItems( &menu );
147  PopupMenu( &menu );
148 
149  passOnFocus();
150 }
void AddRightClickMenuItems(wxMenu *aMenu)
Add menu items to a menu that should be shown when right-clicking the Gerber layer widget.
void passOnFocus()
Give away the keyboard focus up to the main parent window.

References AddRightClickMenuItems(), and LAYER_WIDGET::passOnFocus().

Referenced by GERBER_LAYER_WIDGET().

◆ OnRightDownRender()

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

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:257
#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(), LAYER_WIDGET::ID_CHANGE_RENDER_COLOR, KiBitmap(), and LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::insertRenderRow().

◆ OnTabChange()

void LAYER_WIDGET::OnTabChange ( wxNotebookEvent &  event)
protectedinherited

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 LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::LAYER_WIDGET().

◆ passOnFocus()

◆ ReFill()

void GERBER_LAYER_WIDGET::ReFill ( )

Rebuild Render for instance after the config is read.

Definition at line 211 of file gerbview_layer_widget.cpp.

212 {
213  Freeze();
214 
215  for( int layer = 0; layer < GERBER_DRAWLAYERS_COUNT; ++layer )
216  {
217  int aRow = findLayerRow( layer );
218  bool visible = true;
220  wxString msg = GetImagesList()->GetDisplayName( layer,
221  /* include layer number */ false,
222  /* Get the full name */ true );
223 
224  if( m_frame->GetCanvas() )
225  visible = m_frame->GetCanvas()->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( layer ) );
226  else
227  visible = m_frame->IsLayerVisible( layer );
228 
229  if( aRow >= 0 )
230  {
231  updateLayerRow( findLayerRow( layer ), msg );
232  SetLayerVisible( layer, visible );
233  }
234  else
235  AppendLayerRow( LAYER_WIDGET::ROW( msg, layer, color, wxEmptyString, visible, true ) );
236  }
237 
238  UpdateLayouts();
239  Thaw();
240 }
int findLayerRow(LAYER_NUM aLayer) const
Return the row index that aLayer resides in, or -1 if not found.
Provide all the data needed to add a row to a LAYER_WIDGET.
Definition: layer_widget.h:84
void UpdateLayouts()
int color
Definition: DXF_plotter.cpp:57
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
GERBER_FILE_IMAGE_LIST * GetImagesList()
void updateLayerRow(int aRow, const wxString &aName)
#define GERBER_DRAWLAYERS_COUNT
Definition: layer_ids.h:378
void AppendLayerRow(const ROW &aRow)
Append a new row in the layer portion of the widget.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
#define GERBER_DRAW_LAYER(x)
Definition: layer_ids.h:398
COLOR4D GetLayerColor(int aLayer) const
void SetLayerVisible(LAYER_NUM aLayer, bool isVisible)
Set aLayer visible or not.
bool IsLayerVisible(int aLayer) const
Test whether a given layer is visible.
const wxString GetDisplayName(int aIdx, bool aNameOnly=false, bool aFullName=false)
Get the display name for the layer at aIdx.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition: view.h:405
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References LAYER_WIDGET::AppendLayerRow(), color, LAYER_WIDGET::findLayerRow(), GERBER_DRAW_LAYER, GERBER_DRAWLAYERS_COUNT, EDA_DRAW_FRAME::GetCanvas(), GERBER_FILE_IMAGE_LIST::GetDisplayName(), GetImagesList(), GERBVIEW_FRAME::GetLayerColor(), EDA_DRAW_PANEL_GAL::GetView(), GERBVIEW_FRAME::IsLayerVisible(), KIGFX::VIEW::IsLayerVisible(), m_frame, LAYER_WIDGET::SetLayerVisible(), LAYER_WIDGET::updateLayerRow(), and LAYER_WIDGET::UpdateLayouts().

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

◆ ReFillRender()

void GERBER_LAYER_WIDGET::ReFillRender ( )

Rebuild Render for instance after the config is read.

Definition at line 81 of file gerbview_layer_widget.cpp.

82 {
84 
85  // Fixed "Rendering" tab rows within the LAYER_WIDGET, only the initial color
86  // is changed before appending to the LAYER_WIDGET. This is an automatic variable
87  // not a static variable, change the color & state after copying from code to renderRows
88  // on the stack.
89  LAYER_WIDGET::ROW renderRows[6] = {
90 
91 #define RR LAYER_WIDGET::ROW // Render Row abbreviation to reduce source width
92 
93  RR( _( "DCodes" ), LAYER_DCODES, WHITE,
94  _( "Show DCodes identification" ) ),
95  RR( _( "Negative Objects" ), LAYER_NEGATIVE_OBJECTS, DARKGRAY,
96  _( "Show negative objects in this color" ) ),
97  RR(),
98  RR( _( "Grid" ), LAYER_GERBVIEW_GRID, WHITE,
99  _( "Show the (x,y) grid dots" ) ),
100  RR( _( "Drawing Sheet" ), LAYER_GERBVIEW_DRAWINGSHEET, DARKRED,
101  _( "Show drawing sheet border and title block") ),
102  RR( _( "Background" ), LAYER_GERBVIEW_BACKGROUND, BLACK,
103  _( "PCB Background" ), true, false )
104  };
105 
106  for( unsigned row = 0; row < arrayDim( renderRows ); ++row )
107  {
108  if( renderRows[row].color != COLOR4D::UNSPECIFIED ) // does this row show a color?
109  renderRows[row].color = m_frame->GetVisibleElementColor( renderRows[row].id );
110 
111  if( renderRows[row].id ) // if not the separator
112  renderRows[row].state = m_frame->IsElementVisible( renderRows[row].id );
113  }
114 
115  AppendRenderRows( renderRows, arrayDim(renderRows) );
116 }
Provide all the data needed to add a row to a LAYER_WIDGET.
Definition: layer_widget.h:84
COLOR4D GetVisibleElementColor(int aLayerID)
Return the color of a gerber visible element.
int color
Definition: DXF_plotter.cpp:57
#define RR
Definition: color4d.h:44
void ClearRenderRows()
Empty out the render rows.
bool state
initial wxCheckBox state
Definition: layer_widget.h:89
COLOR4D color
COLOR4D::UNSPECIFIED if none.
Definition: layer_widget.h:88
bool IsElementVisible(int aLayerID) const
Test whether a given element category is visible.
#define _(s)
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
void AppendRenderRows(const ROW *aRowsArray, int aRowCount)
Append new rows in the render portion of the widget.
Definition: layer_widget.h:200
Definition: color4d.h:48

References _, LAYER_WIDGET::AppendRenderRows(), arrayDim(), BLACK, LAYER_WIDGET::ClearRenderRows(), color, LAYER_WIDGET::ROW::color, DARKGRAY, DARKRED, GERBVIEW_FRAME::GetVisibleElementColor(), GERBVIEW_FRAME::IsElementVisible(), LAYER_DCODES, LAYER_GERBVIEW_BACKGROUND, LAYER_GERBVIEW_DRAWINGSHEET, LAYER_GERBVIEW_GRID, LAYER_NEGATIVE_OBJECTS, m_frame, RR, LAYER_WIDGET::ROW::state, and WHITE.

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), GERBER_LAYER_WIDGET(), and GERBVIEW_FRAME::GERBVIEW_FRAME().

◆ SelectLayer()

void LAYER_WIDGET::SelectLayer ( LAYER_NUM  aLayer)
inherited

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

Definition at line 713 of file layer_widget.cpp.

714 {
715  int row = findLayerRow( aLayer );
716  SelectLayerRow( row );
717 }
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 LAYER_WIDGET::findLayerRow(), and LAYER_WIDGET::SelectLayerRow().

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

◆ SelectLayerRow()

void LAYER_WIDGET::SelectLayerRow ( int  aRow)
inherited

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

Definition at line 677 of file layer_widget.cpp.

678 {
679  // enable the layer tab at index 0
680  m_notebook->SetSelection( 0 );
681 
682  INDICATOR_ICON* oldIndicator = (INDICATOR_ICON*) getLayerComp( m_CurrentRow, 0 );
683 
684  if( oldIndicator )
685  {
687  oldIndicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::DIMMED );
688  else
689  oldIndicator->SetIndicatorState( ROW_ICON_PROVIDER::STATE::OFF );
690  }
691 
692  INDICATOR_ICON* newIndicator = (INDICATOR_ICON*) getLayerComp( aRow, 0 );
693 
694  if( newIndicator )
695  {
697 
698  // Make sure the desired layer row is visible.
699  // It seems that as of 2.8.2, setting the focus does this.
700  // I don't expect the scrolling to be needed at all because
701  // the minimum window size may end up being established so that the
702  // scroll bars will not be visible.
703  getLayerComp( aRow, 1 )->SetFocus();
704  }
705 
706  m_CurrentRow = aRow;
707 
708  // give the focus back to the app.
709  passOnFocus();
710 }
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
wxNotebook * m_notebook
Definition: layer_widget.h:460
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 LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::m_CurrentRow, LAYER_WIDGET::m_notebook, ON, LAYER_WIDGET::passOnFocus(), INDICATOR_ICON::SetIndicatorState(), and LAYER_WIDGET::useAlternateBitmap().

Referenced by LAYER_WIDGET::OnLeftDownLayers(), and LAYER_WIDGET::SelectLayer().

◆ setLayerCheckbox()

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

Definition at line 738 of file layer_widget.cpp.

739 {
740  int row = findLayerRow( aLayer );
741 
742  if( row >= 0 )
743  {
744  wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
745  wxASSERT( cb );
746  cb->SetValue( isVisible ); // does not fire an event
747  }
748 }
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, LAYER_WIDGET::findLayerRow(), and LAYER_WIDGET::getLayerComp().

Referenced by LAYER_WIDGET::SetLayerVisible().

◆ SetLayerColor()

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

Change the color of aLayer.

Definition at line 766 of file layer_widget.cpp.

767 {
768  int row = findLayerRow( aLayer );
769 
770  if( row >= 0 )
771  {
772  int col = 1; // bitmap button is column 1
773  auto swatch = static_cast<COLOR_SWATCH*>( getLayerComp( row, col ) );
774  wxASSERT( swatch );
775 
776  swatch->SetSwatchColor( aColor, false );
777  }
778 }
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 LAYER_WIDGET::findLayerRow(), and LAYER_WIDGET::getLayerComp().

◆ SetLayersManagerTabsText()

void GERBER_LAYER_WIDGET::SetLayersManagerTabsText ( )

Update the layer manager tabs labels.

Useful when changing Language or to set labels to a non default value.

Definition at line 75 of file gerbview_layer_widget.cpp.

76 {
77  m_notebook->SetPageText( 0, _( "Layers" ) );
78  m_notebook->SetPageText( 1, _( "Items" ) );
79 }
wxNotebook * m_notebook
Definition: layer_widget.h:460
#define _(s)

References _, and LAYER_WIDGET::m_notebook.

Referenced by GERBER_LAYER_WIDGET(), and GERBVIEW_FRAME::ShowChangedLanguage().

◆ SetLayerVisible()

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

Set aLayer visible or not.

This does not invoke OnLayerVisible().

Definition at line 731 of file layer_widget.cpp.

732 {
733  setLayerCheckbox( aLayer, isVisible );
734  OnLayerVisible( aLayer, isVisible );
735 }
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 LAYER_WIDGET::OnLayerVisible(), and LAYER_WIDGET::setLayerCheckbox().

Referenced by ReFill().

◆ SetRenderState()

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

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 798 of file layer_widget.cpp.

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

References LAYER_WIDGET::findRenderRow(), and LAYER_WIDGET::getRenderComp().

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

◆ SetSmallestLayerString()

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

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 LAYER_WIDGET::m_smallestLayerString.

Referenced by GERBVIEW_FRAME::GERBVIEW_FRAME().

◆ UpdateLayerIcons()

void LAYER_WIDGET::UpdateLayerIcons ( )
inherited

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 838 of file layer_widget.cpp.

839 {
840  int rowCount = GetLayerRowCount();
841 
842  for( int row = 0; row < rowCount ; row++ )
843  {
845 
846  if( indicator )
847  {
849 
850  if( row == m_CurrentRow )
852  else if( useAlternateBitmap( row ) )
853  state = ROW_ICON_PROVIDER::STATE::DIMMED;
854  else
855  state = ROW_ICON_PROVIDER::STATE::OFF;
856 
857  indicator->SetIndicatorState( state );
858  }
859  }
860 }
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, LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::GetLayerRowCount(), LAYER_WIDGET::m_CurrentRow, ON, INDICATOR_ICON::SetIndicatorState(), and LAYER_WIDGET::useAlternateBitmap().

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

◆ updateLayerRow()

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

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, LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::m_CurrentRow, ON, INDICATOR_ICON::SetIndicatorState(), and LAYER_WIDGET::useAlternateBitmap().

Referenced by ReFill().

◆ UpdateLayouts()

void LAYER_WIDGET::UpdateLayouts ( )
inherited

Definition at line 828 of file layer_widget.cpp.

829 {
830  m_LayersFlexGridSizer->Layout();
831  m_RenderFlexGridSizer->Layout();
832  m_LayerPanel->Layout();
833  m_RenderingPanel->Layout();
834  FitInside();
835 }
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 LAYER_WIDGET::m_LayerPanel, LAYER_WIDGET::m_LayersFlexGridSizer, LAYER_WIDGET::m_RenderFlexGridSizer, and LAYER_WIDGET::m_RenderingPanel.

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

◆ useAlternateBitmap()

bool GERBER_LAYER_WIDGET::useAlternateBitmap ( int  aRow)
overrideprivatevirtual
Returns
true if bitmaps shown in Render layer list are alternate bitmaps else false if they are "normal" bitmaps.

Reimplemented from LAYER_WIDGET.

Definition at line 340 of file gerbview_layer_widget.cpp.

341 {
342  return GetImagesList()->GetGbrImage( aRow ) != nullptr;
343 }
GERBER_FILE_IMAGE_LIST * GetImagesList()
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)

References GERBER_FILE_IMAGE_LIST::GetGbrImage(), and GetImagesList().

Member Data Documentation

◆ EVT_LAYER_COLOR_CHANGE

const wxEventType LAYER_WIDGET::EVT_LAYER_COLOR_CHANGE = wxNewEventType()
staticinherited

Definition at line 120 of file layer_widget.h.

Referenced by LAYER_WIDGET::OnLayerSwatchChanged().

◆ m_alwaysShowActiveLayer

bool GERBER_LAYER_WIDGET::m_alwaysShowActiveLayer
private

Definition at line 124 of file gerbview_layer_widget.h.

Referenced by GERBER_LAYER_WIDGET(), OnLayerSelected(), and onPopupSelection().

◆ m_CurrentRow

int LAYER_WIDGET::m_CurrentRow
protectedinherited

◆ m_FocusOwner

wxWindow* LAYER_WIDGET::m_FocusOwner
protectedinherited

Definition at line 468 of file layer_widget.h.

Referenced by LAYER_WIDGET::LAYER_WIDGET(), and LAYER_WIDGET::passOnFocus().

◆ m_frame

◆ m_IconProvider

ROW_ICON_PROVIDER* LAYER_WIDGET::m_IconProvider
protectedinherited

◆ m_LayerPanel

wxPanel* LAYER_WIDGET::m_LayerPanel
protectedinherited

◆ m_LayerScrolledWindow

wxScrolledWindow* LAYER_WIDGET::m_LayerScrolledWindow
protectedinherited

◆ m_LayersFlexGridSizer

◆ m_notebook

wxNotebook* LAYER_WIDGET::m_notebook
protectedinherited

◆ m_PointSize

int LAYER_WIDGET::m_PointSize
protectedinherited

◆ m_RenderFlexGridSizer

◆ m_RenderingPanel

wxPanel* LAYER_WIDGET::m_RenderingPanel
protectedinherited

◆ m_RenderScrolledWindow

wxScrolledWindow* LAYER_WIDGET::m_RenderScrolledWindow
protectedinherited

Definition at line 465 of file layer_widget.h.

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

◆ m_smallestLayerString

wxString LAYER_WIDGET::m_smallestLayerString
protectedinherited

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