KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_properties_panel.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * @author Maciej Suminski <[email protected]>
7 *
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 3
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
25
26class wxButton;
27class wxCommandEvent;
28class SELECTION;
29class SCHEMATIC;
30class SCH_BASE_FRAME;
31class SCH_COMMIT;
32class SCH_EDIT_FRAME;
33class SCH_SHEET;
34class SCH_SYMBOL;
36class PG_UNIT_EDITOR;
38class PG_COLOR_EDITOR;
39class PG_FPID_EDITOR;
40class PG_URL_EDITOR;
41
43{
44public:
45 SCH_PROPERTIES_PANEL( wxWindow* aParent, SCH_BASE_FRAME* aFrame );
46
47 virtual ~SCH_PROPERTIES_PANEL();
48
49 void UpdateData() override;
50
51 void AfterCommit() override;
52
53protected:
54 void rebuildProperties( const SELECTION& aSelection ) override;
55 wxPGProperty* createPGProperty( const PROPERTY_BASE* aProperty ) const override;
56 bool getItemValue( EDA_ITEM* aItem, PROPERTY_BASE* aProperty, wxVariant& aValue ) override;
57
58 PROPERTY_BASE* getPropertyFromEvent( const wxPropertyGridEvent& aEvent ) const;
59
60 void valueChanging( wxPropertyGridEvent& aEvent ) override;
61 void valueChanged( wxPropertyGridEvent& aEvent ) override;
62
63 bool isKeyEditable( const wxPGProperty* aPGProp ) const override;
64 bool isKeyNameInUse( const wxString& aName ) const override;
65 void onKeyRenamed( const wxString& aOldName, const wxString& aNewName ) override;
66
67 bool buildContextMenu( wxMenu& aMenu, wxPGProperty* aPGProp ) override;
68 void onNewItemLeftBlank( const wxString& aKey ) override;
69
70 void addBlankField();
72 void removeField( const wxString& aName );
73 void removeCustomProperty( const wxString& aName );
74 void onContextMenu( wxCommandEvent& aEvent );
75
77 SCH_COMMIT& aChanges, const wxString& aNewFilename );
78
79 void OnLanguageChanged( wxCommandEvent& aEvent ) override;
80
88 const SELECTION& getSelection( SELECTION& aFallbackSelection );
89
97
102 void onEditPinMap();
103
106
107protected:
115
118
119 wxPGChoices m_nets;
120
121};
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
PROPERTIES_PANEL(wxWindow *aParent, EDA_BASE_FRAME *aFrame)
Provide class metadata.Helper macro to map type hashes to names.
Holds all the data relating to one schematic.
Definition schematic.h:148
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Schematic editor (Eeschema) main window.
bool getItemValue(EDA_ITEM *aItem, PROPERTY_BASE *aProperty, wxVariant &aValue) override
Utility to fetch a property value and convert to wxVariant Precondition: aItem is known to have prope...
void onContextMenu(wxCommandEvent &aEvent)
bool buildContextMenu(wxMenu &aMenu, wxPGProperty *aPGProp) override
bool isKeyEditable(const wxPGProperty *aPGProp) const override
wxPGProperty * createPGProperty(const PROPERTY_BASE *aProperty) const override
PROPERTY_MANAGER & m_propMgr
void removeCustomProperty(const wxString &aName)
PG_CHECKBOX_EDITOR * m_checkboxEditorInstance
PG_FPID_EDITOR * m_fpEditorInstance
const SELECTION & getSelection(SELECTION &aFallbackSelection)
Get the current selection from the selection tool.
void onEditPinMap()
Open the symbol properties dialog on its Pin Map page for the single selected symbol (issue #2282).
void valueChanging(wxPropertyGridEvent &aEvent) override
PG_UNIT_EDITOR * m_unitEditorInstance
bool isKeyNameInUse(const wxString &aName) const override
void removeField(const wxString &aName)
void valueChanged(wxPropertyGridEvent &aEvent) override
void onKeyRenamed(const wxString &aOldName, const wxString &aNewName) override
SCH_PROPERTIES_PANEL(wxWindow *aParent, SCH_BASE_FRAME *aFrame)
void onNewItemLeftBlank(const wxString &aKey) override
PG_COLOR_EDITOR * m_colorEditorInstance
EDA_ITEM * getFrontItem()
Get the front item of the current selection.
PROPERTY_BASE * getPropertyFromEvent(const wxPropertyGridEvent &aEvent) const
void OnLanguageChanged(wxCommandEvent &aEvent) override
bool handleSheetFilenameChange(SCH_EDIT_FRAME *aFrame, SCH_SHEET *aSheet, SCH_COMMIT &aChanges, const wxString &aNewFilename)
void rebuildProperties(const SELECTION &aSelection) override
Generates the property grid for a given selection of items.
PG_URL_EDITOR * m_urlEditorInstance
SCH_SYMBOL * getSinglePinMappedSymbol()
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48
Schematic symbol object.
Definition sch_symbol.h:75