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, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#pragma once
27
28#include <widgets/unit_binder.h>
29#include <memory>
30#include <zone_settings.h>
32
33wxDECLARE_EVENT( EVT_ZONE_NAME_UPDATE, wxCommandEvent );
34wxDECLARE_EVENT( EVT_ZONE_NET_UPDATE, wxCommandEvent );
35
36
37class PCB_BASE_FRAME;
39
40
42{
43public:
44 PANEL_ZONE_PROPERTIES( wxWindow* aParent, PCB_BASE_FRAME* aFrame, ZONE_SETTINGS_BAG& aZonesSettingsBag );
45
46 ~PANEL_ZONE_PROPERTIES() override;
47
48 void SetZone( ZONE* new_zone );
49 ZONE* GetZone() const { return m_zone; }
50
51 std::shared_ptr<ZONE_SETTINGS> GetZoneSettings() const { return m_settings; }
52
55
56private:
57 static constexpr int INVALID_NET_CODE{ 0 };
58
64 bool AcceptOptions( bool aUseExportableSetupOnly = false );
65
66 void OnZoneNameChanged( wxCommandEvent& event ) override;
67 void onHatched( wxCommandEvent& event ) override;
68 void onNetSelector( wxCommandEvent& aEvent );
69 void OnRemoveIslandsSelection( wxCommandEvent& event ) override;
70 void OnCornerSmoothingSelection( wxCommandEvent& event ) override;
71 void OnAddLayerItem( wxCommandEvent& event ) override;
72 void OnDeleteLayerItem( wxCommandEvent& event ) override;
73
74 void updateInfoBar();
75
76private:
80 std::shared_ptr<ZONE_SETTINGS> m_settings;
81
83
85
91
97};
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
PANEL_ZONE_PROPERTIES(wxWindow *aParent, PCB_BASE_FRAME *aFrame, ZONE_SETTINGS_BAG &aZonesSettingsBag)
void OnZoneNameChanged(wxCommandEvent &event) override
void onNetSelector(wxCommandEvent &aEvent)
bool AcceptOptions(bool aUseExportableSetupOnly=false)
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:74
wxDECLARE_EVENT(EVT_ZONE_NAME_UPDATE, wxCommandEvent)
Class ZONE_SETTINGS used to handle zones parameters in dialogs.