2022-09-14 02:59:57 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SEARCH_PANE_TAB_H
|
|
|
|
#define SEARCH_PANE_TAB_H
|
|
|
|
|
2022-09-21 07:18:34 +00:00
|
|
|
#include <vector>
|
2022-09-14 02:59:57 +00:00
|
|
|
#include <wx/listctrl.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/panel.h>
|
|
|
|
|
|
|
|
class SEARCH_HANDLER;
|
|
|
|
|
|
|
|
|
|
|
|
class SEARCH_PANE_LISTVIEW : public wxListView
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SEARCH_PANE_LISTVIEW( SEARCH_HANDLER* handler,
|
|
|
|
wxWindow* parent, wxWindowID winid = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize );
|
|
|
|
|
2022-09-27 23:16:29 +00:00
|
|
|
virtual ~SEARCH_PANE_LISTVIEW();
|
|
|
|
|
2022-09-14 02:59:57 +00:00
|
|
|
void RefreshColumnNames();
|
|
|
|
|
2023-08-09 17:30:58 +00:00
|
|
|
void Sort();
|
|
|
|
|
2022-09-14 02:59:57 +00:00
|
|
|
protected:
|
|
|
|
wxString OnGetItemText( long item, long column ) const override;
|
2022-09-21 03:38:06 +00:00
|
|
|
void OnItemSelected( wxListEvent& aEvent );
|
2023-01-25 16:09:23 +00:00
|
|
|
void OnItemActivated( wxListEvent& aEvent );
|
2022-09-21 03:58:49 +00:00
|
|
|
void OnItemDeselected( wxListEvent& aEvent );
|
2023-08-09 17:30:58 +00:00
|
|
|
void OnColClicked( wxListEvent& aEvent );
|
2023-11-09 14:30:23 +00:00
|
|
|
void OnUpdateUI( wxUpdateUIEvent& aEvent );
|
2022-09-21 03:58:49 +00:00
|
|
|
|
2022-09-21 07:04:31 +00:00
|
|
|
void GetSelectRowsList( std::vector<long>& aSelectedList );
|
2022-09-14 02:59:57 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SEARCH_HANDLER* m_handler;
|
2023-08-09 17:30:58 +00:00
|
|
|
int m_sortCol;
|
|
|
|
bool m_sortAscending;
|
2023-11-09 14:30:23 +00:00
|
|
|
bool m_selectionDirty;
|
2022-09-14 02:59:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SEARCH_PANE_TAB : public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SEARCH_PANE_TAB( SEARCH_HANDLER* handler, wxWindow* parent, wxWindowID aId = wxID_ANY,
|
|
|
|
const wxPoint& aLocation = wxDefaultPosition,
|
|
|
|
const wxSize& aSize = wxDefaultSize );
|
|
|
|
|
|
|
|
void Search( wxString& query );
|
2022-09-21 03:38:06 +00:00
|
|
|
void Clear();
|
2022-09-14 02:59:57 +00:00
|
|
|
void RefreshColumnNames();
|
|
|
|
|
|
|
|
SEARCH_HANDLER* GetSearchHandler() const { return m_handler; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
SEARCH_PANE_LISTVIEW* m_listView;
|
|
|
|
SEARCH_HANDLER* m_handler;
|
|
|
|
};
|
|
|
|
|
2023-01-25 16:09:23 +00:00
|
|
|
#endif
|