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.
 
void ReFill ()
 Rebuild Render for instance after the config is read.
 
void ReFillRender ()
 Rebuild Render for instance after the config is read.
 
void OnLayerRightClick (wxMenu &aMenu) override
 Notify client code about a layer being right-clicked.
 
void OnLayerColorChange (int aLayer, const COLOR4D &aColor) override
 Notify client code about a layer color change.
 
bool OnLayerSelect (int aLayer) override
 Notify client code whenever the user selects a different layer.
 
void OnLayerVisible (int aLayer, bool isVisible, bool isFinal) override
 Notify client code about a layer visibility change.
 
void OnRenderColorChange (int aId, const COLOR4D &aColor) override
 Notify client code whenever the user changes a rendering color.
 
void OnRenderEnable (int aId, bool isEnabled) override
 Notify client code whenever the user changes an rendering enable in one of the rendering checkboxes.
 
void SetLayersManagerTabsText ()
 Update the layer manager tabs labels.
 
bool OnLayerSelected ()
 Ensure the active layer is visible, and other layers not visible when m_alwaysShowActiveLayer is true.
 
void AddRightClickMenuItems (wxMenu *aMenu)
 Add menu items to a menu that should be shown when right-clicking the Gerber layer widget.
 
void SetSmallestLayerString (const wxString &aString)
 Set the string that is used for determining the smallest string displayed in the layer's tab.
 
wxSize GetBestSize () const
 Return the preferred minimum size, taking into consideration the dynamic content.
 
int GetLayerRowCount () const
 Return the number of rows in the layer tab.
 
int GetRenderRowCount () const
 Return the number of rows in the render tab.
 
void AppendLayerRow (const ROW &aRow)
 Append a new row in the layer portion of the widget.
 
void AppendLayerRows (const ROW *aRowsArray, int aRowCount)
 Append new rows in the layer portion of the widget.
 
void ClearLayerRows ()
 Empty out the layer rows.
 
void AppendRenderRow (const ROW &aRow)
 Append a new row in the render portion of the widget.
 
void AppendRenderRows (const ROW *aRowsArray, int aRowCount)
 Append new rows in the render portion of the widget.
 
void ClearRenderRows ()
 Empty out the render rows.
 
void SelectLayerRow (int aRow)
 Change the row selection in the layer list to the given row.
 
void SelectLayer (int aLayer)
 Change the row selection in the layer list to aLayer provided.
 
int GetSelectedLayer ()
 Return the selected layer or -1 if none.
 
void SetLayerVisible (int aLayer, bool isVisible)
 Set aLayer visible or not.
 
bool IsLayerVisible (int aLayer)
 Return the visible state of the layer ROW associated with aLayer id.
 
void SetLayerColor (int aLayer, const COLOR4D &aColor)
 Change the color of aLayer.
 
COLOR4D GetLayerColor (int aLayer) const
 Return the color of the layer ROW associated with aLayer id.
 
COLOR4D GetRenderColor (int aRow) const
 Return the color of the Render ROW in position aRow.
 
void SetRenderState (int aId, bool isSet)
 Set the state of the checkbox associated with aId within the Render tab group of the widget.
 
bool GetRenderState (int aId)
 Return the state of the checkbox associated with aId.
 
void UpdateLayouts ()
 
void UpdateLayerIcons ()
 Update all layer manager icons (layers only).
 

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.
 
void OnLeftDownLayers (wxMouseEvent &event)
 
void OnRightDownLayer (wxMouseEvent &event, COLOR_SWATCH *aColorSwatch, const wxString &aLayerName)
 Called when user right-clicks a layer.
 
void OnLayerSwatchChanged (wxCommandEvent &aEvent)
 Called when a user changes a swatch color.
 
void OnLayerCheckBox (wxCommandEvent &event)
 Handle the "is layer visible" checkbox and propagates the event to the client's notification function.
 
void OnRightDownRender (wxMouseEvent &aEvent, COLOR_SWATCH *aColorSwatch, const wxString &aRenderName)
 Notify when user right-clicks a render option.
 
void OnRenderSwatchChanged (wxCommandEvent &aEvent)
 Called when user has changed the swatch color of a render entry.
 
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.
 
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.
 
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.
 
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.
 

Static Protected Member Functions

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

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

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

