KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eda_reorderable_list_dialog.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) 2022 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 EDA_REORDERABLE_LIST_DIALOG_H
21#define EDA_REORDERABLE_LIST_DIALOG_H
22
24
30{
31public:
32
39 EDA_REORDERABLE_LIST_DIALOG( wxWindow* aParent, const wxString& aTitle,
40 const std::vector<wxString>& aAllItems,
41 const std::vector<wxString>& aEnabledItems );
42
43 const std::vector<wxString>& EnabledList() { return m_enabledItems; }
44
45protected:
46 void onAddItem( wxCommandEvent& aEvent ) override;
47 void onRemoveItem( wxCommandEvent& aEvent ) override;
48 void onMoveUp( wxCommandEvent& aEvent ) override;
49 void onMoveDown( wxCommandEvent& aEvent ) override;
50 void onAvailableListItemSelected( wxListEvent& event ) override;
51 void onEnabledListItemSelected( wxListEvent& event ) override;
52
53private:
54 void updateItems();
55
56 bool getSelectedItem( wxListCtrl* aList, wxListItem& aInfo );
57
58 std::vector<wxString> m_availableItems;
59 std::vector<wxString> m_enabledItems;
60
63};
64
65#endif
Class EDA_REORDERABLE_LIST_DIALOG_BASE.
A dialog which allows selecting a list of items from a list of available items, and reordering those ...
std::vector< wxString > m_availableItems
void onAvailableListItemSelected(wxListEvent &event) override
bool getSelectedItem(wxListCtrl *aList, wxListItem &aInfo)
void onMoveUp(wxCommandEvent &aEvent) override
void onMoveDown(wxCommandEvent &aEvent) override
const std::vector< wxString > & EnabledList()
void onEnabledListItemSelected(wxListEvent &event) override
void onRemoveItem(wxCommandEvent &aEvent) override
void onAddItem(wxCommandEvent &aEvent) override
std::vector< wxString > m_enabledItems