KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_re_layers_selection_choice_popup.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_CHOICE_POPUP_H
21#define DRC_RE_LAYER_SELECTION_CHOICE_POPUP_H
22
23#include <wx/wx.h>
24#include <wx/combo.h>
25#include <wx/checklst.h>
26
27#include <lset.h>
28#include <lseq.h>
29
30
31class DRC_RE_LAYER_SELECTION_CHOICE_POPUP : public wxComboPopup
32{
33public:
35
36 void Init() override;
37
38 bool Create( wxWindow* aParent ) override;
39
40 wxWindow* GetControl() override;
41
42 void SetStringValue( const wxString& value ) override;
43
44 wxString GetStringValue() const override;
45
46 wxString GetSelectedItemsString();
47
48 std::vector<PCB_LAYER_ID> GetSelectedLayers(
49 const std::vector<PCB_LAYER_ID>& aAllLayerIds,
50 const std::function<wxString( PCB_LAYER_ID )>& nameGetter );
51
52 void SetSelections( const std::vector<PCB_LAYER_ID>& aLayerIDs,
53 const std::function<wxString( PCB_LAYER_ID )>& aNameGetter );
54
55 void PopulateWithLayerIDs( const std::vector<PCB_LAYER_ID>& aLayerIDs,
56 const std::function<wxString( PCB_LAYER_ID )>& aNameGetter );
57
58private:
59 void populate( const wxArrayString& items );
60
61private:
62 wxCheckListBox* m_checkListBox;
64};
65
66#endif // DRC_RE_LAYER_SELECTION_CHOICE_POPUP_H
std::vector< PCB_LAYER_ID > GetSelectedLayers(const std::vector< PCB_LAYER_ID > &aAllLayerIds, const std::function< wxString(PCB_LAYER_ID)> &nameGetter)
void PopulateWithLayerIDs(const std::vector< PCB_LAYER_ID > &aLayerIDs, const std::function< wxString(PCB_LAYER_ID)> &aNameGetter)
void SetSelections(const std::vector< PCB_LAYER_ID > &aLayerIDs, const std::function< wxString(PCB_LAYER_ID)> &aNameGetter)
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60