References _, KIUI::AddMenuItem(), delete_gerber, down, 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, KiBitmap(), reload, select_w_layer, show_all_layers, show_no_layers, tools, and up.

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

References GetLayerRowCount(), and insertLayerRow().

Referenced by AppendLayerRows(), and GERBER_LAYER_WIDGET::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 AppendLayerRow(), and 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 651 of file layer_widget.cpp.

References GetRenderRowCount(), and insertRenderRow().

Referenced by 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 AppendRenderRow(), and UpdateLayouts().

Referenced by GERBER_LAYER_WIDGET::ReFillRender().

◆ ClearLayerRows()

void LAYER_WIDGET::ClearLayerRows ( )
inherited

Empty out the layer rows.

Definition at line 645 of file layer_widget.cpp.

References m_LayersFlexGridSizer.

Referenced by GERBER_LAYER_WIDGET::ReFill().

◆ ClearRenderRows()

void LAYER_WIDGET::ClearRenderRows ( )
inherited

Empty out the render rows.

Definition at line 658 of file layer_widget.cpp.

References m_RenderFlexGridSizer.

Referenced by GERBER_LAYER_WIDGET::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 63 of file layer_widget.cpp.

References LYR_COLUMN_COUNT.

Referenced by insertLayerRow(), and 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.

References COLOR4D::BLACK.

Referenced by insertLayerRow(), and 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 582 of file layer_widget.cpp.

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

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

References LYR_COLUMN_COUNT.

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

◆ GetImagesList()

GERBER_FILE_IMAGE_LIST * GERBER_LAYER_WIDGET::GetImagesList ( )
private

Definition at line 71 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 753 of file layer_widget.cpp.

References findLayerRow(), getLayerComp(), and COLOR4D::UNSPECIFIED.

Referenced by GERBER_LAYER_WIDGET::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 261 of file layer_widget.cpp.

References LYR_COLUMN_COUNT, and m_LayersFlexGridSizer.

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

◆ GetLayerRowCount()

int LAYER_WIDGET::GetLayerRowCount ( ) const
inherited

Return the number of rows in the layer tab.

Definition at line 624 of file layer_widget.cpp.

References LYR_COLUMN_COUNT, and m_LayersFlexGridSizer.

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

◆ GetRenderColor()

COLOR4D LAYER_WIDGET::GetRenderColor ( int aRow) const
inherited

Return the color of the Render ROW in position aRow.

Definition at line 770 of file layer_widget.cpp.

References getRenderComp(), and COLOR4D::UNSPECIFIED.

Referenced by GERBER_LAYER_WIDGET::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 631 of file layer_widget.cpp.

References m_RenderFlexGridSizer, and RND_COLUMN_COUNT.

Referenced by AppendRenderRow(), findRenderRow(), and 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 801 of file layer_widget.cpp.

References findRenderRow(), and getRenderComp().

◆ GetSelectedLayer()

int LAYER_WIDGET::GetSelectedLayer ( )
inherited

Return the selected layer or -1 if none.

Definition at line 692 of file layer_widget.cpp.

References getDecodedId(), getLayerComp(), 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 723 of file layer_widget.cpp.

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

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

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

Referenced by 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 338 of file gerbview_layer_widget.cpp.

References GERBER_DRAW_LAYER, KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), KIGFX::RENDER_SETTINGS::LoadColors(), m_frame, COLOR_SETTINGS::SetColor(), 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 332 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, KIGFX::GERBVIEW_PAINTER::GetSettings(), m_frame, and OnLayerSelected().

◆ 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 279 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

Called when a user changes a swatch color.

Definition at line 154 of file layer_widget.cpp.

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

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

References m_frame.

◆ OnLeftDownLayers()

void LAYER_WIDGET::OnLeftDownLayers ( wxMouseEvent & event)
protectedinherited

◆ onPopupSelection()

◆ OnRenderCheckBox()

void LAYER_WIDGET::OnRenderCheckBox ( wxCommandEvent & event)
protectedinherited

Definition at line 241 of file layer_widget.cpp.

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

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

References KIGFX::COLOR, m_frame, COLOR_SETTINGS::SetColor(), 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 LAYER_GERBVIEW_GRID, m_frame, 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

Called when user right-clicks a layer.

Definition at line 125 of file layer_widget.cpp.

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

Referenced by insertLayerRow().

◆ onRightDownLayers()

