KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_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) 2020 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_SELECTION_FILTER_H
22#define KICAD_PANEL_SELECTION_FILTER_H
23
25#include <wx/timer.h>
26#include <map>
27
28
31
32// Forward declare the event type
34wxDECLARE_EVENT( EVT_PCB_SELECTION_FILTER_FLASH, PCB_SELECTION_FILTER_EVENT );
35
36class PCB_SELECTION_FILTER_EVENT : public wxCommandEvent
37{
38public:
40 wxCommandEvent( EVT_PCB_SELECTION_FILTER_FLASH, id ), m_options( aOptions ) {}
41
42 wxEvent* Clone() const override
43 {
44 return new PCB_SELECTION_FILTER_EVENT( *this );
45 }
46
48};
49
50
52{
53public:
54 PANEL_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
87#endif // KICAD_PANEL_SELECTION_FILTER_H
PANEL_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)
PCB_BASE_EDIT_FRAME * m_frame
void onPopupSelection(wxCommandEvent &aEvent)
std::map< wxCheckBox *, int > m_flashCounters
void flashCheckbox(wxCheckBox *aBox)
PCB_SELECTION_TOOL * m_tool
bool setFilterFromCheckboxes(PCB_SELECTION_FILTER_OPTIONS &aOptions)
PANEL_SELECTION_FILTER(wxWindow *aParent)
void OnFlashEvent(PCB_SELECTION_FILTER_EVENT &aEvent)
void SetCheckboxesFromFilter(PCB_SELECTION_FILTER_OPTIONS &aOptions)
void onFlashTimer(wxTimerEvent &aEvent)
void OnLanguageChanged(wxCommandEvent &aEvent)
void OnFilterChanged(wxCommandEvent &aEvent) override
void onRightClick(wxMouseEvent &aEvent)
void onPanelPaint(wxPaintEvent &aEvent)
Common, abstract interface for edit frames.
PCB_SELECTION_FILTER_OPTIONS m_options
PCB_SELECTION_FILTER_EVENT(const PCB_SELECTION_FILTER_OPTIONS &aOptions=PCB_SELECTION_FILTER_OPTIONS(), int id=0)
wxEvent * Clone() const override
The selection tool: currently supports:
wxDECLARE_EVENT(EVT_PCB_SELECTION_FILTER_FLASH, PCB_SELECTION_FILTER_EVENT)
This file contains data structures that are saved in the project file or project local settings file ...