KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_re_layers_selection_combo.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) 2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef DRC_RE_LAYER_SELECTION_COMBO_H
21#define DRC_RE_LAYER_SELECTION_COMBO_H
22
23#include <wx/wx.h>
24#include <wx/combo.h>
25#include <wx/checklst.h>
26
28
29
30class DRC_RE_LAYER_SELECTION_COMBO : public wxComboCtrl
31{
32public:
33 DRC_RE_LAYER_SELECTION_COMBO( wxWindow* aParent, const std::vector<PCB_LAYER_ID>& aLayerIDs,
34 const std::function<wxString( PCB_LAYER_ID )>& aNameGetter );
35
37
38 wxString GetSelectedItemsString();
39
40 std::vector<PCB_LAYER_ID> GetSelectedLayers();
41
42 void SetItemsSelected( const std::vector<PCB_LAYER_ID>& aSelectedLayers );
43
44private:
45 void onPopupClose( wxCommandEvent& aEvent );
46
47 void onKeyDown( wxKeyEvent& aEvent );
48
49 void onMouseClick( wxMouseEvent& aEvent );
50
51private:
53 std::vector<PCB_LAYER_ID> m_layerIDs; // Stores the layer IDs
54 std::function<wxString( PCB_LAYER_ID )> m_nameGetter; // Function to get layer names
55};
56
57#endif // DRC_RE_LAYER_SELECTION_COMBO_H
std::vector< PCB_LAYER_ID > GetSelectedLayers()
DRC_RE_LAYER_SELECTION_CHOICE_POPUP * m_popup
void SetItemsSelected(const std::vector< PCB_LAYER_ID > &aSelectedLayers)
void onPopupClose(wxCommandEvent &aEvent)
DRC_RE_LAYER_SELECTION_COMBO(wxWindow *aParent, const std::vector< PCB_LAYER_ID > &aLayerIDs, const std::function< wxString(PCB_LAYER_ID)> &aNameGetter)
std::function< wxString(PCB_LAYER_ID)> m_nameGetter
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60