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 The 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#pragma once
26
27#include <memory>
28#include <optional>
29#include <wx/dataview.h>
30#include <wx/event.h>
31#include <wx/radiobut.h>
32#include <kiface_base.h>
33#include <confirm.h>
34#include <pcb_edit_frame.h>
35#include <pcbnew_settings.h>
36#include <zones.h>
37#include <zone_settings_bag.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
51class ZONE_FILLER;
52class COMMIT;
54enum class ZONE_INDEX_MOVEMENT;
55
56
58{
59public:
62
63 bool TransferDataToWindow() override;
64
65 bool GetRepourOnClose() { return m_checkRepour->GetValue(); }
66
67protected:
68 void OnZoneSelectionChanged( ZONE* aZone );
69 void OnDataViewCtrlSelectionChanged( wxDataViewEvent& event ) override;
70 void SelectZoneTableItem( wxDataViewItem const& aItem );
71 void OnViewZonesOverviewOnLeftUp( wxMouseEvent& aEvent ) override;
72 void onDialogResize( wxSizeEvent& event ) override;
73 void OnOk( wxCommandEvent& aEvt ) override;
74
75#if wxUSE_DRAG_AND_DROP
76 void OnBeginDrag( wxDataViewEvent& aEvent );
77 void OnDropPossible( wxDataViewEvent& aEvent );
78 void OnDrop( wxDataViewEvent& aEvent );
79#endif // wxUSE_DRAG_AND_DROP
80
81 void OnZoneNameUpdate( wxCommandEvent& aEvent );
82 void OnZoneNetUpdate( wxCommandEvent& aEvent );
83 void OnZonesTableRowCountChange( wxCommandEvent& aEvent );
84 void OnCheckBoxClicked( wxCommandEvent& aEvent );
85
87
88 void OnMoveUpClick( wxCommandEvent& aEvent ) override;
89 void OnMoveDownClick( wxCommandEvent& aEvent ) override;
90 void OnFilterCtrlCancel( wxCommandEvent& aEvent ) override;
91 void OnFilterCtrlSearch( wxCommandEvent& aEvent ) override;
92 void OnFilterCtrlTextChange( wxCommandEvent& aEvent ) override;
93 void OnFilterCtrlEnter( wxCommandEvent& aEvent ) override;
94 void OnUpdateDisplayedZonesClick( wxCommandEvent& aEvent ) override;
95
96 void PostProcessZoneViewSelChange( wxDataViewItem const& aItem );
97
98 void OnTableChar( wxKeyEvent& event ) override;
99 void OnTableCharHook( wxKeyEvent& event ) override;
100
101private:
102 void GenericProcessChar( wxKeyEvent& event );
103
104 void OnIdle( wxIdleEvent& aEvent );
105
106 void FitCanvasToScreen();
107
108private:
112 wxObjectDataPtr<MODEL_ZONES_OVERVIEW> m_modelZonesOverview;
114 std::optional<unsigned> m_priorityDragIndex;
115 std::unique_ptr<ZONE_FILLER> m_filler;
119};
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition commit.h:72
DIALOG_ZONE_MANAGER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Zone Manager"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnZoneNameUpdate(wxCommandEvent &aEvent)
void OnViewZonesOverviewOnLeftUp(wxMouseEvent &aEvent) override
~DIALOG_ZONE_MANAGER() override
void GenericProcessChar(wxKeyEvent &event)
PCB_BASE_FRAME * m_pcbFrame
wxObjectDataPtr< MODEL_ZONES_OVERVIEW > m_modelZonesOverview
PANEL_ZONE_PROPERTIES * m_panelZoneProperties
void OnMoveDownClick(wxCommandEvent &aEvent) override
void PostProcessZoneViewSelChange(wxDataViewItem const &aItem)
std::unique_ptr< ZONE_FILLER > m_filler
void OnTableChar(wxKeyEvent &event) override
void onDialogResize(wxSizeEvent &event) override
void OnMoveUpClick(wxCommandEvent &aEvent) override
void OnUpdateDisplayedZonesClick(wxCommandEvent &aEvent) override
void MoveSelectedZonePriority(ZONE_INDEX_MOVEMENT aMove)
ZONE_SETTINGS_BAG m_zoneSettingsBag
void OnDataViewCtrlSelectionChanged(wxDataViewEvent &event) override
std::optional< unsigned > m_priorityDragIndex
void OnTableCharHook(wxKeyEvent &event) override
void OnIdle(wxIdleEvent &aEvent)
void OnZoneNetUpdate(wxCommandEvent &aEvent)
void OnCheckBoxClicked(wxCommandEvent &aEvent)
void OnFilterCtrlTextChange(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
ZONE_PREVIEW_NOTEBOOK * m_zonePreviewNotebook
void SelectZoneTableItem(wxDataViewItem const &aItem)
void OnOk(wxCommandEvent &aEvt) override
void OnFilterCtrlCancel(wxCommandEvent &aEvent) override
void OnFilterCtrlEnter(wxCommandEvent &aEvent) override
void OnZoneSelectionChanged(ZONE *aZone)
DIALOG_ZONE_MANAGER(PCB_BASE_FRAME *aParent)
void OnZonesTableRowCountChange(wxCommandEvent &aEvent)
void OnFilterCtrlSearch(wxCommandEvent &aEvent) override
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
Handle a list of polygons defining a copper zone.
Definition zone.h:74
This file is part of the common library.
Abstract pattern-matching tool and implementations.
ZONE_INDEX_MOVEMENT