void GERBER_LAYER_WIDGET::onRightDownLayers ( wxMouseEvent & event)
private

Put up a popup menu for the layer panel.

Definition at line 201 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 181 of file layer_widget.cpp.

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

Referenced by insertRenderRow().

◆ OnTabChange()

void LAYER_WIDGET::OnTabChange ( wxNotebookEvent & event)
protectedinherited

Definition at line 251 of file layer_widget.cpp.

References passOnFocus().

Referenced by LAYER_WIDGET().

◆ passOnFocus()

void LAYER_WIDGET::passOnFocus ( )
protectedinherited

◆ ReFill()

◆ ReFillRender()

◆ SelectLayer()

void LAYER_WIDGET::SelectLayer ( int aLayer)
inherited

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

Definition at line 685 of file layer_widget.cpp.

References findLayerRow(), and SelectLayerRow().

◆ SelectLayerRow()

void LAYER_WIDGET::SelectLayerRow ( int aRow)
inherited

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

Definition at line 664 of file layer_widget.cpp.

References getLayerComp(), m_CurrentRow, ROW_ICON_PROVIDER::OFF, ROW_ICON_PROVIDER::ON, passOnFocus(), and INDICATOR_ICON::SetIndicatorState().

Referenced by OnLeftDownLayers(), and SelectLayer().

◆ setLayerCheckbox()

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

Definition at line 710 of file layer_widget.cpp.

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

Referenced by SetLayerVisible().

◆ SetLayerColor()

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

Change the color of aLayer.

Definition at line 738 of file layer_widget.cpp.

References findLayerRow(), and 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 77 of file gerbview_layer_widget.cpp.

References _, and LAYER_WIDGET::m_notebook.

Referenced by GERBER_LAYER_WIDGET().

◆ SetLayerVisible()

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

Set aLayer visible or not.

This does not invoke OnLayerVisible().

Definition at line 703 of file layer_widget.cpp.

References OnLayerVisible(), and setLayerCheckbox().

Referenced by GERBER_LAYER_WIDGET::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 787 of file layer_widget.cpp.

References findRenderRow(), and getRenderComp().

◆ 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 m_smallestLayerString.

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

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

◆ updateLayerRow()

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

◆ UpdateLayouts()

void LAYER_WIDGET::UpdateLayouts ( )
inherited

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

selected row of layer list

Definition at line 474 of file layer_widget.h.

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

◆ m_FocusOwner

wxWindow* LAYER_WIDGET::m_FocusOwner
protectedinherited

Definition at line 473 of file layer_widget.h.

Referenced by LAYER_WIDGET(), and passOnFocus().

◆ m_frame

◆ m_IconProvider

ROW_ICON_PROVIDER* LAYER_WIDGET::m_IconProvider
protectedinherited

Definition at line 477 of file layer_widget.h.

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

◆ m_LayerPanel

wxPanel* LAYER_WIDGET::m_LayerPanel
protectedinherited

Definition at line 466 of file layer_widget.h.

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

◆ m_LayerScrolledWindow

wxScrolledWindow* LAYER_WIDGET::m_LayerScrolledWindow
protectedinherited

◆ m_LayersFlexGridSizer

wxFlexGridSizer* LAYER_WIDGET::m_LayersFlexGridSizer
protectedinherited

◆ m_notebook

wxNotebook* LAYER_WIDGET::m_notebook
protectedinherited

Definition at line 465 of file layer_widget.h.

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

◆ m_PointSize

int LAYER_WIDGET::m_PointSize
protectedinherited

Definition at line 475 of file layer_widget.h.

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

◆ m_RenderFlexGridSizer

wxFlexGridSizer* LAYER_WIDGET::m_RenderFlexGridSizer
protectedinherited

◆ m_RenderingPanel

wxPanel* LAYER_WIDGET::m_RenderingPanel
protectedinherited

Definition at line 469 of file layer_widget.h.

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

◆ m_RenderScrolledWindow

wxScrolledWindow* LAYER_WIDGET::m_RenderScrolledWindow
protectedinherited

Definition at line 470 of file layer_widget.h.

Referenced by insertRenderRow(), and LAYER_WIDGET().

◆ m_smallestLayerString

wxString LAYER_WIDGET::m_smallestLayerString
protectedinherited

Definition at line 479 of file layer_widget.h.

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


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