KiCad PCB EDA Suite
Loading...
Searching...
No Matches
layer_box_selector.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) 2011-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef LAYER_BOX_SELECTOR_H
22#define LAYER_BOX_SELECTOR_H
23
24#include <wx/bmpcbox.h>
25
26
31{
32public:
34
35 virtual ~LAYER_SELECTOR() { }
36
37 bool SetLayersHotkeys( bool value );
38
39protected:
41 virtual bool isLayerEnabled( int aLayer ) const = 0;
42
44};
45
46
50class LAYER_BOX_SELECTOR : public wxBitmapComboBox, public LAYER_SELECTOR
51{
52public:
53 LAYER_BOX_SELECTOR( wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize, int n = 0,
55 const wxString choices[] = nullptr );
56
57 ~LAYER_BOX_SELECTOR() override;
58
59 int GetLayerSelection() const;
60
61 int SetLayerSelection( int layer );
62
63 // Reload the Layers
64 // Virtual pure function because GerbView uses its own functions in a derived class
65 virtual void Resync() = 0;
66
67private:
68#ifdef __WXMAC__
69 void onKeyDown( wxKeyEvent& aEvent );
70 void OnDrawBackground( wxDC& dc, const wxRect& rect, int item, int flags) const override;
71#endif
72};
73
74#endif // LAYER_BOX_SELECTOR_H
LAYER_BOX_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=nullptr)
int SetLayerSelection(int layer)
virtual void Resync()=0
virtual bool isLayerEnabled(int aLayer) const =0
Return true if the layer id is enabled (i.e. is it should be displayed).
bool SetLayersHotkeys(bool value)
virtual ~LAYER_SELECTOR()