KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_items_list.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 The 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,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef DIALOG_ITEMS_LIST_H
21#define DIALOG_ITEMS_LIST_H
22
23#include <dialog_shim.h>
24#include <wx/collpane.h>
25#include <wx/listctrl.h>
26#include <wx/stattext.h>
27#include <functional>
28#include <vector>
29
31{
32public:
33 DIALOG_ITEMS_LIST( wxWindow* aParent, const wxString& aTitle, const wxString& aMessage,
34 const wxString& aDetailsLabel );
36
37 void AddItems( const std::vector<wxString>& aItems );
38 void SetSelectionCallback( std::function<void(int)> aCallback );
39
40private:
41 void onSelectionChanged( wxListEvent& aEvent );
42 void onCollapse( wxCollapsiblePaneEvent& aEvent );
43
44 wxStaticText* m_message;
45 wxCollapsiblePane* m_collapsiblePane;
46 wxListCtrl* m_listCtrl;
47 std::function<void(int)> m_callback;
48};
49
50#endif // DIALOG_ITEMS_LIST_H
std::function< void(int)> m_callback
wxStaticText * m_message
void onCollapse(wxCollapsiblePaneEvent &aEvent)
void SetSelectionCallback(std::function< void(int)> aCallback)
void AddItems(const std::vector< wxString > &aItems)
wxCollapsiblePane * m_collapsiblePane
void onSelectionChanged(wxListEvent &aEvent)
wxListCtrl * m_listCtrl
DIALOG_ITEMS_LIST(wxWindow *aParent, const wxString &aTitle, const wxString &aMessage, const wxString &aDetailsLabel)
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)