KiCad PCB EDA Suite
class_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 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 /************************************************************/
28 /* class_gerber_layer_widget.h : header for the layers manager */
29 /************************************************************/
30 
31 #ifndef _CLASS_GERBER_LAYER_WIDGET_H_
32 #define _CLASS_GERBER_LAYER_WIDGET_H_
33 
34 #include <layer_widget.h>
35 
43 {
45  bool m_alwaysShowActiveLayer; // If true: Only shows the current active layer
46  // even if it is changed
47 
48 
53  void onRightDownLayers( wxMouseEvent& event );
54 
55  void onPopupSelection( wxCommandEvent& event );
56 
60 
66  virtual bool useAlternateBitmap(int aRow) override;
67 
68  virtual bool AreArbitraryColorsAllowed() override;
69 
71 
72 public:
73 
82  GERBER_LAYER_WIDGET( GERBVIEW_FRAME* aParent, wxWindow* aFocusOwner, int aPointSize = 10 );
83 
84  void ReFill();
85 
90  void ReFillRender();
91 
92  //-----<implement LAYER_WIDGET abstract callback functions>-----------
93  void OnLayerRightClick( wxMenu& aMenu ) override;
94  void OnLayerColorChange( int aLayer, COLOR4D aColor ) override;
95  bool OnLayerSelect( int aLayer ) override;
96  void OnLayerVisible( int aLayer, bool isVisible, bool isFinal ) override;
97  void OnRenderColorChange( int aId, COLOR4D aColor ) override;
98  void OnRenderEnable( int aId, bool isEnabled ) override;
99 
105  void SetLayersManagerTabsText( );
106  //-----</implement LAYER_WIDGET abstract callback functions>----------
107 
116  bool OnLayerSelected(); // postprocess after an active layer selection
117  // ensure active layer visible if
118  // m_alwaysShowActiveCopperLayer is true;
119 
125  void AddRightClickMenuItems( wxMenu& menu );
126 
127 protected:
128  // popup menu ids. in layer manager
130  {
138  };
139 };
140 
141 #endif // _CLASS_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 OnLayerColorChange(int aLayer, COLOR4D aColor) override
Function OnLayerColorChange is called to notify client code about a layer color change.
void AddRightClickMenuItems(wxMenu &menu)
Function addRightClickMenuItems add menu items to a menu that should be shown when right-clicking the...
void onRightDownLayers(wxMouseEvent &event)
Function OnRightDownLayers puts up a popup menu for the layer panel.
void OnLayerVisible(int aLayer, bool isVisible, bool isFinal) override
Function OnLayerVisible is called to notify client code about a layer visibility change.
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...
GERBER_LAYER_WIDGET(GERBVIEW_FRAME *aParent, wxWindow *aFocusOwner, int aPointSize=10)
Constructor.
void SetLayersManagerTabsText()
Function SetLayersManagerTabsText Update the layer manager tabs labels Useful when changing Language ...
bool OnLayerSelect(int aLayer) override
Function OnLayerSelect is called to notify client code whenever the user selects a different layer...
void OnRenderColorChange(int aId, COLOR4D aColor) override
Function OnRenderColorChange is called to notify client code whenever the user changes a rendering co...
void OnLayerRightClick(wxMenu &aMenu) override
Function OnLayerRightClick is called to notify client code about a layer being right-clicked.
Class GERBER_LAYER_WIDGET is here to implement the abtract functions of LAYER_WIDGET so they may be t...
void onPopupSelection(wxCommandEvent &event)
virtual bool AreArbitraryColorsAllowed() override
Subclasses can override this to provide logic for allowing arbitrary color selection via wxColourPick...
virtual bool useAlternateBitmap(int aRow) override
Virtual Function useAlternateBitmap.
Class LAYER_WIDGET is abstract and is used to manage a list of layers, with the notion of a "current"...
Definition: layer_widget.h:77
void OnRenderEnable(int aId, bool isEnabled) override
Function OnRenderEnable is called to notify client code whenever the user changes an rendering enable...
void ReFillRender()
Function ReFillRender Rebuild Render for instance after the config is read.
bool OnLayerSelected()
Function OnLayerSelected ensure the active layer is visible, and other layers not visible when m_alwa...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39