KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_zone_properties.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) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include <widgets/unit_binder.h>
25#include <memory>
26#include <zone_settings.h>
28
29wxDECLARE_EVENT( EVT_ZONE_NAME_UPDATE, wxCommandEvent );
30wxDECLARE_EVENT( EVT_ZONE_NET_UPDATE, wxCommandEvent );
31
32
33class PCB_BASE_FRAME;
35
36
38{
39public:
40 PANEL_ZONE_PROPERTIES( wxWindow* aParent, PCB_BASE_FRAME* aFrame, ZONE_SETTINGS_BAG& aZonesSettingsBag,
41 bool allowNetSpec = true );
42
43 ~PANEL_ZONE_PROPERTIES() override;
44
45 void SetZone( ZONE* new_zone );
46 ZONE* GetZone() const { return m_zone; }
47
48 std::shared_ptr<ZONE_SETTINGS> GetZoneSettings() const { return m_settings; }
49
52
54
55private:
56 static constexpr int INVALID_NET_CODE{ 0 };
57
63 bool AcceptOptions( bool aUseExportableSetupOnly = false );
64
65 void OnZoneNameChanged( wxCommandEvent& event ) override;
66 void onHatched( wxCommandEvent& event ) override;
67 void onNetSelector( wxCommandEvent& aEvent );
68 void OnRemoveIslandsSelection( wxCommandEvent& event ) override;
69 void OnCornerSmoothingSelection( wxCommandEvent& event ) override;
70 void OnAddLayerItem( wxCommandEvent& event ) override;
71 void OnDeleteLayerItem( wxCommandEvent& event ) override;
72
73 void updateInfoBar();
74
75private:
79 std::shared_ptr<ZONE_SETTINGS> m_settings;
80
82
84
90
96};
PANEL_ZONE_PROPERTIES_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)
void OnAddLayerItem(wxCommandEvent &event) override
static constexpr int INVALID_NET_CODE
void OnZoneNameChanged(wxCommandEvent &event) override
void onNetSelector(wxCommandEvent &aEvent)
bool AcceptOptions(bool aUseExportableSetupOnly=false)
PANEL_ZONE_PROPERTIES(wxWindow *aParent, PCB_BASE_FRAME *aFrame, ZONE_SETTINGS_BAG &aZonesSettingsBag, bool allowNetSpec=true)
std::shared_ptr< ZONE_SETTINGS > GetZoneSettings() const
void onHatched(wxCommandEvent &event) override
void OnRemoveIslandsSelection(wxCommandEvent &event) override
ZONE_SETTINGS_BAG & m_zonesSettingsBag
void OnDeleteLayerItem(wxCommandEvent &event) override
std::shared_ptr< ZONE_SETTINGS > m_settings
void OnCornerSmoothingSelection(wxCommandEvent &event) override
LAYER_PROPERTIES_GRID_TABLE * m_layerPropsTable
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
wxDECLARE_EVENT(EVT_ZONE_NAME_UPDATE, wxCommandEvent)
Class ZONE_SETTINGS used to handle zones parameters in dialogs.