KiCad PCB EDA Suite
gerbview_layer_widget.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2004-2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2010-2021 KiCad Developers, see change_log.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 
27 #ifndef GERBER_LAYER_WIDGET_H
28 #define GERBER_LAYER_WIDGET_H
29 
30 #include "layer_widget.h"
31 
37 {
38 public:
43  GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner );
44 
48  void ReFill();
49 
53  void ReFillRender();
54 
55  //-----<implement LAYER_WIDGET abstract callback functions>-----------
56  void OnLayerRightClick( wxMenu& aMenu ) override;
57  void OnLayerColorChange( int aLayer, const COLOR4D& aColor ) override;
58  bool OnLayerSelect( int aLayer ) override;
59  void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ) override;
60  void OnRenderColorChange( int aId, const COLOR4D& aColor ) override;
61  void OnRenderEnable( int aId, bool isEnabled ) override;
62 
69  //-----</implement LAYER_WIDGET abstract callback functions>----------
70 
78  bool OnLayerSelected(); // postprocess after an active layer selection
79  // ensure active layer visible if
80  // m_alwaysShowActiveCopperLayer is true;
81 
87  void AddRightClickMenuItems( wxMenu* aMenu );
88 
89 protected:
90  // popup menu ids. in layer manager
92  {
100  };
101 
102 private:
106  void onRightDownLayers( wxMouseEvent& event );
107 
108  void onPopupSelection( wxCommandEvent& event );
109 
113 
118  virtual bool useAlternateBitmap( int aRow ) override;
119 
121 
123 
124  bool m_alwaysShowActiveLayer; // If true: Only shows the current active layer
125  // even if it is changed
126 };
127 
128 #endif // GERBER_LAYER_WIDGET_H
void installRightLayerClickHandler()
this is for the popup menu, the right click handler has to be installed on every child control within...
void onRightDownLayers(wxMouseEvent &event)
Put up a popup menu for the layer panel.
void AddRightClickMenuItems(wxMenu *aMenu)
Add menu items to a menu that should be shown when right-clicking the Gerber layer widget.
GERBER_LAYER_WIDGET(GERBVIEW_FRAME *aParent, wxWindow *aFocusOwner)
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.
GERBER_FILE_IMAGE_LIST * GetImagesList()
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
void SetLayersManagerTabsText()
Update the layer manager tabs labels.
bool OnLayerSelect(int aLayer) override
Notify client code whenever the user selects a different layer.
void OnLayerRightClick(wxMenu &aMenu) override
Notify client code about a layer being right-clicked.
Abstract functions of LAYER_WIDGET so they may be tied into the GERBVIEW_FRAME's data and we can add ...
void onPopupSelection(wxCommandEvent &event)
void OnLayerColorChange(int aLayer, const COLOR4D &aColor) override
Notify client code about a layer color change.
virtual bool useAlternateBitmap(int aRow) override
void ReFill()
Rebuild Render for instance after the config is read.
Manage a list of layers with the notion of a "current" layer, and layer specific visibility control.
Definition: layer_widget.h:77
void OnRenderEnable(int aId, bool isEnabled) override
Notify client code whenever the user changes an rendering enable in one of the rendering checkboxes.
void ReFillRender()
Rebuild Render for instance after the config is read.
bool OnLayerSelected()
Ensure the active layer is visible, and other layers not visible when m_alwaysShowActiveLayer is true...
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103