KiCad PCB EDA Suite
Loading...
Searching...
No Matches
search_pane_tab.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 SEARCH_PANE_TAB_H
21#define SEARCH_PANE_TAB_H
22
23#include <vector>
24#include <wx/listctrl.h>
25#include <wx/sizer.h>
26#include <wx/panel.h>
27
28class SEARCH_HANDLER;
29
30
31class SEARCH_PANE_LISTVIEW : public wxListView
32{
33public:
35 wxWindow* parent, wxWindowID winid = wxID_ANY,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize );
38
39 virtual ~SEARCH_PANE_LISTVIEW();
40
41 void RefreshColumnNames();
42
43 std::vector<long> Sort();
44
45protected:
46 wxString OnGetItemText( long item, long column ) const override;
47 void OnItemSelected( wxListEvent& aEvent );
48 void OnItemActivated( wxListEvent& aEvent );
49 void OnItemDeselected( wxListEvent& aEvent );
50 void OnColClicked( wxListEvent& aEvent );
51 void OnUpdateUI( wxUpdateUIEvent& aEvent );
52 void OnChar( wxKeyEvent& aEvent );
53
54 void GetSelectRowsList( std::vector<long>& aSelectedList );
55
56private:
61};
62
63
64class SEARCH_PANE_TAB : public wxPanel
65{
66public:
67 SEARCH_PANE_TAB( SEARCH_HANDLER* handler, wxWindow* parent, wxWindowID aId = wxID_ANY,
68 const wxPoint& aLocation = wxDefaultPosition,
69 const wxSize& aSize = wxDefaultSize );
70
71 void Search( wxString& query );
72 void Clear();
73 void RefreshColumnNames();
74
76
77private:
80};
81
82#endif
void OnItemDeselected(wxListEvent &aEvent)
void GetSelectRowsList(std::vector< long > &aSelectedList)
void OnColClicked(wxListEvent &aEvent)
void OnChar(wxKeyEvent &aEvent)
void OnItemSelected(wxListEvent &aEvent)
SEARCH_HANDLER * m_handler
void OnItemActivated(wxListEvent &aEvent)
std::vector< long > Sort()
void OnUpdateUI(wxUpdateUIEvent &aEvent)
wxString OnGetItemText(long item, long column) const override
SEARCH_HANDLER * m_handler
void Search(wxString &query)
SEARCH_PANE_LISTVIEW * m_listView
SEARCH_HANDLER * GetSearchHandler() const