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, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <memory>
24#include <optional>
25#include <wx/dataview.h>
26#include <wx/event.h>
27#include <wx/radiobut.h>
28#include <kiface_base.h>
29#include <confirm.h>
30#include <pcb_edit_frame.h>
31#include <pcbnew_settings.h>
32#include <zones.h>
33#include <zone_settings_bag.h>
34#include <widgets/unit_binder.h>
35#include <zone.h>
36#include <board.h>
37#include <trigo.h>
38#include <eda_pattern_match.h>
39
41
42
46class ZONE_FILLER;
47class COMMIT;
49enum class ZONE_INDEX_MOVEMENT;
50
51
53{
54public:
57
58 bool TransferDataToWindow() override;
59
60 bool GetRepourOnClose() { return m_checkRepour->GetValue(); }
61
62 const std::vector<ZONE*>& GetZonesToDelete() const { return m_zonesToDelete; }
63
64protected:
65 void OnZoneSelectionChanged( ZONE* aZone );
66 void OnDataViewCtrlSelectionChanged( wxDataViewEvent& event ) override;
67 void SelectZoneTableItem( wxDataViewItem const& aItem );
68 void OnViewZonesOverviewOnLeftUp( wxMouseEvent& aEvent ) override;
69 void onDialogResize( wxSizeEvent& event ) override;
70 void OnOk( wxCommandEvent& aEvt ) override;
71
72#if wxUSE_DRAG_AND_DROP
73 void OnBeginDrag( wxDataViewEvent& aEvent );
74 void OnDropPossible( wxDataViewEvent& aEvent );
75 void OnDrop( wxDataViewEvent& aEvent );
76#endif // wxUSE_DRAG_AND_DROP
77
78 void OnZoneNameUpdate( wxCommandEvent& aEvent );
79 void OnZoneNetUpdate( wxCommandEvent& aEvent );
80 void OnZonesTableRowCountChange( wxCommandEvent& aEvent );
81 void OnCheckBoxClicked( wxCommandEvent& aEvent );
82
84
85 void OnMoveTopClick( wxCommandEvent& aEvent ) override;
86 void OnMoveUpClick( wxCommandEvent& aEvent ) override;
87 void OnMoveDownClick( wxCommandEvent& aEvent ) override;
88 void OnMoveBottomClick( wxCommandEvent& aEvent ) override;
89 void OnDeleteClick( wxCommandEvent& aEvent ) override;
90 void OnAutoAssignClick( wxCommandEvent& aEvent ) override;
91 void OnFilterCtrlCancel( wxCommandEvent& aEvent ) override;
92 void OnFilterCtrlSearch( wxCommandEvent& aEvent ) override;
93 void OnFilterCtrlTextChange( wxCommandEvent& aEvent ) override;
94 void OnFilterCtrlEnter( wxCommandEvent& aEvent ) override;
95 void OnLayerFilterChanged( wxCommandEvent& aEvent ) override;
96 void OnUpdateDisplayedZonesClick( wxCommandEvent& aEvent ) override;
97
98 void PostProcessZoneViewSelChange( wxDataViewItem const& aItem );
99
100 void OnTableChar( wxKeyEvent& event ) override;
101 void OnTableCharHook( wxKeyEvent& event ) override;
102
103private:
104 void GenericProcessChar( wxKeyEvent& event );
105
106 void OnIdle( wxIdleEvent& aEvent );
107 void NavigateZoneSelection( int aDirection );
108 void OnDialogCharHook( wxKeyEvent& aEvent );
109
110private:
114 wxObjectDataPtr<MODEL_ZONES_OVERVIEW> m_modelZonesOverview;
116 std::optional<unsigned> m_priorityDragIndex;
117 std::unique_ptr<ZONE_FILLER> m_filler;
120 std::vector<ZONE*> m_zonesToDelete;
121};
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition commit.h:68
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 OnMoveTopClick(wxCommandEvent &aEvent) override
void OnTableChar(wxKeyEvent &event) override
void onDialogResize(wxSizeEvent &event) override
void OnMoveUpClick(wxCommandEvent &aEvent) override
void OnDialogCharHook(wxKeyEvent &aEvent)
void OnUpdateDisplayedZonesClick(wxCommandEvent &aEvent) override
void MoveSelectedZonePriority(ZONE_INDEX_MOVEMENT aMove)
const std::vector< ZONE * > & GetZonesToDelete() const
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
void NavigateZoneSelection(int aDirection)
bool TransferDataToWindow() override
ZONE_PREVIEW_NOTEBOOK * m_zonePreviewNotebook
void SelectZoneTableItem(wxDataViewItem const &aItem)
void OnOk(wxCommandEvent &aEvt) override
void OnFilterCtrlCancel(wxCommandEvent &aEvent) override
std::vector< ZONE * > m_zonesToDelete
void OnFilterCtrlEnter(wxCommandEvent &aEvent) override
void OnMoveBottomClick(wxCommandEvent &aEvent) override
void OnZoneSelectionChanged(ZONE *aZone)
DIALOG_ZONE_MANAGER(PCB_BASE_FRAME *aParent)
void OnZonesTableRowCountChange(wxCommandEvent &aEvent)
void OnDeleteClick(wxCommandEvent &aEvent) override
void OnLayerFilterChanged(wxCommandEvent &aEvent) override
void OnFilterCtrlSearch(wxCommandEvent &aEvent) override
void OnAutoAssignClick(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:70
This file is part of the common library.
Abstract pattern-matching tool and implementations.
ZONE_INDEX_MOVEMENT