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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef DIALOG_ITEMS_LIST_H
25#define DIALOG_ITEMS_LIST_H
26
27#include <dialog_shim.h>
28#include <wx/collpane.h>
29#include <wx/listctrl.h>
30#include <wx/stattext.h>
31#include <functional>
32#include <vector>
33
35{
36public:
37 DIALOG_ITEMS_LIST( wxWindow* aParent, const wxString& aTitle, const wxString& aMessage,
38 const wxString& aDetailsLabel );
40
41 void AddItems( const std::vector<wxString>& aItems );
42 void SetSelectionCallback( std::function<void(int)> aCallback );
43
44private:
45 void onSelectionChanged( wxListEvent& aEvent );
46 void onCollapse( wxCollapsiblePaneEvent& aEvent );
47
48 wxStaticText* m_message;
49 wxCollapsiblePane* m_collapsiblePane;
50 wxListCtrl* m_listCtrl;
51 std::function<void(int)> m_callback;
52};
53
54#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)