KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_sch_selection_filter.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) 2024 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef KICAD_PANEL_SCH_SELECTION_FILTER_H
22#define KICAD_PANEL_SCH_SELECTION_FILTER_H
23
25#include <wx/timer.h>
26#include <map>
27
28class SCH_BASE_FRAME;
31
32// Forward declare the event type
34wxDECLARE_EVENT( EVT_SCH_SELECTION_FILTER_FLASH, SCH_SELECTION_FILTER_EVENT );
35
36class SCH_SELECTION_FILTER_EVENT : public wxCommandEvent
37{
38public:
40 wxCommandEvent( EVT_SCH_SELECTION_FILTER_FLASH, id ), m_options( aOptions ) {}
41
42 wxEvent* Clone() const override
43 {
44 return new SCH_SELECTION_FILTER_EVENT( *this );
45 }
46
48};
49
50
52{
53public:
54 PANEL_SCH_SELECTION_FILTER( wxWindow* aParent );
55
57
59
60protected:
61 void OnFilterChanged( wxCommandEvent& aEvent ) override;
62 void OnLanguageChanged( wxCommandEvent& aEvent );
63
64private:
66
67 void onRightClick( wxMouseEvent& aEvent );
68
69 void onPopupSelection( wxCommandEvent& aEvent );
70
71 void flashCheckbox( wxCheckBox* aBox );
72 void onFlashTimer( wxTimerEvent& aEvent );
74 void onPanelPaint( wxPaintEvent& aEvent );
75
76private:
79 wxCheckBox* m_onlyCheckbox;
80 std::map<wxCheckBox*, int> m_flashCounters;
81 wxTimer m_flashTimer;
83 wxColour m_defaultBg;
84};
85
86#endif //KICAD_PANEL_SCH_SELECTION_FILTER_H
PANEL_SCH_SELECTION_FILTER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
bool setFilterFromCheckboxes(SCH_SELECTION_FILTER_OPTIONS &aOptions)
void OnFlashEvent(SCH_SELECTION_FILTER_EVENT &aEvent)
void OnLanguageChanged(wxCommandEvent &aEvent)
void SetCheckboxesFromFilter(SCH_SELECTION_FILTER_OPTIONS &aOptions)
void onRightClick(wxMouseEvent &aEvent)
void onPanelPaint(wxPaintEvent &aEvent)
void onFlashTimer(wxTimerEvent &aEvent)
void OnFilterChanged(wxCommandEvent &aEvent) override
std::map< wxCheckBox *, int > m_flashCounters
void onPopupSelection(wxCommandEvent &aEvent)
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_SELECTION_FILTER_OPTIONS m_options
SCH_SELECTION_FILTER_EVENT(const SCH_SELECTION_FILTER_OPTIONS &aOptions=SCH_SELECTION_FILTER_OPTIONS(), int id=0)
wxEvent * Clone() const override
wxDECLARE_EVENT(EVT_SCH_SELECTION_FILTER_FLASH, SCH_SELECTION_FILTER_EVENT)