KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_zone_manager.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) 2023 Ethan Chien <[email protected]>
5 * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef DIALOG_ZONE_MANAGER_H
26#define DIALOG_ZONE_MANAGER_H
27
28#include <memory>
29#include <optional>
30#include <wx/dataview.h>
31#include <wx/event.h>
32#include <wx/radiobut.h>
33#include <kiface_base.h>
34#include <confirm.h>
35#include <pcb_edit_frame.h>
36#include <pcbnew_settings.h>
37#include <zones.h>
38#include <widgets/unit_binder.h>
39#include <zone.h>
40#include <pad.h>
41#include <board.h>
42#include <trigo.h>
43#include <eda_pattern_match.h>
44
46
47
49class MODEL_ZONES_PRIORITY_LIST;
51class MODEL_ZONE_LAYERS_LIST;
52class ZONES_CONTAINER;
54class ZONE_FILLER;
55class COMMIT;
56class PANEL_ZONE_GAL;
57enum class ZONE_INDEX_MOVEMENT;
59{
60 enum
61 {
63 };
64
65public:
66 DIALOG_ZONE_MANAGER( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aZoneInfo );
68
69protected:
70 void OnZoneSelectionChanged( ZONE* aZone );
71
72 void OnDataViewCtrlSelectionChanged( wxDataViewEvent& event ) override;
73
74 void SelectZoneTableItem( wxDataViewItem const& aItem );
75
76 void OnViewZonesOverviewOnLeftUp( wxMouseEvent& aEvent ) override;
77 void onDialogResize( wxSizeEvent& event ) override;
78
79
80 void OnOk( wxCommandEvent& aEvt );
81
82
83#if wxUSE_DRAG_AND_DROP
84
85 void OnBeginDrag( wxDataViewEvent& aEvent );
86
87 void OnDropPossible( wxDataViewEvent& aEvent );
88
89 void OnDrop( wxDataViewEvent& aEvent );
90
91#endif // wxUSE_DRAG_AND_DROP
92
93 void OnZoneNameUpdate( wxCommandEvent& aEvent );
94
95 void OnZonesTableRowCountChange( wxCommandEvent& aEvent );
96
97 void OnCheckBoxClicked( wxCommandEvent& aEvent );
98
100
101 void OnMoveUpClick( wxCommandEvent& aEvent );
102
103 void OnMoveDownClick( wxCommandEvent& aEvent );
104
105 void OnFilterCtrlCancel( wxCommandEvent& aEvent ) override;
106
107 void OnFilterCtrlSearch( wxCommandEvent& aEvent ) override;
108
109 void OnFilterCtrlTextChange( wxCommandEvent& aEvent ) override;
110
111 void OnFilterCtrlEnter( wxCommandEvent& aEvent ) override;
112
113 void OnRepourCheck( wxCommandEvent& aEvent ) override;
114
115 void OnButtonApplyClick( wxCommandEvent& aEvent ) override;
116
117 void PostProcessZoneViewSelectionChange( wxDataViewItem const& item );
118
119 void OnTableChar( wxKeyEvent& event ) override;
120
121 void OnTableCharHook( wxKeyEvent& event ) override;
122
123private:
124 void GenericProcessChar( wxKeyEvent& event );
125
126 void OnIDle( wxIdleEvent& aEvent );
127
128 void FitCanvasToScreen();
129
130
131private:
134 std::unique_ptr<ZONES_CONTAINER> m_zonesContainer;
136 wxObjectDataPtr<MODEL_ZONES_OVERVIEW_TABLE> m_modelZoneOverviewTable;
138 std::optional<unsigned> m_priorityDragIndex;
139 std::unique_ptr<ZONE_FILLER> m_filler;
143};
144
145#endif
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition: commit.h:74
Class DIALOG_ZONE_MANAGER_BASE.
void OnMoveDownClick(wxCommandEvent &aEvent)
void OnButtonApplyClick(wxCommandEvent &aEvent) override
void OnZoneNameUpdate(wxCommandEvent &aEvent)
PANE_ZONE_VIEWER * m_zoneViewer
void OnViewZonesOverviewOnLeftUp(wxMouseEvent &aEvent) override
~DIALOG_ZONE_MANAGER() override
void PostProcessZoneViewSelectionChange(wxDataViewItem const &item)
void GenericProcessChar(wxKeyEvent &event)
PCB_BASE_FRAME * m_pcbFrame
void OnIDle(wxIdleEvent &aEvent)
PANEL_ZONE_PROPERTIES * m_panelZoneProperties
std::unique_ptr< ZONE_FILLER > m_filler
void OnRepourCheck(wxCommandEvent &aEvent) override
void OnTableChar(wxKeyEvent &event) override
void onDialogResize(wxSizeEvent &event) override
void MoveSelectedZonePriority(ZONE_INDEX_MOVEMENT aMove)
void OnDataViewCtrlSelectionChanged(wxDataViewEvent &event) override
std::optional< unsigned > m_priorityDragIndex
void OnTableCharHook(wxKeyEvent &event) override
void OnOk(wxCommandEvent &aEvt)
void OnCheckBoxClicked(wxCommandEvent &aEvent)
void OnMoveUpClick(wxCommandEvent &aEvent)
void OnFilterCtrlTextChange(wxCommandEvent &aEvent) override
ZONE_SETTINGS * m_zoneInfo
void SelectZoneTableItem(wxDataViewItem const &aItem)
void OnFilterCtrlCancel(wxCommandEvent &aEvent) override
wxObjectDataPtr< MODEL_ZONES_OVERVIEW_TABLE > m_modelZoneOverviewTable
void OnFilterCtrlEnter(wxCommandEvent &aEvent) override
void OnZoneSelectionChanged(ZONE *aZone)
void OnZonesTableRowCountChange(wxCommandEvent &aEvent)
std::unique_ptr< ZONES_CONTAINER > m_zonesContainer
void OnFilterCtrlSearch(wxCommandEvent &aEvent) override
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
ZONE_SETTINGS handles zones parameters.
Definition: zone_settings.h:71
Handle a list of polygons defining a copper zone.
Definition: zone.h:72
This file is part of the common library.
Abstract pattern-matching tool and implementations.