KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 CollectCurrentColorSettings (COLOR_SETTINGS *aColorSettings)
 Collect the current color settings and put it in aColorSettings. More...
 
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 (int aLayer)
 Change the row selection in the layer list to aLayer provided. More...
 
int GetSelectedLayer ()
 Return the selected layer or -1 if none. More...
 
void SetLayerVisible (int aLayer, bool isVisible)
 Set aLayer visible or not. More...
 
bool IsLayerVisible (int aLayer)
 Return the visible state of the layer ROW associated with aLayer id. More...
 
void SetLayerColor (int aLayer, const COLOR4D &aColor)
 Change the color of aLayer. More...
 
COLOR4D GetLayerColor (int aLayer) const
 Return the color of the layer ROW associated with aLayer id. More...
 
COLOR4D GetRenderColor (int aRow) const
 Return the color of the Render ROW in position aRow. 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_X2 , ID_SORT_GBR_LAYERS_FILE_EXT , ID_SET_GBR_LAYERS_DRAW_PRMS ,
  ID_LAYER_MOVE_UP , ID_LAYER_MOVE_DOWN , ID_LAYER_DELETE , ID_LAYER_MANAGER_END = ID_LAYER_DELETE
}
 
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 (int 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 (int 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 int 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...
 
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

Enumerator
ID_LAYER_MANAGER_START 
ID_SHOW_ALL_LAYERS 
ID_SHOW_NO_LAYERS 
ID_SHOW_NO_LAYERS_BUT_ACTIVE 
ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE 
ID_SORT_GBR_LAYERS_X2 
ID_SORT_GBR_LAYERS_FILE_EXT 
ID_SET_GBR_LAYERS_DRAW_PRMS 
ID_LAYER_MOVE_UP 
ID_LAYER_MOVE_DOWN 
ID_LAYER_DELETE 
ID_LAYER_MANAGER_END 

Definition at line 96 of file gerbview_layer_widget.h.

◆ POPUP_ID

enum LAYER_WIDGET::POPUP_ID
protectedinherited
Enumerator
ID_CHANGE_LAYER_COLOR 
ID_CHANGE_RENDER_COLOR 
ID_LAST_VALUE 

Definition at line 458 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 47 of file gerbview_layer_widget.cpp.

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 157 of file gerbview_layer_widget.cpp.

References _, KIUI::AddMenuItem(), ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE, ID_LAYER_DELETE, ID_LAYER_MOVE_DOWN, ID_LAYER_MOVE_UP, ID_SET_GBR_LAYERS_DRAW_PRMS, ID_SHOW_ALL_LAYERS, ID_SHOW_NO_LAYERS, ID_SHOW_NO_LAYERS_BUT_ACTIVE, ID_SORT_GBR_LAYERS_FILE_EXT, ID_SORT_GBR_LAYERS_X2, and KiBitmap().

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

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.

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

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.

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

References LAYER_WIDGET::m_LayersFlexGridSizer.

Referenced by ReFill().

◆ ClearRenderRows()

void LAYER_WIDGET::ClearRenderRows ( )
inherited

Empty out the render rows.

Definition at line 655 of file layer_widget.cpp.

References LAYER_WIDGET::m_RenderFlexGridSizer.

Referenced by ReFillRender().

◆ CollectCurrentColorSettings()

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

References LYR_COLUMN_COUNT.

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

◆ findLayerRow()

int LAYER_WIDGET::findLayerRow ( int  aLayer) const
protectedinherited

◆ findRenderRow()

int LAYER_WIDGET::findRenderRow ( int  aId) const
protectedinherited

◆ getBackgroundLayerColor()

virtual COLOR4D LAYER_WIDGET::getBackgroundLayerColor ( )
inlineprotectedvirtualinherited

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

Definition at line 369 of file layer_widget.h.

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

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

int LAYER_WIDGET::getDecodedId ( int  aControlId)
staticprotectedinherited

Decode aControlId to original un-encoded value.

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

Definition at line 68 of file layer_widget.cpp.

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 70 of file gerbview_layer_widget.cpp.

References GERBER_FILE_IMAGE_LIST::GetImagesList().

Referenced by ReFill().

◆ GetLayerColor()

COLOR4D LAYER_WIDGET::GetLayerColor ( int  aLayer) const
inherited

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

Definition at line 750 of file layer_widget.cpp.

References LAYER_WIDGET::findLayerRow(), and LAYER_WIDGET::getLayerComp().

Referenced by CollectCurrentColorSettings().

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

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

◆ GetRenderColor()

COLOR4D LAYER_WIDGET::GetRenderColor ( int  aRow) const
inherited

Return the color of the Render ROW in position aRow.

Definition at line 767 of file layer_widget.cpp.

References LAYER_WIDGET::getRenderComp().

Referenced by CollectCurrentColorSettings().

◆ getRenderComp()

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

◆ GetRenderRowCount()

int LAYER_WIDGET::GetRenderRowCount ( ) const
inherited

Return the number of rows in the render tab.

Definition at line 628 of file layer_widget.cpp.

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

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

◆ GetSelectedLayer()

int LAYER_WIDGET::GetSelectedLayer ( )
inherited

Return the selected layer or -1 if none.

Definition at line 689 of file layer_widget.cpp.

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

◆ insertLayerRow()

◆ insertRenderRow()

◆ 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 ( int  aLayer)
inherited

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

Definition at line 720 of file layer_widget.cpp.

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

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

◆ 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 331 of file gerbview_layer_widget.cpp.

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 355 of file gerbview_layer_widget.cpp.

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 278 of file gerbview_layer_widget.cpp.

References ID_ALWAYS_SHOW_NO_LAYERS_BUT_ACTIVE, m_alwaysShowActiveLayer, and onPopupSelection().

Referenced by OnLayerSelect().

◆ OnLayerSwatchChanged()

void LAYER_WIDGET::OnLayerSwatchChanged ( wxCommandEvent &  aEvent)
protectedinherited

◆ 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 381 of file gerbview_layer_widget.cpp.

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

◆ OnLeftDownLayers()

◆ onPopupSelection()

◆ OnRenderCheckBox()

void LAYER_WIDGET::OnRenderCheckBox ( wxCommandEvent &  event)
protectedinherited

◆ 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 394 of file gerbview_layer_widget.cpp.

References KIGFX::COLOR, EDA_DRAW_FRAME::GetCanvas(), GERBVIEW_FRAME::GetColorSettings(), EDA_DRAW_PANEL_GAL::GetView(), m_frame, EDA_DRAW_PANEL_GAL::Refresh(), COLOR_SETTINGS::SetColor(), 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 411 of file gerbview_layer_widget.cpp.

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

◆ OnRightDownLayer()

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

◆ onRightDownLayers()

void GERBER_LAYER_WIDGET::onRightDownLayers ( wxMouseEvent &  event)
private

Put up a popup menu for the layer panel.

Definition at line 200 of file gerbview_layer_widget.cpp.

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.

References _, KIUI::AddMenuItem(), 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 249 of file layer_widget.cpp.

References LAYER_WIDGET::passOnFocus().

Referenced by LAYER_WIDGET::LAYER_WIDGET().

◆ passOnFocus()

◆ ReFill()

◆ ReFillRender()

◆ SelectLayer()

void LAYER_WIDGET::SelectLayer ( int  aLayer)
inherited

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

Definition at line 682 of file layer_widget.cpp.

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

◆ setLayerCheckbox()

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

◆ SetLayerColor()

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

Change the color of aLayer.

Definition at line 735 of file layer_widget.cpp.

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 76 of file gerbview_layer_widget.cpp.

References _, and LAYER_WIDGET::m_notebook.

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

◆ SetLayerVisible()

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

Set aLayer visible or not.

This does not invoke OnLayerVisible().

Definition at line 700 of file layer_widget.cpp.

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

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.

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

References COLUMN_ICON_ACTIVE, LAYER_WIDGET::getLayerComp(), LAYER_WIDGET::GetLayerRowCount(), LAYER_WIDGET::m_CurrentRow, ROW_ICON_PROVIDER::OFF, ROW_ICON_PROVIDER::ON, and INDICATOR_ICON::SetIndicatorState().

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

◆ updateLayerRow()

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

◆ UpdateLayouts()

◆ useAlternateBitmap()

virtual bool LAYER_WIDGET::useAlternateBitmap ( int  aRow)
inlineprotectedvirtualinherited
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)

Definition at line 363 of file layer_widget.h.

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 128 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 473 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

Definition at line 465 of file layer_widget.h.

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

◆ 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 470 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: